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

Contents of /eggdrop1.9/aclocal.m4

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


Revision 1.11 - (show annotations) (download)
Tue Feb 29 20:29:29 2000 UTC (19 years, 3 months ago) by fabian
Branch: MAIN
Changes since 1.10: +13 -1 lines
resync with 1.4

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23