/[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.43 - (hide annotations) (download)
Tue Jul 24 14:43:34 2001 UTC (20 years, 3 months ago) by guppy
Branch: MAIN
Changes since 1.42: +7 -1 lines
QNX? don't banks use that

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23