/[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.10 - (show annotations) (download)
Tue Feb 29 19:57:27 2000 UTC (19 years, 7 months ago) by fabian
Branch: MAIN
Changes since 1.9: +7 -76 lines
configure_makefile_fix2 patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23