/[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.27 - (hide annotations) (download)
Sun Oct 1 19:14:41 2000 UTC (21 years ago) by fabian
Branch: MAIN
Changes since 1.26: +27 -4 lines
fabian: applied TheUnknown's patch solaris-config. Adjusted to cache result.

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23