/[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.1 - (show annotations) (download)
Wed Dec 1 14:49:33 1999 UTC (19 years, 10 months ago) by fabian
Branch: MAIN
missed aclocal in toth's new-configure patch... as always... :/

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23