/[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.5 - (hide annotations) (download)
Sun Jan 9 14:59:28 2000 UTC (19 years, 6 months ago) by fabian
Branch: MAIN
Changes since 1.4: +2 -2 lines
resync with 1.4, a few 1.5 specific additions

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23