/[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.17 - (hide annotations) (download)
Sun May 7 00:08:03 2000 UTC (21 years, 5 months ago) by fabian
Branch: MAIN
Changes since 1.16: +8 -1 lines
SuperS' dell patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23