/[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.2 - (show annotations) (download)
Sat Dec 4 14:05:06 1999 UTC (19 years, 6 months ago) by fabian
Branch: MAIN
Changes since 1.1: +2 -1 lines
Tothwolf's configure-strip-fix patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23