/[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.51 - (hide annotations) (download)
Mon Aug 13 20:47:51 2001 UTC (17 years, 11 months ago) by guppy
Branch: MAIN
Changes since 1.50: +1 -2 lines
Good bye language.c, lang.h, we knew you so well yet hated you

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23