/[cvs]/eggdrop1.9/aclocal.m4
ViewVC logotype

Annotation of /eggdrop1.9/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.37 - (hide annotations) (download)
Sun Jun 24 20:37:15 2001 UTC (20 years, 3 months ago) by poptix
Branch: MAIN
Changes since 1.36: +22 -1 lines

jeff's tbuf patch

1 fabian 1.4 dnl aclocal.m4
2     dnl macros autoconf uses when building configure from configure.in
3     dnl
4 poptix 1.37 dnl $Id: aclocal.m4,v 1.36 2001/06/22 05:52:39 guppy Exp $
5 fabian 1.13 dnl
6    
7    
8     dnl EGG_MSG_CONFIGURE_START()
9 fabian 1.4 dnl
10 fabian 1.1 AC_DEFUN(EGG_MSG_CONFIGURE_START, [dnl
11     AC_MSG_RESULT()
12     AC_MSG_RESULT(This is eggdrop's GNU configure script.)
13     AC_MSG_RESULT(It's going to run a bunch of strange tests to hopefully)
14     AC_MSG_RESULT(make your compile work without much twiddling.)
15     AC_MSG_RESULT()
16     ])dnl
17 fabian 1.13
18    
19     dnl EGG_MSG_CONFIGURE_END()
20 fabian 1.4 dnl
21 fabian 1.1 AC_DEFUN(EGG_MSG_CONFIGURE_END, [dnl
22     AC_MSG_RESULT()
23     AC_MSG_RESULT(Configure is done.)
24     AC_MSG_RESULT()
25 fabian 1.10 AC_MSG_RESULT(Type 'make config' to configure the modules. Or 'make iconfig' to)
26     AC_MSG_RESULT(interactively choose which modules to compile.)
27     AC_MSG_RESULT()
28 fabian 1.1 if test -f "./$EGGEXEC"
29     then
30 fabian 1.10 AC_MSG_RESULT([After that, type 'make clean' and then 'make' to create the bot.])
31 fabian 1.1 else
32 fabian 1.10 AC_MSG_RESULT([After that, type 'make' to create the bot.])
33 fabian 1.1 fi
34     AC_MSG_RESULT()
35     ])dnl
36 fabian 1.13
37    
38     dnl EGG_CHECK_CC()
39 fabian 1.4 dnl
40 fabian 1.13 dnl FIXME: make a better test
41 fabian 1.1 AC_DEFUN(EGG_CHECK_CC, [dnl
42     if test "x${cross_compiling}" = "x"
43     then
44     cat << 'EOF' >&2
45     configure: error:
46    
47     This system does not appear to have a working C compiler.
48     A working C compiler is required to compile eggdrop.
49    
50     EOF
51     exit 1
52     fi
53     ])dnl
54 fabian 1.13
55    
56 fabian 1.28 dnl EGG_CHECK_CCPIPE()
57 fabian 1.27 dnl
58 fabian 1.28 dnl Checks whether the compiler supports the `-pipe' flag, which
59     dnl speeds up the compilation.
60     AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
61 fabian 1.27 if test -z "$no_pipe"
62     then
63     if test -n "$GCC"
64     then
65 fabian 1.28 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe,
66     [dnl
67 fabian 1.27 ac_old_CC="$CC"
68     CC="$CC -pipe"
69     AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")
70     CC="$ac_old_CC"
71     ])
72     if test "x$egg_cv_var_ccpipe" = "xyes"; then
73     CC="$CC -pipe"
74     fi
75     fi
76     fi
77     ])dnl
78    
79    
80 fabian 1.13 dnl EGG_PROG_STRIP()
81 fabian 1.4 dnl
82 fabian 1.2 AC_DEFUN(EGG_PROG_STRIP, [dnl
83     AC_CHECK_PROG(STRIP,strip,strip)
84 fabian 1.1 if test "x${STRIP}" = "x"
85     then
86     STRIP=touch
87     fi
88     ])dnl
89 fabian 1.13
90    
91     dnl EGG_PROG_AWK()
92 fabian 1.4 dnl
93 fabian 1.1 AC_DEFUN(EGG_PROG_AWK, [dnl
94     # awk is needed for Tcl library and header checks, and eggdrop version subst
95     AC_PROG_AWK
96     if test "x${AWK}" = "x"
97     then
98     cat << 'EOF' >&2
99     configure: error:
100    
101     This system seems to lack a working 'awk' command.
102     A working 'awk' command is required to compile eggdrop.
103    
104     EOF
105     exit 1
106     fi
107     ])dnl
108 fabian 1.13
109    
110     dnl EGG_PROG_BASENAME()
111 fabian 1.4 dnl
112 fabian 1.1 AC_DEFUN(EGG_PROG_BASENAME, [dnl
113     # basename is needed for Tcl library and header checks
114     AC_CHECK_PROG(BASENAME, basename, basename)
115     if test "x${BASENAME}" = "x"
116     then
117     cat << 'EOF' >&2
118     configure: error:
119    
120     This system seems to lack a working 'basename' command.
121     A working 'basename' command is required to compile eggdrop.
122    
123     EOF
124     exit 1
125     fi
126     ])dnl
127 fabian 1.13
128    
129     dnl EGG_CHECK_OS()
130 fabian 1.4 dnl
131 fabian 1.1 AC_DEFUN(EGG_CHECK_OS, [dnl
132     LINUX=no
133     IRIX=no
134     SUNOS=no
135     HPUX=no
136     MOD_CC="${CC}"
137     MOD_LD="${CC}"
138     MOD_STRIP="${STRIP}"
139     SHLIB_CC="${CC}"
140     SHLIB_LD="${CC}"
141     SHLIB_STRIP="${STRIP}"
142     NEED_DL=1
143     DEFAULT_MAKE=debug
144 fabian 1.20 MOD_EXT=so
145 fabian 1.1
146 fabian 1.25 AC_MSG_CHECKING(your os)
147     AC_CACHE_VAL(egg_cv_var_system, [egg_cv_var_system=`${UNAME}`])
148 fabian 1.1
149     case "$egg_cv_var_system" in
150     BSD/OS)
151 fabian 1.14 bsd_version=`${UNAME} -r | cut -d . -f 1`
152     case "$bsd_version" in
153     2)
154 fabian 1.24 AC_MSG_RESULT(BSD/OS 2)
155 fabian 1.14 NEED_DL=0
156     DEFAULT_MAKE=static
157     ;;
158     3)
159 fabian 1.24 AC_MSG_RESULT(BSD/OS 3)
160 fabian 1.14 MOD_CC=shlicc
161     MOD_LD=shlicc
162     MOD_STRIP="${STRIP} -d"
163     SHLIB_LD="shlicc -r"
164     SHLIB_STRIP=touch
165     AC_DEFINE(MODULES_OK)dnl
166     ;;
167     *)
168 fabian 1.24 AC_MSG_RESULT(BSD/OS 4+)
169 fabian 1.14 CFLAGS="$CFLAGS -Wall"
170     MOD_LD="${CC} "
171     MOD_STRIP="${STRIP} -d"
172 fabian 1.27 SHLIB_CC="${CC} -export-dynamic -fPIC"
173 fabian 1.14 SHLIB_LD="${CC} -shared -nostartfiles"
174     AC_DEFINE(MODULES_OK)dnl
175     ;;
176     esac
177 fabian 1.1 ;;
178     CYGWIN*)
179 fabian 1.20 cygwin_version=`${UNAME} -r | cut -c 1-3`
180     case "$cygwin_version" in
181     1.*)
182     AC_MSG_RESULT(Cygwin 1.x)
183     NEED_DL=0
184     SHLIB_LD="${CC} -shared"
185 poptix 1.34 CC="$CC -mwin32"
186     MOD_CC="${CC}"
187     MOD_LD="${CC}"
188 fabian 1.20 MOD_EXT=dll
189     AC_DEFINE(MODULES_OK)dnl
190     ;;
191     *)
192     AC_MSG_RESULT(Cygwin pre 1.0 or unknown)
193     NEED_DL=0
194     DEFAULT_MAKE=static
195     ;;
196     esac
197 fabian 1.1 ;;
198     HP-UX)
199 fabian 1.28 AC_MSG_RESULT(HP-UX)
200 fabian 1.1 HPUX=yes
201 fabian 1.28 MOD_LD="${CC} -fPIC -shared"
202     SHLIB_CC="${CC} -fPIC"
203 fabian 1.1 SHLIB_LD="ld -b"
204     NEED_DL=0
205     AC_DEFINE(MODULES_OK)dnl
206     AC_DEFINE(HPUX_HACKS)dnl
207     if test "x`${UNAME} -r | cut -d . -f 2`" = "x10"
208     then
209     AC_DEFINE(HPUX10_HACKS)dnl
210     fi
211     ;;
212 fabian 1.17 dell)
213     AC_MSG_RESULT(Dell SVR4)
214     SHLIB_STRIP=touch
215     NEED_DL=0
216 fabian 1.28 MOD_LD="${CC} -lelf -lucb"
217 fabian 1.17 ;;
218 guppy 1.33 IRIX)
219     echo "$ac_t""IRIX (Have fun with IRIX 4.+!)" 1>&6
220 fabian 1.28 SHLIB_LD="ld -n32 -shared -rdata_shared"
221 fabian 1.1 IRIX=yes
222 fabian 1.28 SHLIB_STRIP=touch
223 fabian 1.1 NEED_DL=0
224     DEFAULT_MAKE=static
225 fabian 1.24 ;;
226 fabian 1.11 Ultrix)
227     AC_MSG_RESULT(Ultrix)
228     NEED_DL=0
229     SHLIB_STRIP=touch
230 fabian 1.28 DEFAULT_MAKE=static
231 fabian 1.21 SHELL=/bin/sh5
232 fabian 1.11 ;;
233 fabian 1.23 SINIX*)
234 fabian 1.28 AC_MSG_RESULT(SINIX)
235 fabian 1.23 NEED_DL=0
236     SHLIB_STRIP=touch
237 fabian 1.28 DEFAULT_MAKE=static
238 fabian 1.23 SHLIB_CC="cc -G"
239     ;;
240 fabian 1.11 BeOS)
241     AC_MSG_RESULT(BeOS)
242     NEED_DL=0
243     SHLIB_STRIP=strip
244 fabian 1.28 DEFAULT_MAKE=static
245 fabian 1.1 ;;
246     Linux)
247 fabian 1.28 AC_MSG_RESULT(Linux)
248 fabian 1.1 LINUX=yes
249     CFLAGS="$CFLAGS -Wall"
250     MOD_LD="${CC}"
251 fabian 1.27 SHLIB_CC="${CC} -fPIC"
252 fabian 1.1 SHLIB_LD="${CC} -shared -nostartfiles"
253     AC_DEFINE(MODULES_OK)dnl
254     ;;
255     Lynx)
256     AC_MSG_RESULT(Lynx OS)
257 fabian 1.28 NEED_DL=0
258     DEFAULT_MAKE=static
259     SHLIB_STRIP=strip
260 fabian 1.1 ;;
261     OSF1)
262 fabian 1.28 AC_MSG_RESULT(OSF)
263 fabian 1.1 case `${UNAME} -r | cut -d . -f 1` in
264     V*)
265     AC_MSG_RESULT([ Digital OSF])
266     if test "x$AWK" = "xgawk"
267     then
268     AWK=awk
269     fi
270     MOD_CC=cc
271     MOD_LD=cc
272     SHLIB_CC=cc
273 fabian 1.19 SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
274 fabian 1.1 SHLIB_STRIP=touch
275     AC_DEFINE(MODULES_OK)dnl
276     ;;
277     1.0|1.1|1.2)
278     AC_MSG_RESULT([ pre 1.3])
279     SHLIB_LD="ld -R -export $@:"
280     AC_DEFINE(MODULES_OK)dnl
281     AC_DEFINE(OSF1_HACKS)dnl
282     ;;
283     1.*)
284     AC_MSG_RESULT([ 1.3+])
285     SHLIB_CC="${CC} -fpic"
286     SHLIB_LD="ld -shared"
287     AC_DEFINE(MODULES_OK)dnl
288     AC_DEFINE(OSF1_HACKS)dnl
289     ;;
290     *)
291     AC_MSG_RESULT([ Some other weird OSF! No modules for you...])
292     NEED_DL=0
293     DEFAULT_MAKE=static
294     ;;
295     esac
296     AC_DEFINE(STOP_UAC)dnl
297     ;;
298     SunOS)
299     if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"
300     then
301 fabian 1.28 AC_MSG_RESULT(Solaris)
302 guppy 1.32 if test -n "$GCC"
303     then
304     SHLIB_CC="${CC} -fPIC"
305     SHLIB_LD="${CC}"
306     else
307 fabian 1.28 SHLIB_CC="${CC} -KPIC"
308 guppy 1.32 SHLIB_LD="${CC} -G -z text"
309     fi
310 fabian 1.1 else
311 fabian 1.28 AC_MSG_RESULT(SunOS)
312 fabian 1.1 SUNOS=yes
313     SHLIB_LD=ld
314 fabian 1.29 SHLIB_CC="${CC} -PIC"
315 fabian 1.1 AC_DEFINE(DLOPEN_1)dnl
316     fi
317     AC_DEFINE(MODULES_OK)dnl
318     ;;
319     *BSD)
320     AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison)
321 fabian 1.27 SHLIB_CC="${CC} -fPIC"
322 fabian 1.1 SHLIB_LD="ld -Bshareable -x"
323     AC_DEFINE(MODULES_OK)dnl
324     ;;
325     *)
326     if test -r "/mach"
327     then
328 fabian 1.29 AC_MSG_RESULT(Something Mach based)
329 fabian 1.1 NEED_DL=0
330     DEFAULT_MAKE=static
331     AC_DEFINE(BORGCUBES)dnl
332     else
333     if test -r "/cmds"
334     then
335     AC_MSG_RESULT(QNX)
336     SHLIB_STRIP=touch
337     NEED_DL=0
338     DEFAULT_MAKE=static
339     else
340     AC_MSG_RESULT(Something unknown!)
341     AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
342     NEED_DL=0
343     DEFAULT_MAKE=static
344     fi
345     fi
346     ;;
347     esac
348     AC_SUBST(MOD_LD)dnl
349     AC_SUBST(MOD_CC)dnl
350     AC_SUBST(MOD_STRIP)dnl
351     AC_SUBST(SHLIB_LD)dnl
352     AC_SUBST(SHLIB_CC)dnl
353     AC_SUBST(SHLIB_STRIP)dnl
354     AC_SUBST(DEFAULT_MAKE)dnl
355 fabian 1.20 AC_SUBST(MOD_EXT)dnl
356     AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "${MOD_EXT}")dnl
357 fabian 1.1 ])dnl
358 fabian 1.13
359    
360     dnl EGG_CHECK_LIBS()
361 fabian 1.4 dnl
362 fabian 1.1 AC_DEFUN(EGG_CHECK_LIBS, [dnl
363     if test "$IRIX" = "yes"
364     then
365     AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
366     else
367     AC_CHECK_LIB(socket, socket)
368     AC_CHECK_LIB(nsl, connect)
369     AC_CHECK_LIB(dns, gethostbyname)
370     AC_CHECK_LIB(dl, dlopen)
371 fabian 1.22 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
372 fabian 1.1 # This is needed for Tcl libraries compiled with thread support
373 fabian 1.28 AC_CHECK_LIB(pthread, pthread_mutex_init,
374 guppy 1.36 ac_cv_lib_pthread_pthread_mutex_init=yes,
375     ac_cv_lib_pthread_pthread_mutex_init=no)
376     if test "$ac_cv_lib_pthread_pthread_mutex_init" = "no"; then
377     AC_CHECK_LIB(pthread,__pthread_mutex_init,
378     ac_cv_lib_pthread_pthread_mutex_init=yes,
379     ac_cv_lib_pthread_pthread_mutex_init=no)
380     fi
381     if test "$ac_cv_lib_pthread_pthread_mutex_init" = "no"; then
382     AC_CHECK_LIB(pthreads,pthread_mutex_init,
383     ac_cv_lib_pthreads_pthread_mutex_init=yes,
384     ac_cv_lib_pthreads_pthread_mutex_init=no)
385     fi
386 fabian 1.1 if test "$SUNOS" = "yes"
387     then
388     # For suns without yp or something like that
389     AC_CHECK_LIB(dl, main)
390     else
391     if test "$HPUX" = "yes"
392     then
393     AC_CHECK_LIB(dld, shl_load)
394     fi
395     fi
396     fi
397     ])dnl
398 fabian 1.13
399    
400     dnl EGG_CHECK_FUNC_VSPRINTF()
401 fabian 1.4 dnl
402 fabian 1.1 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
403     AC_CHECK_FUNCS(vsprintf)
404     if test "x${ac_cv_func_vsprintf}" = "xno"
405     then
406     cat << 'EOF' >&2
407     configure: error:
408    
409     Your system does not have the sprintf/vsprintf libraries.
410     These are required to compile almost anything. Sorry.
411    
412     EOF
413     exit 1
414     fi
415     ])dnl
416 fabian 1.13
417 poptix 1.37 dnl EGG_CHECK_LIBSAFE_SSCANF()
418     dnl
419     AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
420     AC_CACHE_CHECK(whether libsafe broke sscanf, egg_cv_var_libsafe_sscanf,
421     [dnl
422     AC_TRY_RUN([#include <stdio.h>
423     int main()
424     {
425     char *src = "0x001,guppyism\n";
426     char dst[10];
427     int idx;
428     if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
429     exit(1);
430     return 0;
431     }],egg_cv_var_libsafe_sscanf="no",egg_cv_var_libsafe_sscanf="yes",
432     egg_cv_var_libsafe_sscanf="no")
433     ])
434     if test "x$egg_cv_var_libsafe_sscanf" == "xyes"; then
435     AC_DEFINE(LIBSAFE_HACKS)dnl
436     fi
437     ])dnl
438 fabian 1.13
439     dnl EGG_HEADER_STDC()
440 fabian 1.4 dnl
441 fabian 1.1 AC_DEFUN(EGG_HEADER_STDC, [dnl
442     if test "x${ac_cv_header_stdc}" = "xno"
443     then
444     cat << 'EOF' >&2
445     configure: error:
446    
447     Your system must support ANSI C Header files.
448     These are required for the language support. Sorry.
449    
450     EOF
451     exit 1
452     fi
453     ])dnl
454 fabian 1.13
455 guppy 1.35 dnl EGG_CHECK_LIBSAFE_SSCANF()
456     dnl
457     AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
458     AC_CACHE_CHECK(whether libsafe broke sscanf, egg_cv_var_libsafe_sscanf,
459     [dnl
460     AC_TRY_RUN([#include <stdio.h>
461     int main()
462     {
463     char *src = "0x001,guppyism\n";
464     char dst[10];
465     int idx;
466     if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
467     exit(1);
468     return 0;
469     }],egg_cv_var_libsafe_sscanf="no",egg_cv_var_libsafe_sscanf="yes",
470     egg_cv_var_libsafe_sscanf="no")
471     ])
472 guppy 1.36 if test "x$egg_cv_var_libsafe_sscanf" = "xyes"; then
473 guppy 1.35 AC_DEFINE(LIBSAFE_HACKS)dnl
474     fi
475     ])dnl
476 fabian 1.13
477     dnl EGG_CYGWIN()
478 fabian 1.4 dnl
479 fabian 1.28 dnl Check for Cygwin support.
480 fabian 1.1 AC_DEFUN(EGG_CYGWIN, [dnl
481     AC_CYGWIN
482     if test ! "x${CYGWIN}" = "x"
483     then
484     AC_DEFINE(CYGWIN_HACKS)dnl
485     fi
486     ])dnl
487 fabian 1.13
488    
489     dnl EGG_EXEEXT()
490 fabian 1.4 dnl
491 fabian 1.28 dnl Test for executable suffix and define eggdrop's executable name
492     dnl accordingly.
493 fabian 1.1 AC_DEFUN(EGG_EXEEXT, [dnl
494     EGGEXEC=eggdrop
495     AC_EXEEXT
496     if test ! "x${EXEEXT}" = "x"
497     then
498     EGGEXEC=eggdrop${EXEEXT}
499     fi
500     AC_SUBST(EGGEXEC)dnl
501     ])dnl
502 fabian 1.13
503    
504     dnl EGG_TCL_ARG_WITH()
505 fabian 1.4 dnl
506 fabian 1.1 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
507     # oohh new configure --variables for those with multiple tcl libs
508     AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
509     AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
510    
511 fabian 1.3 WARN=0
512 fabian 1.1 # Make sure either both or neither $tcllibname and $tclincname are set
513     if test ! "x${tcllibname}" = "x"
514     then
515     if test "x${tclincname}" = "x"
516     then
517 fabian 1.3 WARN=1
518 fabian 1.1 tcllibname=""
519     TCLLIB=""
520     TCLINC=""
521     fi
522     else
523     if test ! "x${tclincname}" = "x"
524     then
525 fabian 1.3 WARN=1
526     tclincname=""
527     TCLLIB=""
528     TCLINC=""
529     fi
530     fi
531     if test ${WARN} = 1
532     then
533     cat << 'EOF' >&2
534 fabian 1.1 configure: warning:
535    
536     You must specify both --with-tcllib and --with-tclinc for them to work.
537     configure will now attempt to autodetect both the Tcl library and header...
538    
539     EOF
540     fi
541     ])dnl
542 fabian 1.13
543    
544     dnl EGG_TCL_ENV()
545 fabian 1.4 dnl
546 fabian 1.1 AC_DEFUN(EGG_TCL_ENV, [dnl
547 fabian 1.3 WARN=0
548 fabian 1.1 # Make sure either both or neither $TCLLIB and $TCLINC are set
549     if test ! "x${TCLLIB}" = "x"
550     then
551     if test "x${TCLINC}" = "x"
552     then
553 fabian 1.3 WARN=1
554     WVAR1=TCLLIB
555     WVAR2=TCLINC
556 fabian 1.1 TCLLIB=""
557     fi
558     else
559     if test ! "x${TCLINC}" = "x"
560     then
561 fabian 1.3 WARN=1
562     WVAR1=TCLINC
563     WVAR2=TCLLIB
564     TCLINC=""
565     fi
566     fi
567     if test ${WARN} = 1
568     then
569 fabian 1.5 cat << EOF >&2
570 fabian 1.1 configure: warning:
571    
572 fabian 1.3 Environment variable ${WVAR1} was set, but I did not detect ${WVAR2}.
573 fabian 1.1 Please set both TCLLIB and TCLINC correctly if you wish to use them.
574     configure will now attempt to autodetect both the Tcl library and header...
575    
576     EOF
577     fi
578     ])dnl
579 fabian 1.13
580    
581     dnl EGG_TCL_WITH_TCLLIB()
582 fabian 1.4 dnl
583 fabian 1.1 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
584     # Look for Tcl library: if $tcllibname is set, check there first
585     if test ! "x${tcllibname}" = "x"
586     then
587     if test -f "$tcllibname" && test -r "$tcllibname"
588     then
589 fabian 1.3 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
590 fabian 1.1 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
591     TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
592     TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
593     else
594     cat << EOF >&2
595     configure: warning:
596    
597     The file '$tcllibname' given to option --with-tcllib is not valid.
598     configure will now attempt to autodetect both the Tcl library and header...
599    
600     EOF
601     tcllibname=""
602     tclincname=""
603     TCLLIB=""
604     TCLLIBFN=""
605     TCLINC=""
606     TCLINCFN=""
607     fi
608     fi
609     ])dnl
610 fabian 1.13
611    
612     dnl EGG_TCL_WITH_TCLINC()
613 fabian 1.4 dnl
614 fabian 1.1 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
615     # Look for Tcl header: if $tclincname is set, check there first
616     if test ! "x${tclincname}" = "x"
617     then
618     if test -f "$tclincname" && test -r "$tclincname"
619     then
620 fabian 1.3 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
621 fabian 1.1 TCLINCFN=`$BASENAME $tclincname`
622     else
623     cat << EOF >&2
624     configure: warning:
625    
626     The file '$tclincname' given to option --with-tclinc is not valid.
627     configure will now attempt to autodetect both the Tcl library and header...
628    
629     EOF
630     tcllibname=""
631     tclincname=""
632     TCLLIB=""
633     TCLLIBFN=""
634     TCLINC=""
635     TCLINCFN=""
636     fi
637     fi
638     ])dnl
639 fabian 1.13
640    
641     dnl EGG_TCL_FIND_LIBRARY()
642 fabian 1.4 dnl
643 fabian 1.1 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
644     # Look for Tcl library: if $TCLLIB is set, check there first
645     if test "x${TCLLIBFN}" = "x"
646     then
647     if test ! "x${TCLLIB}" = "x"
648     then
649     if test -d "${TCLLIB}"
650     then
651     for tcllibfns in $tcllibnames
652     do
653     for tcllibext in $tcllibextensions
654     do
655     if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
656     then
657     TCLLIBFN=$tcllibfns$tcllibext
658     TCLLIBEXT=$tcllibext
659     TCLLIBFNS=$tcllibfns
660     break 2
661     fi
662     done
663     done
664     fi
665     if test "x${TCLLIBFN}" = "x"
666     then
667     cat << 'EOF' >&2
668     configure: warning:
669    
670     Environment variable TCLLIB was set, but incorrect.
671     Please set both TCLLIB and TCLINC correctly if you wish to use them.
672     configure will now attempt to autodetect both the Tcl library and header...
673    
674     EOF
675     TCLLIB=""
676     TCLLIBFN=""
677     TCLINC=""
678     TCLINCFN=""
679     fi
680     fi
681     fi
682     ])dnl
683 fabian 1.13
684    
685     dnl EGG_TCL_FIND_HEADER()
686 fabian 1.4 dnl
687 fabian 1.1 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
688     # Look for Tcl header: if $TCLINC is set, check there first
689     if test "x${TCLINCFN}" = "x"
690     then
691     if test ! "x${TCLINC}" = "x"
692     then
693     if test -d "${TCLINC}"
694     then
695     for tclheaderfn in $tclheadernames
696     do
697     if test -r "$TCLINC/$tclheaderfn"
698     then
699     TCLINCFN=$tclheaderfn
700 fabian 1.3 break
701 fabian 1.1 fi
702     done
703     fi
704     if test "x${TCLINCFN}" = "x"
705     then
706     cat << 'EOF' >&2
707     configure: warning:
708    
709     Environment variable TCLINC was set, but incorrect.
710     Please set both TCLLIB and TCLINC correctly if you wish to use them.
711     configure will now attempt to autodetect both the Tcl library and header...
712    
713     EOF
714     TCLLIB=""
715     TCLLIBFN=""
716     TCLINC=""
717     TCLINCFN=""
718     fi
719     fi
720     fi
721     ])dnl
722 fabian 1.13
723    
724     dnl EGG_TCL_CHECK_LIBRARY()
725 fabian 1.4 dnl
726 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
727     AC_MSG_CHECKING(for Tcl library)
728    
729     # Attempt autodetect for $TCLLIBFN if it's not set
730     if test ! "x${TCLLIBFN}" = "x"
731     then
732     AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
733     else
734     for tcllibfns in $tcllibnames
735     do
736     for tcllibext in $tcllibextensions
737     do
738     for tcllibpath in $tcllibpaths
739     do
740     if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
741     then
742     AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
743     TCLLIB=$tcllibpath
744     TCLLIBFN=$tcllibfns$tcllibext
745     TCLLIBEXT=$tcllibext
746     TCLLIBFNS=$tcllibfns
747     break 3
748     fi
749     done
750     done
751     done
752     fi
753    
754     # Show if $TCLLIBFN wasn't found
755     if test "x${TCLLIBFN}" = "x"
756     then
757     AC_MSG_RESULT(not found)
758     fi
759     AC_SUBST(TCLLIB)dnl
760     AC_SUBST(TCLLIBFN)dnl
761     ])dnl
762 fabian 1.13
763    
764     dnl EGG_TCL_CHECK_HEADER()
765 fabian 1.4 dnl
766 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
767     AC_MSG_CHECKING(for Tcl header)
768    
769     # Attempt autodetect for $TCLINCFN if it's not set
770     if test ! "x${TCLINCFN}" = "x"
771     then
772     AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
773     else
774     for tclheaderpath in $tclheaderpaths
775     do
776     for tclheaderfn in $tclheadernames
777     do
778     if test -r "$tclheaderpath/$tclheaderfn"
779     then
780     AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
781     TCLINC=$tclheaderpath
782     TCLINCFN=$tclheaderfn
783     break 2
784     fi
785     done
786     done
787     # FreeBSD hack ...
788     if test "x${TCLINCFN}" = "x"
789     then
790     for tcllibfns in $tcllibnames
791     do
792     for tclheaderpath in $tclheaderpaths
793     do
794     for tclheaderfn in $tclheadernames
795     do
796     if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
797     then
798     AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
799     TCLINC=$tclheaderpath/$tcllibfns
800     TCLINCFN=$tclheaderfn
801     break 3
802     fi
803     done
804     done
805     done
806     fi
807     fi
808    
809     # Show if $TCLINCFN wasn't found
810     if test "x${TCLINCFN}" = "x"
811     then
812     AC_MSG_RESULT(not found)
813     fi
814     AC_SUBST(TCLINC)dnl
815     AC_SUBST(TCLINCFN)dnl
816     ])dnl
817 fabian 1.13
818    
819 fabian 1.28 dnl EGG_CACHE_UNSET(CACHE-ID)
820     dnl
821     dnl Unsets a certain cache item. Typically called before using
822     dnl the AC_CACHE_*() macros.
823     AC_DEFUN(EGG_CACHE_UNSET, [dnl
824     unset $1
825     ])
826    
827    
828     dnl EGG_TCL_DETECT_CHANGE()
829     dnl
830     dnl Detect whether the tcl system has changed since our last
831     dnl configure run. Set egg_tcl_changed accordingly.
832     dnl
833     dnl Tcl related feature and version checks should re-run their
834     dnl checks as soon as egg_tcl_changed is set to "yes".
835     AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
836     AC_MSG_CHECKING(whether the tcl system has changed)
837     egg_tcl_changed=yes
838     egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
839     if test "${egg_tcl_id}" != ":::"; then
840     egg_tcl_cached=yes
841     AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
842     egg_cv_var_tcl_id="$egg_tcl_id"
843     egg_tcl_cached=no
844     ])
845     if test "${egg_tcl_cached}" = "yes"; then
846     if test "x${egg_cv_var_tcl_id}" = "x${egg_tcl_id}"; then
847     egg_tcl_changed=no
848     else
849     egg_cv_var_tcl_id="$egg_tcl_id"
850     fi
851     fi
852     fi
853     if test "$egg_tcl_changed" = "yes"; then
854     AC_MSG_RESULT(yes)
855     else
856     AC_MSG_RESULT(no)
857     fi
858     ])
859    
860    
861 fabian 1.13 dnl EGG_TCL_CHECK_VERSION()
862 fabian 1.4 dnl
863 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
864     # Both TCLLIBFN & TCLINCFN must be set, or we bail
865 fabian 1.12 TCL_FOUND=0
866 fabian 1.28 if test "x${TCLLIBFN}" != "x" && test "x${TCLINCFN}" != "x"
867 fabian 1.1 then
868     TCL_FOUND=1
869    
870     # Check Tcl's version
871 fabian 1.28 if test "$egg_tcl_changed" = "yes"; then
872     EGG_CACHE_UNSET(egg_cv_var_tcl_version)
873     fi
874 fabian 1.1 AC_MSG_CHECKING(for Tcl version)
875 fabian 1.25 AC_CACHE_VAL(egg_cv_var_tcl_version, [
876     egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
877     ])
878 fabian 1.1
879     if test ! "x${egg_cv_var_tcl_version}" = "x"
880     then
881     AC_MSG_RESULT($egg_cv_var_tcl_version)
882     else
883     AC_MSG_RESULT(not found)
884     TCL_FOUND=0
885     fi
886    
887     # Check Tcl's patch level (if avaliable)
888 fabian 1.28 if test "$egg_tcl_changed" = "yes"; then
889     EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
890     fi
891 fabian 1.1 AC_MSG_CHECKING(for Tcl patch level)
892 fabian 1.25 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [
893 fabian 1.1 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
894 fabian 1.25 ])
895 fabian 1.1
896     if test ! "x${egg_cv_var_tcl_patch_level}" = "x"
897     then
898     AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
899     else
900     egg_cv_var_tcl_patch_level="unknown"
901     AC_MSG_RESULT(unknown)
902     fi
903     fi
904    
905     # Check if we found Tcl's version
906     if test $TCL_FOUND = 0
907     then
908     cat << 'EOF' >&2
909     configure: error:
910    
911     I can't find Tcl on this system.
912    
913 fabian 1.28 Eggdrop requires Tcl to compile. If you already have Tcl installed
914     on this system, and I just wasn't looking in the right place for it,
915     set the environment variables TCLLIB and TCLINC so I will know where
916     to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
917     run 'configure' again.
918 fabian 1.1
919 fabian 1.28 Read the README file if you don't know what Tcl is or how to get it
920     and install it.
921 fabian 1.1
922     EOF
923     exit 1
924     fi
925     ])dnl
926 fabian 1.13
927    
928     dnl EGG_TCL_CHECK_PRE70()
929 fabian 1.4 dnl
930 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
931     # Is this version of Tcl too old for us to use ?
932     TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
933 fabian 1.12 if test "x$TCL_VER_PRE70" = "xyes"
934 fabian 1.1 then
935     cat << EOF >&2
936     configure: error:
937    
938     Your Tcl version is much too old for eggdrop to use.
939     I suggest you download and complie a more recent version.
940     The most reliable current version is $tclrecommendver and
941     can be downloaded from $tclrecommendsite
942    
943     EOF
944     exit 1
945     fi
946     ])dnl
947 fabian 1.13
948    
949     dnl EGG_TCL_CHECK_PRE75()
950 fabian 1.4 dnl
951 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
952     # Are we using a pre 7.5 Tcl version ?
953     TCL_VER_PRE75=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 5)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
954     if test "x${TCL_VER_PRE75}" = "xyes"
955     then
956     AC_DEFINE(HAVE_PRE7_5_TCL)dnl
957     fi
958     ])dnl
959 fabian 1.13
960    
961     dnl EGG_TCL_TESTLIBS()
962 fabian 1.4 dnl
963 fabian 1.1 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
964     # Setup TCL_TESTLIBS for Tcl library tests
965     if test ! "x${TCLLIBEXT}" = "x.a"
966     then
967 fabian 1.22 TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"
968 fabian 1.1 else
969     if test ! "x${tcllibname}" = "x"
970     then
971 fabian 1.22 TCL_TESTLIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB $LIBS"
972 fabian 1.1 else
973 fabian 1.22 TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"
974 fabian 1.1 fi
975     fi
976 guppy 1.36 if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"; then
977 fabian 1.1 TCL_TESTLIBS="-lpthread $TCL_TESTLIBS"
978 guppy 1.36 else
979     if text "x${ac_cv_lib_pthreads_pthread_mutex_init}" = "xyes"; then
980     TCL_TESTLIBS="-lpthreads $TCL_TESTLIBS"
981     fi
982 fabian 1.1 fi
983     ])dnl
984 fabian 1.13
985    
986     dnl EGG_TCL_CHECK_FREE()
987 fabian 1.4 dnl
988 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
989     # Check for Tcl_Free()
990 fabian 1.28 if test "$egg_tcl_changed" = "yes"; then
991     EGG_CACHE_UNSET(egg_cv_var_tcl_free)
992     fi
993     AC_CACHE_CHECK(if Tcl library has Tcl_Free, [egg_cv_var_tcl_free], [
994 fabian 1.1 ac_save_LIBS="$LIBS"
995     LIBS="$TCL_TESTLIBS"
996     cat > conftest.$ac_ext << EOF
997     #include "confdefs.h"
998     char Tcl_Free();
999    
1000     int main() {
1001     Tcl_Free();
1002     return 0;
1003     }
1004     EOF
1005     if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
1006     then
1007     rm -rf conftest*
1008 fabian 1.25 egg_cv_var_tcl_free=yes
1009 fabian 1.1 else
1010     echo "configure: failed program was:" >&5
1011     cat conftest.$ac_ext >&5
1012     rm -rf conftest*
1013 fabian 1.25 egg_cv_var_tcl_free=no
1014 fabian 1.1 fi
1015     rm -f conftest*
1016     LIBS="$ac_save_LIBS"
1017 fabian 1.25 ])
1018 fabian 1.1
1019     if test "x${egg_cv_var_tcl_free}" = "xyes"
1020     then
1021     AC_DEFINE(HAVE_TCL_FREE)dnl
1022     fi
1023     ])dnl
1024 fabian 1.13
1025    
1026 guppy 1.30 dnl EGG_TCL_ENABLE_THREADS()
1027     dnl
1028     AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl
1029     AC_ARG_ENABLE(tcl-threads,
1030     [ --disable-tcl-threads Disable threaded tcl support if detected. (Ignore this
1031     option unless you know what you are doing)],
1032     enable_tcl_threads=$enableval,
1033     enable_tcl_threads=yes)
1034     ])dnl
1035    
1036    
1037 fabian 1.13 dnl EGG_TCL_CHECK_THREADS()
1038 fabian 1.4 dnl
1039 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1040     # Check for TclpFinalizeThreadData()
1041 fabian 1.28 if test "$egg_tcl_changed" = "yes"; then
1042 guppy 1.30 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1043 fabian 1.28 fi
1044 guppy 1.30 AC_CACHE_CHECK(if Tcl library is threaded, egg_cv_var_tcl_threaded, [
1045 fabian 1.1 ac_save_LIBS="$LIBS"
1046     LIBS="$TCL_TESTLIBS"
1047     cat > conftest.$ac_ext << EOF
1048     #include "confdefs.h"
1049     char TclpFinalizeThreadData();
1050    
1051     int main() {
1052     TclpFinalizeThreadData();
1053     return 0;
1054     }
1055     EOF
1056     if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
1057     then
1058     rm -rf conftest*
1059 guppy 1.30 egg_cv_var_tcl_threaded=yes
1060 fabian 1.1 else
1061     echo "configure: failed program was:" >&5
1062     cat conftest.$ac_ext >&5
1063     rm -rf conftest*
1064 guppy 1.30 egg_cv_var_tcl_threaded=no
1065 fabian 1.1 fi
1066     rm -f conftest*
1067     LIBS="$ac_save_LIBS"
1068 fabian 1.25 ])
1069 fabian 1.1
1070 guppy 1.30 if test "x${egg_cv_var_tcl_threaded}" = "xyes"
1071 fabian 1.1 then
1072 guppy 1.30 if test "x$enable_tcl_threads" = "xno"
1073     then
1074    
1075     cat << 'EOF' >&2
1076     configure: warning:
1077    
1078     You have disabled threads support on a system with a threaded Tcl library.
1079     Tcl features that rely on scheduled events may not function properly.
1080    
1081     EOF
1082     else
1083     AC_DEFINE(HAVE_TCL_THREADS)dnl
1084     fi
1085 fabian 1.1
1086     # Add -lpthread to $LIBS if we have it
1087 guppy 1.36 if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"; then
1088 fabian 1.1 LIBS="-lpthread $LIBS"
1089 guppy 1.36 else
1090     if text "x${ac_cv_lib_pthreads_pthread_mutex_init}" = "xyes"; then
1091     TCL_TESTLIBS="-lpthreads $TCL_TESTLIBS"
1092     fi
1093 fabian 1.1 fi
1094     fi
1095     ])dnl
1096 fabian 1.13
1097    
1098     dnl EGG_TCL_LIB_REQS()
1099 fabian 1.4 dnl
1100 fabian 1.1 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1101     if test ! "x${TCLLIBEXT}" = "x.a"
1102     then
1103     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1104 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1105 fabian 1.1 else
1106    
1107     # Set default make as static for unshared Tcl library
1108     if test ! "$DEFAULT_MAKE" = "static"
1109     then
1110     cat << 'EOF' >&2
1111     configure: warning:
1112    
1113     Your Tcl library is not a shared lib.
1114     configure will now set default make type to static...
1115    
1116     EOF
1117     DEFAULT_MAKE=static
1118     AC_SUBST(DEFAULT_MAKE)dnl
1119     fi
1120    
1121     # Are we using a pre 7.4 Tcl version ?
1122     TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
1123     if test "x${TCL_VER_PRE74}" = "xno"
1124     then
1125    
1126     # Was the --with-tcllib option given ?
1127     if test ! "x${tcllibname}" = "x"
1128     then
1129     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1130 fabian 1.22 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1131 fabian 1.1 else
1132     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1133 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1134 fabian 1.1 fi
1135     else
1136     cat << EOF >&2
1137     configure: warning:
1138    
1139     Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1140     There are known problems, but we will attempt to work around them.
1141    
1142     EOF
1143     TCL_REQS="libtcle.a"
1144 fabian 1.25 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1145 fabian 1.1 fi
1146     fi
1147     AC_SUBST(TCL_REQS)dnl
1148     AC_SUBST(TCL_LIBS)dnl
1149     ])dnl
1150 fabian 1.13
1151    
1152     dnl EGG_FUNC_DLOPEN()
1153 fabian 1.4 dnl
1154 fabian 1.1 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1155     if test $NEED_DL = 1 && test "x${ac_cv_func_dlopen}" = "xno"
1156     then
1157     if test "$LINUX" = "yes"
1158     then
1159     cat << 'EOF' >&2
1160     configure: warning:
1161    
1162     Since you are on a Linux system, this has a known problem...
1163     I know a kludge for it,
1164     EOF
1165    
1166     if test -r "/lib/libdl.so.1"
1167     then
1168     cat << 'EOF' >&2
1169     and you seem to have it, so we'll do that...
1170    
1171     EOF
1172     AC_DEFINE(HAVE_DLOPEN)dnl
1173     LIBS="/lib/libdl.so.1 $LIBS"
1174     else
1175     cat << 'EOF' >&2
1176     which you DON'T seem to have... doh!
1177     perhaps you may still have the stuff lying around somewhere
1178     if you work out where it is, add it to your XLIBS= lines
1179     and #define HAVE_DLOPEN in config.h
1180    
1181     we'll proceed on anyway, but you probably won't be able
1182     to 'make eggdrop' but you might be able to make the
1183     static bot (I'll default your make to this version).
1184    
1185     EOF
1186     DEFAULT_MAKE=static
1187     fi
1188     else
1189     cat << 'EOF' >&2
1190     configure: warning:
1191    
1192     You don't seem to have libdl anywhere I can find it, this will
1193     prevent you from doing dynamic modules, I'll set your default
1194     make to static linking.
1195    
1196     EOF
1197     DEFAULT_MAKE=static
1198     fi
1199     fi
1200     ])dnl
1201 fabian 1.13
1202    
1203     dnl EGG_SUBST_EGGVERSION()
1204 fabian 1.4 dnl
1205 fabian 1.1 AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1206 fabian 1.10 EGGVERSION=`grep 'char.egg_version' ${srcdir}/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1207 fabian 1.6 egg_version_num=`echo ${EGGVERSION} | $AWK 'BEGIN { FS = "."; } { printf("%d%02d%02d", [$]1, [$]2, [$]3); }'`
1208 fabian 1.1 AC_SUBST(EGGVERSION)dnl
1209 fabian 1.6 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1210 fabian 1.1 ])dnl
1211 fabian 1.13
1212    
1213     dnl EGG_SUBST_DEST()
1214 fabian 1.4 dnl
1215 fabian 1.1 AC_DEFUN(EGG_SUBST_DEST, [dnl
1216     if test "x$DEST" = "x"
1217     then
1218     DEST=\${prefix}
1219     fi
1220     AC_SUBST(DEST)dnl
1221 fabian 1.13 ])dnl
1222    
1223 guppy 1.31
1224     dnl EGG_SUBST_MOD_UPDIR()
1225     dnl
1226     dnl Since module's Makefiles aren't generated by configure, some
1227     dnl paths in src/mod/Makefile.in take care of them. For correct
1228     dnl path "calculation", we need to keep absolute paths in mind
1229     dnl (which don't need a "../" pre-pended).
1230     AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1231     case "$srcdir" in
1232     [[\\/]]* | ?:[[\\/]]* ) MOD_UPDIR="" ;;
1233     * ) MOD_UPDIR="../" ;;
1234     esac
1235     AC_SUBST(MOD_UPDIR)dnl
1236     ])dnl
1237    
1238 fabian 1.13
1239     dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1240     dnl
1241     dnl Replace FILE-NAME if the newly created contents differs from the existing
1242     dnl file contents. Otherwise leave the file allone. This avoids needless
1243     dnl recompiles.
1244     dnl
1245     define(EGG_REPLACE_IF_CHANGED, [dnl
1246     AC_OUTPUT_COMMANDS([
1247 fabian 1.15 egg_replace_file=$1
1248 fabian 1.13 echo "creating $1"
1249     $2
1250     if test -f ${egg_replace_file} && cmp -s conftest.out ${egg_replace_file}
1251     then
1252     echo "$1 is unchanged"
1253     else
1254     mv conftest.out ${egg_replace_file}
1255     fi
1256     rm -f conftest.out], [$3])dnl
1257     ])dnl
1258    
1259    
1260     dnl EGG_TCL_LUSH()
1261     dnl
1262     AC_DEFUN(EGG_TCL_LUSH, [dnl
1263     EGG_REPLACE_IF_CHANGED(lush.h, [
1264     cat > conftest.out <<EGGEOF
1265     /* Ignore me but do not erase me. I am a kludge. */
1266    
1267     #include "${egg_tclinc}/${egg_tclincfn}"
1268     EGGEOF], [egg_tclinc=${TCLINC}; egg_tclincfn=${TCLINCFN}])dnl
1269     ])dnl
1270    
1271    
1272     dnl EGG_CATCH_MAKEFILE_REBUILD()
1273     dnl
1274     AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1275     AC_OUTPUT_COMMANDS([
1276 fabian 1.15 if test -f .modules; then
1277 fabian 1.13 ${ac_given_srcdir}/misc/modconfig --top_srcdir=${ac_given_srcdir} Makefile
1278     fi])
1279 fabian 1.15 ])dnl
1280    
1281     dnl EGG_SAVE_PARAMETERS()
1282     dnl
1283     AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1284     dnl Normally, we shouldn't use this level as it's not intended for this
1285     dnl type of code, but there's no other way to run it before the main
1286     dnl parameter loop in configure.
1287     AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
1288     egg_ac_parameters="[$]*"
1289     AC_DIVERT_POP()dnl to NORMAL
1290     AC_SUBST(egg_ac_parameters)dnl
1291 fabian 1.1 ])dnl

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23