/[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.50 - (hide annotations) (download)
Thu Aug 9 04:06:32 2001 UTC (20 years, 2 months ago) by guppy
Branch: MAIN
Changes since 1.49: +7 -1 lines
PATCH: cygwinsharedtcl1 -- added Kirben's patch to sync upto 1.6

1 fabian 1.4 dnl aclocal.m4
2     dnl macros autoconf uses when building configure from configure.in
3     dnl
4 guppy 1.50 dnl $Id: aclocal.m4,v 1.49 2001/08/08 13:47:10 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.50 if test "$ac_cv_cygwin" = "yes"
1044     then
1045     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1046     TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1047     else
1048 guppy 1.41 if test ! "$TCLLIBEXT" = ".a"
1049 fabian 1.1 then
1050     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1051 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1052 fabian 1.1 else
1053    
1054     # Set default make as static for unshared Tcl library
1055     if test ! "$DEFAULT_MAKE" = "static"
1056     then
1057     cat << 'EOF' >&2
1058     configure: warning:
1059    
1060     Your Tcl library is not a shared lib.
1061     configure will now set default make type to static...
1062    
1063     EOF
1064     DEFAULT_MAKE=static
1065     AC_SUBST(DEFAULT_MAKE)dnl
1066     fi
1067    
1068     # Are we using a pre 7.4 Tcl version ?
1069     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"}'`
1070 guppy 1.41 if test "$TCL_VER_PRE74" = "no"
1071 fabian 1.1 then
1072    
1073     # Was the --with-tcllib option given ?
1074 guppy 1.41 if test ! "${tcllibname-x}" = "x"
1075 fabian 1.1 then
1076     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1077 fabian 1.22 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1078 fabian 1.1 else
1079     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1080 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1081 fabian 1.1 fi
1082     else
1083     cat << EOF >&2
1084     configure: warning:
1085    
1086     Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1087     There are known problems, but we will attempt to work around them.
1088    
1089     EOF
1090     TCL_REQS="libtcle.a"
1091 fabian 1.25 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1092 fabian 1.1 fi
1093 guppy 1.50 fi
1094 fabian 1.1 fi
1095     AC_SUBST(TCL_REQS)dnl
1096     AC_SUBST(TCL_LIBS)dnl
1097     ])dnl
1098 fabian 1.13
1099    
1100     dnl EGG_FUNC_DLOPEN()
1101 fabian 1.4 dnl
1102 fabian 1.1 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1103 guppy 1.41 if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1104 fabian 1.1 then
1105     if test "$LINUX" = "yes"
1106     then
1107     cat << 'EOF' >&2
1108     configure: warning:
1109    
1110     Since you are on a Linux system, this has a known problem...
1111     I know a kludge for it,
1112     EOF
1113    
1114     if test -r "/lib/libdl.so.1"
1115     then
1116     cat << 'EOF' >&2
1117     and you seem to have it, so we'll do that...
1118    
1119     EOF
1120     AC_DEFINE(HAVE_DLOPEN)dnl
1121     LIBS="/lib/libdl.so.1 $LIBS"
1122     else
1123     cat << 'EOF' >&2
1124     which you DON'T seem to have... doh!
1125     perhaps you may still have the stuff lying around somewhere
1126     if you work out where it is, add it to your XLIBS= lines
1127     and #define HAVE_DLOPEN in config.h
1128    
1129     we'll proceed on anyway, but you probably won't be able
1130     to 'make eggdrop' but you might be able to make the
1131     static bot (I'll default your make to this version).
1132    
1133     EOF
1134     DEFAULT_MAKE=static
1135     fi
1136     else
1137     cat << 'EOF' >&2
1138     configure: warning:
1139    
1140     You don't seem to have libdl anywhere I can find it, this will
1141     prevent you from doing dynamic modules, I'll set your default
1142     make to static linking.
1143    
1144     EOF
1145     DEFAULT_MAKE=static
1146     fi
1147     fi
1148     ])dnl
1149 fabian 1.13
1150    
1151     dnl EGG_SUBST_EGGVERSION()
1152 fabian 1.4 dnl
1153 fabian 1.1 AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1154 guppy 1.41 EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1155     egg_version_num=`echo $EGGVERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
1156 fabian 1.1 AC_SUBST(EGGVERSION)dnl
1157 fabian 1.6 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1158 fabian 1.1 ])dnl
1159 fabian 1.13
1160    
1161     dnl EGG_SUBST_DEST()
1162 fabian 1.4 dnl
1163 fabian 1.1 AC_DEFUN(EGG_SUBST_DEST, [dnl
1164 guppy 1.41 if test "${DEST-x}" = "x"
1165 fabian 1.1 then
1166     DEST=\${prefix}
1167     fi
1168     AC_SUBST(DEST)dnl
1169 fabian 1.13 ])dnl
1170    
1171 guppy 1.31
1172     dnl EGG_SUBST_MOD_UPDIR()
1173     dnl
1174     dnl Since module's Makefiles aren't generated by configure, some
1175 guppy 1.41 dnl paths in src/mod/Makefile.in take care of them. For correct
1176     dnl path "calculation", we need to keep absolute paths in mind
1177 guppy 1.31 dnl (which don't need a "../" pre-pended).
1178     AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1179     case "$srcdir" in
1180 guppy 1.41 [[\\/]]* | ?:[[\\/]]*)
1181     MOD_UPDIR=""
1182     ;;
1183     *)
1184     MOD_UPDIR="../"
1185     ;;
1186 guppy 1.31 esac
1187     AC_SUBST(MOD_UPDIR)dnl
1188     ])dnl
1189 guppy 1.41
1190 fabian 1.13
1191     dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1192     dnl
1193     dnl Replace FILE-NAME if the newly created contents differs from the existing
1194     dnl file contents. Otherwise leave the file allone. This avoids needless
1195     dnl recompiles.
1196     dnl
1197     define(EGG_REPLACE_IF_CHANGED, [dnl
1198     AC_OUTPUT_COMMANDS([
1199 guppy 1.41 egg_replace_file="$1"
1200 fabian 1.13 echo "creating $1"
1201     $2
1202 guppy 1.41 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1203 fabian 1.13 then
1204     echo "$1 is unchanged"
1205     else
1206 guppy 1.41 mv conftest.out $egg_replace_file
1207 fabian 1.13 fi
1208     rm -f conftest.out], [$3])dnl
1209     ])dnl
1210    
1211    
1212     dnl EGG_TCL_LUSH()
1213     dnl
1214     AC_DEFUN(EGG_TCL_LUSH, [dnl
1215     EGG_REPLACE_IF_CHANGED(lush.h, [
1216 guppy 1.41 cat > conftest.out << EGGEOF
1217 fabian 1.13 /* Ignore me but do not erase me. I am a kludge. */
1218    
1219 guppy 1.41 #include "$egg_tclinc/$egg_tclincfn"
1220     EGGEOF], [
1221     egg_tclinc="$TCLINC"
1222     egg_tclincfn="$TCLINCFN"])dnl
1223 fabian 1.13 ])dnl
1224    
1225    
1226     dnl EGG_CATCH_MAKEFILE_REBUILD()
1227     dnl
1228     AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1229     AC_OUTPUT_COMMANDS([
1230 guppy 1.41 if test -f .modules
1231     then
1232     $ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile
1233 fabian 1.13 fi])
1234 fabian 1.15 ])dnl
1235 guppy 1.41
1236 fabian 1.15
1237     dnl EGG_SAVE_PARAMETERS()
1238     dnl
1239     AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1240     dnl Normally, we shouldn't use this level as it's not intended for this
1241     dnl type of code, but there's no other way to run it before the main
1242     dnl parameter loop in configure.
1243     AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
1244     egg_ac_parameters="[$]*"
1245     AC_DIVERT_POP()dnl to NORMAL
1246     AC_SUBST(egg_ac_parameters)dnl
1247 fabian 1.1 ])dnl
1248 guppy 1.44
1249     AC_DEFUN([AC_PROG_CC_WIN32], [
1250     AC_MSG_CHECKING([how to access the Win32 API])
1251     WIN32FLAGS=
1252     AC_TRY_COMPILE(,[
1253     #ifndef WIN32
1254     # ifndef _WIN32
1255     # error WIN32 or _WIN32 not defined
1256     # endif
1257     #endif], [
1258     dnl found windows.h with the current config.
1259     AC_MSG_RESULT([present by default])
1260     ], [
1261     dnl try -mwin32
1262     ac_compile_save="$ac_compile"
1263     dnl we change CC so config.log looks correct
1264     save_CC="$CC"
1265     ac_compile="$ac_compile -mwin32"
1266     CC="$CC -mwin32"
1267     AC_TRY_COMPILE(,[
1268     #ifndef WIN32
1269     # ifndef _WIN32
1270     # error WIN32 or _WIN32 not defined
1271     # endif
1272     #endif], [
1273     dnl found windows.h using -mwin32
1274     AC_MSG_RESULT([found via -mwin32])
1275     ac_compile="$ac_compile_save"
1276     CC="$save_CC"
1277     WIN32FLAGS="-mwin32"
1278     ], [
1279     ac_compile="$ac_compile_save"
1280     CC="$save_CC"
1281     AC_MSG_RESULT([not found])
1282     ])
1283     ])
1284    
1285     ])
1286     dnl
1287 drummer 1.45
1288    
1289     dnl EGG_ENABLE_IPV6()
1290     dnl
1291     AC_DEFUN(EGG_ENABLE_IPV6, [dnl
1292 drummer 1.47 AC_MSG_CHECKING(whether you enabled IPv6 support)
1293 drummer 1.45 AC_ARG_ENABLE(ipv6,
1294     [ --enable-ipv6 Enable IPV6 support.
1295     --disable-ipv6 Disable IPV6 support. ],
1296 drummer 1.47 [ ac_cv_ipv6=$enableval
1297     AC_MSG_RESULT($ac_cv_ipv6)
1298     ], [
1299 drummer 1.49 if test "x$egg_cv_ipv6_supported" = "xyes"; then
1300     ac_cv_ipv6='yes'
1301     else
1302     ac_cv_ipv6='no'
1303     fi
1304 drummer 1.47 AC_MSG_RESULT((default) $ac_cv_ipv6)
1305     ])
1306 drummer 1.45 if test "$ac_cv_ipv6" = "yes" ; then
1307     AC_DEFINE(IPV6)
1308     fi
1309     ])dnl
1310    
1311    
1312 drummer 1.46 dnl EGG_TYPE_SOCKLEN_T
1313 drummer 1.45 dnl
1314     AC_DEFUN(EGG_TYPE_SOCKLEN_T, [dnl
1315     AC_CACHE_CHECK(for socklen_t, egg_cv_var_socklen_t, [
1316     AC_TRY_COMPILE([#include <sys/param.h>
1317     #include <sys/socket.h>
1318     #include <sys/types.h>
1319     ], [
1320     socklen_t x;
1321     x = 0;
1322     ], egg_cv_var_socklen_t="yes", egg_cv_var_socklen_t="no")
1323     ])
1324     if test "$egg_cv_var_socklen_t" = "no"
1325     then
1326     AC_DEFINE(socklen_t, unsigned)dnl
1327     fi
1328     ])dnl
1329    
1330 drummer 1.46
1331     dnl EGG_INADDR_LOOPBACK
1332     dnl
1333     AC_DEFUN(EGG_INADDR_LOOPBACK, [dnl
1334     AC_MSG_CHECKING(for INADDR_LOOPBACK)
1335     AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
1336     AC_TRY_COMPILE([
1337     #include <sys/socket.h>
1338     #include <netinet/in.h>
1339     #include <arpa/inet.h>
1340     ],[
1341     INADDR_LOOPBACK;
1342     ],
1343     adns_cv_decl_inaddrloopback=yes,
1344     adns_cv_decl_inaddrloopback=no)])
1345     if test "$adns_cv_decl_inaddrloopback" = yes; then
1346     AC_MSG_RESULT(found)
1347     else
1348     AC_MSG_RESULT([not in standard headers, urgh...])
1349     AC_CHECK_HEADER(rpc/types.h,[
1350     AC_DEFINE(HAVEUSE_RPCTYPES_H)
1351     ],[
1352     AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
1353     ])
1354     fi
1355     ])dnl
1356 drummer 1.47
1357     dnl EGG_IPV6_SUPPORTED
1358     dnl
1359     dnl AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE
1360     dnl [, ACTION-IF-CROSS-COMPILING]]])
1361     AC_DEFUN(EGG_IPV6_SUPPORTED, [dnl
1362     AC_MSG_CHECKING(for kernel IPv6 support)
1363     AC_CACHE_VAL(egg_cv_ipv6_supported,[
1364     AC_TRY_RUN_NATIVE([
1365 drummer 1.48 #include <fcntl.h>
1366 drummer 1.47 #include <sys/socket.h>
1367     #include <sys/types.h>
1368     #include <unistd.h>
1369 drummer 1.48 #include <errno.h>
1370     #include <stdio.h>
1371 drummer 1.47
1372     int main()
1373     {
1374     int s = socket(AF_INET6, SOCK_STREAM, 0);
1375     if (s != -1)
1376     close(s);
1377     return s == -1;
1378     }
1379     ], egg_cv_ipv6_supported=yes, egg_cv_ipv6_supported=no)])
1380     if test "$egg_cv_ipv6_supported" = yes; then
1381     AC_MSG_RESULT(yes)
1382     else
1383     AC_MSG_RESULT(no)
1384     fi
1385     ])dnl
1386    

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23