/[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.49 - (hide annotations) (download)
Wed Aug 8 13:47:10 2001 UTC (20 years, 2 months ago) by drummer
Branch: MAIN
Changes since 1.48: +6 -2 lines
autoenabling IPv6 if supported

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23