/[cvs]/eggdrop-alpha/aclocal.m4
ViewVC logotype

Annotation of /eggdrop-alpha/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Thu Jan 25 10:15:37 2001 UTC (19 years, 4 months ago) by tothwolf
Branch: MAIN
Changes since 1.2: +18 -1 lines
*** empty log message ***

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23