/[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.20 - (hide annotations) (download)
Sun Jul 9 14:10:49 2000 UTC (19 years, 3 months ago) by fabian
Branch: MAIN
Changes since 1.19: +20 -4 lines
RebuM's modules_cygwin patch, together with my corrections

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23