/[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.13 - (show annotations) (download)
Mon Mar 6 18:54:07 2000 UTC (19 years, 9 months ago) by fabian
Branch: MAIN
Changes since 1.12: +136 -31 lines
configure_fix2,3 patches

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23