/[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.16 - (hide annotations) (download)
Thu Mar 23 23:10:25 2000 UTC (21 years, 7 months ago) by fabian
Branch: MAIN
CVS Tags: eggdrop10403
Changes since 1.15: +2 -2 lines
resync with 1.4, Mar24

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23