/[cvs]/eggdrop1.4/aclocal.m4
ViewVC logotype

Contents of /eggdrop1.4/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Mon Aug 7 16:23:43 2000 UTC (18 years, 4 months ago) by guppy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +9 -8 lines
fabian's patches

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23