/[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.32 - (hide annotations) (download)
Fri Apr 6 22:29:46 2001 UTC (20 years, 6 months ago) by guppy
Branch: MAIN
Changes since 1.31: +8 -2 lines
applied nakee's solaris compile fix

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23