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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23