/[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.19 - (hide annotations) (download)
Fri Jun 2 16:56:51 2000 UTC (19 years, 1 month ago) by fabian
Branch: MAIN
Changes since 1.18: +2 -2 lines
resync with 1.4

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23