/[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.21 - (hide annotations) (download)
Sun Jul 23 20:47:12 2000 UTC (21 years, 3 months ago) by fabian
Branch: MAIN
Changes since 1.20: +2 -1 lines
1.4 resync, autoconf_shell_fix patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23