/[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.42 - (hide annotations) (download)
Tue Jul 3 16:47:14 2001 UTC (20 years, 3 months ago) by guppy
Branch: MAIN
CVS Tags: eggdrop1_6_5, eggdrop1_6_6
Changes since 1.41: +3 -3 lines
Tothwolf's patch to fix his aclocal.m4 patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23