/[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.42 - (show annotations) (download)
Tue Jul 3 16:47:14 2001 UTC (18 years, 4 months ago) by guppy
Branch: MAIN
CVS Tags: eggdrop1_6_5, eggdrop1_6_6
Changes since 1.41: +3 -3 lines
Tothwolf's patch to fix his aclocal.m4 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.41 2001/07/01 07:19:38 guppy 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 dnl
42 AC_DEFUN(EGG_CHECK_CC, [dnl
43 if test "${cross_compiling-x}" = "x"
44 then
45 cat << 'EOF' >&2
46 configure: error:
47
48 This system does not appear to have a working C compiler.
49 A working C compiler is required to compile eggdrop.
50
51 EOF
52 exit 1
53 fi
54 ])dnl
55
56
57 dnl EGG_CHECK_CCPIPE()
58 dnl
59 dnl Checks whether the compiler supports the `-pipe' flag, which
60 dnl speeds up the compilation.
61 AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
62 if test -z "$no_pipe"
63 then
64 if test -n "$GCC"
65 then
66 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
67 ac_old_CC="$CC"
68 CC="$CC -pipe"
69 AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")
70 CC="$ac_old_CC"
71 ])
72 if test "$egg_cv_var_ccpipe" = "yes"
73 then
74 CC="$CC -pipe"
75 fi
76 fi
77 fi
78 ])dnl
79
80
81 dnl EGG_PROG_STRIP()
82 dnl
83 AC_DEFUN(EGG_PROG_STRIP, [dnl
84 AC_CHECK_PROG(STRIP, strip, strip)
85 if test "${STRIP-x}" = "x"
86 then
87 STRIP=touch
88 fi
89 ])dnl
90
91
92 dnl EGG_PROG_AWK()
93 dnl
94 AC_DEFUN(EGG_PROG_AWK, [dnl
95 # awk is needed for Tcl library and header checks, and eggdrop version subst
96 AC_PROG_AWK
97 if test "${AWK-x}" = "x"
98 then
99 cat << 'EOF' >&2
100 configure: error:
101
102 This system seems to lack a working 'awk' command.
103 A working 'awk' command is required to compile eggdrop.
104
105 EOF
106 exit 1
107 fi
108 ])dnl
109
110
111 dnl EGG_PROG_BASENAME()
112 dnl
113 AC_DEFUN(EGG_PROG_BASENAME, [dnl
114 # basename is needed for Tcl library and header checks
115 AC_CHECK_PROG(BASENAME, basename, basename)
116 if test "${BASENAME-x}" = "x"
117 then
118 cat << 'EOF' >&2
119 configure: error:
120
121 This system seems to lack a working 'basename' command.
122 A working 'basename' command is required to compile eggdrop.
123
124 EOF
125 exit 1
126 fi
127 ])dnl
128
129
130 dnl EGG_CHECK_OS()
131 dnl
132 dnl FIXME/NOTICE:
133 dnl This function is obsolete. Any NEW code/checks should be written
134 dnl as individual tests that will be checked on ALL operating systems.
135 dnl
136 AC_DEFUN(EGG_CHECK_OS, [dnl
137 LINUX=no
138 IRIX=no
139 SUNOS=no
140 HPUX=no
141 MOD_CC="$CC"
142 MOD_LD="$CC"
143 MOD_STRIP="$STRIP"
144 SHLIB_CC="$CC"
145 SHLIB_LD="$CC"
146 SHLIB_STRIP="$STRIP"
147 NEED_DL=1
148 DEFAULT_MAKE=debug
149 MOD_EXT=so
150
151 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
152 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
153
154 case "$egg_cv_var_system_type" in
155 BSD/OS)
156 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
157 2)
158 NEED_DL=0
159 DEFAULT_MAKE=static
160 ;;
161 3)
162 MOD_CC=shlicc
163 MOD_LD=shlicc
164 MOD_STRIP="$STRIP -d"
165 SHLIB_LD="shlicc -r"
166 SHLIB_STRIP=touch
167 AC_DEFINE(MODULES_OK)dnl
168 ;;
169 *)
170 CFLAGS="$CFLAGS -Wall"
171 MOD_LD="$CC"
172 MOD_STRIP="$STRIP -d"
173 SHLIB_CC="$CC -export-dynamic -fPIC"
174 SHLIB_LD="$CC -shared -nostartfiles"
175 AC_DEFINE(MODULES_OK)dnl
176 ;;
177 esac
178 ;;
179 CYGWIN*)
180 case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
181 1.*)
182 NEED_DL=0
183 SHLIB_LD="$CC -shared"
184 CC="$CC -mwin32"
185 MOD_CC="$CC"
186 MOD_LD="$CC"
187 AC_MSG_CHECKING(for /usr/lib/binmode.o)
188 if test -r /usr/lib/binmode.o
189 then
190 AC_MSG_RESULT(yes)
191 LIBS="$LIBS /usr/lib/binmode.o"
192 else
193 AC_MSG_RESULT(no)
194 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
195 fi
196 MOD_EXT=dll
197 AC_DEFINE(MODULES_OK)dnl
198 ;;
199 *)
200 NEED_DL=0
201 DEFAULT_MAKE=static
202 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
203 ;;
204 esac
205 ;;
206 HP-UX)
207 HPUX=yes
208 MOD_LD="$CC -fPIC -shared"
209 SHLIB_CC="$CC -fPIC"
210 SHLIB_LD="ld -b"
211 NEED_DL=0
212 AC_DEFINE(MODULES_OK)dnl
213 AC_DEFINE(HPUX_HACKS)dnl
214 if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
215 then
216 AC_DEFINE(HPUX10_HACKS)dnl
217 fi
218 ;;
219 dell)
220 AC_MSG_RESULT(Dell SVR4)
221 SHLIB_STRIP=touch
222 NEED_DL=0
223 MOD_LD="$CC -lelf -lucb"
224 ;;
225 IRIX)
226 SHLIB_LD="ld -n32 -shared -rdata_shared"
227 IRIX=yes
228 SHLIB_STRIP=touch
229 NEED_DL=0
230 DEFAULT_MAKE=static
231 ;;
232 Ultrix)
233 NEED_DL=0
234 SHLIB_STRIP=touch
235 DEFAULT_MAKE=static
236 SHELL=/bin/sh5
237 ;;
238 SINIX*)
239 NEED_DL=0
240 SHLIB_STRIP=touch
241 DEFAULT_MAKE=static
242 SHLIB_CC="cc -G"
243 ;;
244 BeOS)
245 NEED_DL=0
246 SHLIB_STRIP=strip
247 DEFAULT_MAKE=static
248 ;;
249 Linux)
250 LINUX=yes
251 CFLAGS="$CFLAGS -Wall"
252 MOD_LD="$CC"
253 SHLIB_CC="$CC -fPIC"
254 SHLIB_LD="$CC -shared -nostartfiles"
255 AC_DEFINE(MODULES_OK)dnl
256 ;;
257 Lynx)
258 NEED_DL=0
259 DEFAULT_MAKE=static
260 SHLIB_STRIP=strip
261 ;;
262 OSF1)
263 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
264 V*)
265 # FIXME: we should check this in a seperate test
266 # Digital OSF uses an ancient version of gawk
267 if test "$AWK" = "gawk"
268 then
269 AWK=awk
270 fi
271 MOD_CC=cc
272 MOD_LD=cc
273 SHLIB_CC=cc
274 SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
275 SHLIB_STRIP=touch
276 AC_DEFINE(MODULES_OK)dnl
277 ;;
278 1.0|1.1|1.2)
279 SHLIB_LD="ld -R -export $@:"
280 AC_DEFINE(MODULES_OK)dnl
281 AC_DEFINE(OSF1_HACKS)dnl
282 ;;
283 1.*)
284 SHLIB_CC="$CC -fpic"
285 SHLIB_LD="ld -shared"
286 AC_DEFINE(MODULES_OK)dnl
287 AC_DEFINE(OSF1_HACKS)dnl
288 ;;
289 *)
290 NEED_DL=0
291 DEFAULT_MAKE=static
292 ;;
293 esac
294 AC_DEFINE(STOP_UAC)dnl
295 ;;
296 SunOS)
297 if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5"
298 then
299 # Solaris
300 if test -n "$GCC"
301 then
302 SHLIB_CC="$CC -fPIC"
303 SHLIB_LD="$CC"
304 else
305 SHLIB_CC="$CC -KPIC"
306 SHLIB_LD="$CC -G -z text"
307 fi
308 else
309 # SunOS 4
310 SUNOS=yes
311 SHLIB_LD=ld
312 SHLIB_CC="$CC -PIC"
313 AC_DEFINE(DLOPEN_1)dnl
314 fi
315 AC_DEFINE(MODULES_OK)dnl
316 ;;
317 *BSD)
318 # FreeBSD/OpenBSD/NetBSD
319 SHLIB_CC="$CC -fPIC"
320 SHLIB_LD="ld -Bshareable -x"
321 AC_DEFINE(MODULES_OK)dnl
322 ;;
323 *)
324 AC_MSG_CHECKING(if system is Mach based)
325 if test -r /mach
326 then
327 AC_MSG_RESULT(yes)
328 NEED_DL=0
329 DEFAULT_MAKE=static
330 AC_DEFINE(BORGCUBES)dnl
331 else
332 AC_MSG_RESULT(no)
333 AC_MSG_CHECKING(if system is QNX)
334 if test -r /cmds
335 then
336 AC_MSG_RESULT(yes)
337 SHLIB_STRIP=touch
338 NEED_DL=0
339 DEFAULT_MAKE=static
340 else
341 AC_MSG_RESULT(no)
342 AC_MSG_RESULT(Something unknown!)
343 AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
344 NEED_DL=0
345 DEFAULT_MAKE=static
346 fi
347 fi
348 ;;
349 esac
350 AC_SUBST(MOD_LD)dnl
351 AC_SUBST(MOD_CC)dnl
352 AC_SUBST(MOD_STRIP)dnl
353 AC_SUBST(SHLIB_LD)dnl
354 AC_SUBST(SHLIB_CC)dnl
355 AC_SUBST(SHLIB_STRIP)dnl
356 AC_SUBST(DEFAULT_MAKE)dnl
357 AC_SUBST(MOD_EXT)dnl
358 AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl
359 ])dnl
360
361
362 dnl EGG_CHECK_LIBS()
363 dnl
364 AC_DEFUN(EGG_CHECK_LIBS, [dnl
365 # FIXME: this needs to be fixed so that it works on IRIX
366 if test "$IRIX" = "yes"
367 then
368 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
369 else
370 AC_CHECK_LIB(socket, socket)
371 AC_CHECK_LIB(nsl, connect)
372 AC_CHECK_LIB(dns, gethostbyname)
373 AC_CHECK_LIB(dl, dlopen)
374 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
375 # This is needed for Tcl libraries compiled with thread support
376 AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
377 ac_cv_lib_pthread_pthread_mutex_init=yes
378 ac_cv_lib_pthread="-lpthread"], [dnl
379 AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
380 ac_cv_lib_pthread_pthread_mutex_init=yes
381 ac_cv_lib_pthread="-lpthread"], [dnl
382 AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
383 ac_cv_lib_pthread_pthread_mutex_init=yes
384 ac_cv_lib_pthread="-lpthreads"], [dnl
385 AC_CHECK_FUNC(pthread_mutex_init, [dnl
386 ac_cv_lib_pthread_pthread_mutex_init=yes
387 ac_cv_lib_pthread=""],
388 ac_cv_lib_pthread_pthread_mutex_init=no)])])])
389 if test "$SUNOS" = "yes"
390 then
391 # For suns without yp or something like that
392 AC_CHECK_LIB(dl, main)
393 else
394 if test "$HPUX" = "yes"
395 then
396 AC_CHECK_LIB(dld, shl_load)
397 fi
398 fi
399 fi
400 ])dnl
401
402
403 dnl EGG_CHECK_FUNC_VSPRINTF()
404 dnl
405 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
406 AC_CHECK_FUNCS(vsprintf)
407 if test "$ac_cv_func_vsprintf" = "no"
408 then
409 cat << 'EOF' >&2
410 configure: error:
411
412 Your system does not have the sprintf/vsprintf libraries.
413 These are required to compile almost anything. Sorry.
414
415 EOF
416 exit 1
417 fi
418 ])dnl
419
420
421 dnl EGG_HEADER_STDC()
422 dnl
423 AC_DEFUN(EGG_HEADER_STDC, [dnl
424 if test "$ac_cv_header_stdc" = "no"
425 then
426 cat << 'EOF' >&2
427 configure: error:
428
429 Your system must support ANSI C Header files.
430 These are required for the language support. Sorry.
431
432 EOF
433 exit 1
434 fi
435 ])dnl
436
437
438 dnl EGG_CHECK_LIBSAFE_SSCANF()
439 dnl
440 AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
441 AC_CACHE_CHECK(for broken libsafe sscanf, egg_cv_var_libsafe_sscanf, [dnl
442 AC_TRY_RUN([
443 #include <stdio.h>
444
445 int main()
446 {
447 char *src = "0x001,guppyism\n";
448 char dst[10];
449 int idx;
450 if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
451 exit(1);
452 return 0;
453 }
454 ], egg_cv_var_libsafe_sscanf="no", egg_cv_var_libsafe_sscanf="yes",
455 egg_cv_var_libsafe_sscanf="no")
456 ])
457 if test "$egg_cv_var_libsafe_sscanf" = "yes"
458 then
459 AC_DEFINE(LIBSAFE_HACKS)dnl
460 fi
461 ])dnl
462
463
464 dnl EGG_CYGWIN()
465 dnl
466 dnl Check for Cygwin support.
467 AC_DEFUN(EGG_CYGWIN, [dnl
468 AC_CYGWIN
469 if test "$ac_cv_cygwin" = "yes"
470 then
471 AC_DEFINE(CYGWIN_HACKS)dnl
472 fi
473 ])dnl
474
475
476 dnl EGG_EXEEXT()
477 dnl
478 dnl Test for executable suffix and define eggdrop's executable name
479 dnl accordingly.
480 AC_DEFUN(EGG_EXEEXT, [dnl
481 EGGEXEC=eggdrop
482 AC_EXEEXT
483 if test ! "${EXEEXT-x}" = "x"
484 then
485 EGGEXEC="eggdrop$EXEEXT"
486 fi
487 AC_SUBST(EGGEXEC)dnl
488 ])dnl
489
490
491 dnl EGG_TCL_ARG_WITH()
492 dnl
493 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
494 # oohh new configure --variables for those with multiple tcl libs
495 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname="$withval")
496 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname="$withval")
497
498 WARN=0
499 # Make sure either both or neither $tcllibname and $tclincname are set
500 if test ! "${tcllibname-x}" = "x"
501 then
502 if test "${tclincname-x}" = "x"
503 then
504 WARN=1
505 tcllibname=""
506 TCLLIB=""
507 TCLINC=""
508 fi
509 else
510 if test ! "${tclincname-x}" = "x"
511 then
512 WARN=1
513 tclincname=""
514 TCLLIB=""
515 TCLINC=""
516 fi
517 fi
518 if test "$WARN" = 1
519 then
520 cat << 'EOF' >&2
521 configure: warning:
522
523 You must specify both --with-tcllib and --with-tclinc for them to work.
524 configure will now attempt to autodetect both the Tcl library and header...
525
526 EOF
527 fi
528 ])dnl
529
530
531 dnl EGG_TCL_ENV()
532 dnl
533 AC_DEFUN(EGG_TCL_ENV, [dnl
534 WARN=0
535 # Make sure either both or neither $TCLLIB and $TCLINC are set
536 if test ! "${TCLLIB-x}" = "x"
537 then
538 if test "${TCLINC-x}" = "x"
539 then
540 WARN=1
541 WVAR1=TCLLIB
542 WVAR2=TCLINC
543 TCLLIB=""
544 fi
545 else
546 if test ! "${TCLINC-x}" = "x"
547 then
548 WARN=1
549 WVAR1=TCLINC
550 WVAR2=TCLLIB
551 TCLINC=""
552 fi
553 fi
554 if test "$WARN" = 1
555 then
556 cat << EOF >&2
557 configure: warning:
558
559 Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
560 Please set both TCLLIB and TCLINC correctly if you wish to use them.
561 configure will now attempt to autodetect both the Tcl library and header...
562
563 EOF
564 fi
565 ])dnl
566
567
568 dnl EGG_TCL_WITH_TCLLIB()
569 dnl
570 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
571 # Look for Tcl library: if $tcllibname is set, check there first
572 if test ! "${tcllibname-x}" = "x"
573 then
574 if test -f "$tcllibname" && test -r "$tcllibname"
575 then
576 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
577 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
578 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
579 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
580 else
581 cat << EOF >&2
582 configure: warning:
583
584 The file '$tcllibname' given to option --with-tcllib is not valid.
585 configure will now attempt to autodetect both the Tcl library and header...
586
587 EOF
588 tcllibname=""
589 tclincname=""
590 TCLLIB=""
591 TCLLIBFN=""
592 TCLINC=""
593 TCLINCFN=""
594 fi
595 fi
596 ])dnl
597
598
599 dnl EGG_TCL_WITH_TCLINC()
600 dnl
601 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
602 # Look for Tcl header: if $tclincname is set, check there first
603 if test ! "${tclincname-x}" = "x"
604 then
605 if test -f "$tclincname" && test -r "$tclincname"
606 then
607 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
608 TCLINCFN=`$BASENAME $tclincname`
609 else
610 cat << EOF >&2
611 configure: warning:
612
613 The file '$tclincname' given to option --with-tclinc is not valid.
614 configure will now attempt to autodetect both the Tcl library and header...
615
616 EOF
617 tcllibname=""
618 tclincname=""
619 TCLLIB=""
620 TCLLIBFN=""
621 TCLINC=""
622 TCLINCFN=""
623 fi
624 fi
625 ])dnl
626
627
628 dnl EGG_TCL_FIND_LIBRARY()
629 dnl
630 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
631 # Look for Tcl library: if $TCLLIB is set, check there first
632 if test "${TCLLIBFN-x}" = "x"
633 then
634 if test ! "${TCLLIB-x}" = "x"
635 then
636 if test -d "$TCLLIB"
637 then
638 for tcllibfns in $tcllibnames
639 do
640 for tcllibext in $tcllibextensions
641 do
642 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
643 then
644 TCLLIBFN="$tcllibfns$tcllibext"
645 TCLLIBEXT="$tcllibext"
646 TCLLIBFNS="$tcllibfns"
647 break 2
648 fi
649 done
650 done
651 fi
652 if test "${TCLLIBFN-x}" = "x"
653 then
654 cat << 'EOF' >&2
655 configure: warning:
656
657 Environment variable TCLLIB was set, but incorrect.
658 Please set both TCLLIB and TCLINC correctly if you wish to use them.
659 configure will now attempt to autodetect both the Tcl library and header...
660
661 EOF
662 TCLLIB=""
663 TCLLIBFN=""
664 TCLINC=""
665 TCLINCFN=""
666 fi
667 fi
668 fi
669 ])dnl
670
671
672 dnl EGG_TCL_FIND_HEADER()
673 dnl
674 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
675 # Look for Tcl header: if $TCLINC is set, check there first
676 if test "${TCLINCFN-x}" = "x"
677 then
678 if test ! "${TCLINC-x}" = "x"
679 then
680 if test -d "$TCLINC"
681 then
682 for tclheaderfn in $tclheadernames
683 do
684 if test -r "$TCLINC/$tclheaderfn"
685 then
686 TCLINCFN="$tclheaderfn"
687 break
688 fi
689 done
690 fi
691 if test "${TCLINCFN-x}" = "x"
692 then
693 cat << 'EOF' >&2
694 configure: warning:
695
696 Environment variable TCLINC was set, but incorrect.
697 Please set both TCLLIB and TCLINC correctly if you wish to use them.
698 configure will now attempt to autodetect both the Tcl library and header...
699
700 EOF
701 TCLLIB=""
702 TCLLIBFN=""
703 TCLINC=""
704 TCLINCFN=""
705 fi
706 fi
707 fi
708 ])dnl
709
710
711 dnl EGG_TCL_CHECK_LIBRARY()
712 dnl
713 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
714 AC_MSG_CHECKING(for Tcl library)
715
716 # Attempt autodetect for $TCLLIBFN if it's not set
717 if test ! "${TCLLIBFN-x}" = "x"
718 then
719 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
720 else
721 for tcllibfns in $tcllibnames
722 do
723 for tcllibext in $tcllibextensions
724 do
725 for tcllibpath in $tcllibpaths
726 do
727 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
728 then
729 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
730 TCLLIB="$tcllibpath"
731 TCLLIBFN="$tcllibfns$tcllibext"
732 TCLLIBEXT="$tcllibext"
733 TCLLIBFNS="$tcllibfns"
734 break 3
735 fi
736 done
737 done
738 done
739 fi
740
741 # Show if $TCLLIBFN wasn't found
742 if test "${TCLLIBFN-x}" = "x"
743 then
744 AC_MSG_RESULT(not found)
745 fi
746 AC_SUBST(TCLLIB)dnl
747 AC_SUBST(TCLLIBFN)dnl
748 ])dnl
749
750
751 dnl EGG_TCL_CHECK_HEADER()
752 dnl
753 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
754 AC_MSG_CHECKING(for Tcl header)
755
756 # Attempt autodetect for $TCLINCFN if it's not set
757 if test ! "${TCLINCFN-x}" = "x"
758 then
759 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
760 else
761 for tclheaderpath in $tclheaderpaths
762 do
763 for tclheaderfn in $tclheadernames
764 do
765 if test -r "$tclheaderpath/$tclheaderfn"
766 then
767 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
768 TCLINC="$tclheaderpath"
769 TCLINCFN="$tclheaderfn"
770 break 2
771 fi
772 done
773 done
774 # FreeBSD hack ...
775 if test "${TCLINCFN-x}" = "x"
776 then
777 for tcllibfns in $tcllibnames
778 do
779 for tclheaderpath in $tclheaderpaths
780 do
781 for tclheaderfn in $tclheadernames
782 do
783 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
784 then
785 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
786 TCLINC="$tclheaderpath/$tcllibfns"
787 TCLINCFN="$tclheaderfn"
788 break 3
789 fi
790 done
791 done
792 done
793 fi
794 fi
795
796 # Show if $TCLINCFN wasn't found
797 if test "${TCLINCFN-x}" = "x"
798 then
799 AC_MSG_RESULT(not found)
800 fi
801 AC_SUBST(TCLINC)dnl
802 AC_SUBST(TCLINCFN)dnl
803 ])dnl
804
805
806 dnl EGG_CACHE_UNSET(CACHE-ID)
807 dnl
808 dnl Unsets a certain cache item. Typically called before using
809 dnl the AC_CACHE_*() macros.
810 AC_DEFUN(EGG_CACHE_UNSET, [dnl
811 unset $1
812 ])
813
814
815 dnl EGG_TCL_DETECT_CHANGE()
816 dnl
817 dnl Detect whether the tcl system has changed since our last
818 dnl configure run. Set egg_tcl_changed accordingly.
819 dnl
820 dnl Tcl related feature and version checks should re-run their
821 dnl checks as soon as egg_tcl_changed is set to "yes".
822 AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
823 AC_MSG_CHECKING(whether the tcl system has changed)
824 egg_tcl_changed=yes
825 egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
826 if test ! "$egg_tcl_id" = ":::"
827 then
828 egg_tcl_cached=yes
829 AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
830 egg_cv_var_tcl_id="$egg_tcl_id"
831 egg_tcl_cached=no
832 ])
833 if test "$egg_tcl_cached" = "yes"
834 then
835 if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
836 then
837 egg_tcl_changed=no
838 else
839 egg_cv_var_tcl_id="$egg_tcl_id"
840 fi
841 fi
842 fi
843 if test "$egg_tcl_changed" = "yes"
844 then
845 AC_MSG_RESULT(yes)
846 else
847 AC_MSG_RESULT(no)
848 fi
849 ])
850
851
852 dnl EGG_TCL_CHECK_VERSION()
853 dnl
854 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
855 # Both TCLLIBFN & TCLINCFN must be set, or we bail
856 TCL_FOUND=0
857 if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
858 then
859 TCL_FOUND=1
860
861 # Check Tcl's version
862 if test "$egg_tcl_changed" = "yes"
863 then
864 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
865 fi
866 AC_MSG_CHECKING(for Tcl version)
867 AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
868 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
869 ])
870
871 if test ! "${egg_cv_var_tcl_version-x}" = "x"
872 then
873 AC_MSG_RESULT($egg_cv_var_tcl_version)
874 else
875 AC_MSG_RESULT(not found)
876 TCL_FOUND=0
877 fi
878
879 # Check Tcl's patch level (if avaliable)
880 if test "$egg_tcl_changed" = "yes"
881 then
882 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
883 fi
884 AC_MSG_CHECKING(for Tcl patch level)
885 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
886 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
887 ])
888
889 if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
890 then
891 AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
892 else
893 egg_cv_var_tcl_patch_level="unknown"
894 AC_MSG_RESULT(unknown)
895 fi
896 fi
897
898 # Check if we found Tcl's version
899 if test "$TCL_FOUND" = 0
900 then
901 cat << 'EOF' >&2
902 configure: error:
903
904 I can't find Tcl on this system.
905
906 Eggdrop requires Tcl to compile. If you already have Tcl installed
907 on this system, and I just wasn't looking in the right place for it,
908 set the environment variables TCLLIB and TCLINC so I will know where
909 to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
910 run 'configure' again.
911
912 Read the README file if you don't know what Tcl is or how to get it
913 and install it.
914
915 EOF
916 exit 1
917 fi
918 ])dnl
919
920
921 dnl EGG_TCL_CHECK_PRE70()
922 dnl
923 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
924 # Is this version of Tcl too old for us to use ?
925 TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
926 if test "$TCL_VER_PRE70" = "yes"
927 then
928 cat << EOF >&2
929 configure: error:
930
931 Your Tcl version is much too old for eggdrop to use.
932 I suggest you download and complie a more recent version.
933 The most reliable current version is $tclrecommendver and
934 can be downloaded from $tclrecommendsite
935
936 EOF
937 exit 1
938 fi
939 ])dnl
940
941
942 dnl EGG_TCL_CHECK_PRE75()
943 dnl
944 AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
945 # Are we using a pre 7.5 Tcl version ?
946 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"}'`
947 if test "$TCL_VER_PRE75" = "yes"
948 then
949 AC_DEFINE(HAVE_PRE7_5_TCL)dnl
950 fi
951 ])dnl
952
953
954 dnl EGG_TCL_TESTLIBS()
955 dnl
956 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
957 # Set variables for Tcl library tests
958 TCL_TEST_LIB="$TCLLIBFNS"
959 TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
960
961 if test ! "${ac_cv_lib_pthread-x}" = "x"
962 then
963 TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
964 fi
965 ])dnl
966
967
968 dnl EGG_TCL_CHECK_FREE()
969 dnl
970 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
971 if test "$egg_tcl_changed" = "yes"
972 then
973 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
974 fi
975
976 # Check for Tcl_Free()
977 AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS)
978
979 if test "$egg_cv_var_tcl_free" = "yes"
980 then
981 AC_DEFINE(HAVE_TCL_FREE)dnl
982 fi
983 ])dnl
984
985
986 dnl EGG_TCL_ENABLE_THREADS()
987 dnl
988 AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl
989 AC_ARG_ENABLE(tcl-threads,
990 [ --disable-tcl-threads Disable threaded tcl support if detected. (Ignore this
991 option unless you know what you are doing)],
992 enable_tcl_threads="$enableval",
993 enable_tcl_threads=yes)
994 ])dnl
995
996
997 dnl EGG_TCL_CHECK_THREADS()
998 dnl
999 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1000 if test "$egg_tcl_changed" = "yes"
1001 then
1002 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1003 fi
1004
1005 # Check for TclpFinalizeThreadData()
1006 AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS)
1007
1008 if test "$egg_cv_var_tcl_threaded" = "yes"
1009 then
1010 if test "$enable_tcl_threads" = "no"
1011 then
1012
1013 cat << 'EOF' >&2
1014 configure: warning:
1015
1016 You have disabled threads support on a system with a threaded Tcl library.
1017 Tcl features that rely on scheduled events may not function properly.
1018
1019 EOF
1020 else
1021 AC_DEFINE(HAVE_TCL_THREADS)dnl
1022 fi
1023
1024 # Add pthread library to $LIBS if we need it
1025 if test ! "${ac_cv_lib_pthread-x}" = "x"
1026 then
1027 LIBS="$ac_cv_lib_pthread $LIBS"
1028 fi
1029 fi
1030 ])dnl
1031
1032
1033 dnl EGG_TCL_LIB_REQS()
1034 dnl
1035 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1036 if test ! "$TCLLIBEXT" = ".a"
1037 then
1038 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1039 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1040 else
1041
1042 # Set default make as static for unshared Tcl library
1043 if test ! "$DEFAULT_MAKE" = "static"
1044 then
1045 cat << 'EOF' >&2
1046 configure: warning:
1047
1048 Your Tcl library is not a shared lib.
1049 configure will now set default make type to static...
1050
1051 EOF
1052 DEFAULT_MAKE=static
1053 AC_SUBST(DEFAULT_MAKE)dnl
1054 fi
1055
1056 # Are we using a pre 7.4 Tcl version ?
1057 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"}'`
1058 if test "$TCL_VER_PRE74" = "no"
1059 then
1060
1061 # Was the --with-tcllib option given ?
1062 if test ! "${tcllibname-x}" = "x"
1063 then
1064 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1065 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1066 else
1067 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1068 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1069 fi
1070 else
1071 cat << EOF >&2
1072 configure: warning:
1073
1074 Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1075 There are known problems, but we will attempt to work around them.
1076
1077 EOF
1078 TCL_REQS="libtcle.a"
1079 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1080 fi
1081 fi
1082 AC_SUBST(TCL_REQS)dnl
1083 AC_SUBST(TCL_LIBS)dnl
1084 ])dnl
1085
1086
1087 dnl EGG_FUNC_DLOPEN()
1088 dnl
1089 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1090 if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1091 then
1092 if test "$LINUX" = "yes"
1093 then
1094 cat << 'EOF' >&2
1095 configure: warning:
1096
1097 Since you are on a Linux system, this has a known problem...
1098 I know a kludge for it,
1099 EOF
1100
1101 if test -r "/lib/libdl.so.1"
1102 then
1103 cat << 'EOF' >&2
1104 and you seem to have it, so we'll do that...
1105
1106 EOF
1107 AC_DEFINE(HAVE_DLOPEN)dnl
1108 LIBS="/lib/libdl.so.1 $LIBS"
1109 else
1110 cat << 'EOF' >&2
1111 which you DON'T seem to have... doh!
1112 perhaps you may still have the stuff lying around somewhere
1113 if you work out where it is, add it to your XLIBS= lines
1114 and #define HAVE_DLOPEN in config.h
1115
1116 we'll proceed on anyway, but you probably won't be able
1117 to 'make eggdrop' but you might be able to make the
1118 static bot (I'll default your make to this version).
1119
1120 EOF
1121 DEFAULT_MAKE=static
1122 fi
1123 else
1124 cat << 'EOF' >&2
1125 configure: warning:
1126
1127 You don't seem to have libdl anywhere I can find it, this will
1128 prevent you from doing dynamic modules, I'll set your default
1129 make to static linking.
1130
1131 EOF
1132 DEFAULT_MAKE=static
1133 fi
1134 fi
1135 ])dnl
1136
1137
1138 dnl EGG_SUBST_EGGVERSION()
1139 dnl
1140 AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1141 EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1142 egg_version_num=`echo $EGGVERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
1143 AC_SUBST(EGGVERSION)dnl
1144 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1145 ])dnl
1146
1147
1148 dnl EGG_SUBST_DEST()
1149 dnl
1150 AC_DEFUN(EGG_SUBST_DEST, [dnl
1151 if test "${DEST-x}" = "x"
1152 then
1153 DEST=\${prefix}
1154 fi
1155 AC_SUBST(DEST)dnl
1156 ])dnl
1157
1158
1159 dnl EGG_SUBST_MOD_UPDIR()
1160 dnl
1161 dnl Since module's Makefiles aren't generated by configure, some
1162 dnl paths in src/mod/Makefile.in take care of them. For correct
1163 dnl path "calculation", we need to keep absolute paths in mind
1164 dnl (which don't need a "../" pre-pended).
1165 AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1166 case "$srcdir" in
1167 [[\\/]]* | ?:[[\\/]]*)
1168 MOD_UPDIR=""
1169 ;;
1170 *)
1171 MOD_UPDIR="../"
1172 ;;
1173 esac
1174 AC_SUBST(MOD_UPDIR)dnl
1175 ])dnl
1176
1177
1178 dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1179 dnl
1180 dnl Replace FILE-NAME if the newly created contents differs from the existing
1181 dnl file contents. Otherwise leave the file allone. This avoids needless
1182 dnl recompiles.
1183 dnl
1184 define(EGG_REPLACE_IF_CHANGED, [dnl
1185 AC_OUTPUT_COMMANDS([
1186 egg_replace_file="$1"
1187 echo "creating $1"
1188 $2
1189 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1190 then
1191 echo "$1 is unchanged"
1192 else
1193 mv conftest.out $egg_replace_file
1194 fi
1195 rm -f conftest.out], [$3])dnl
1196 ])dnl
1197
1198
1199 dnl EGG_TCL_LUSH()
1200 dnl
1201 AC_DEFUN(EGG_TCL_LUSH, [dnl
1202 EGG_REPLACE_IF_CHANGED(lush.h, [
1203 cat > conftest.out << EGGEOF
1204 /* Ignore me but do not erase me. I am a kludge. */
1205
1206 #include "$egg_tclinc/$egg_tclincfn"
1207 EGGEOF], [
1208 egg_tclinc="$TCLINC"
1209 egg_tclincfn="$TCLINCFN"])dnl
1210 ])dnl
1211
1212
1213 dnl EGG_CATCH_MAKEFILE_REBUILD()
1214 dnl
1215 AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1216 AC_OUTPUT_COMMANDS([
1217 if test -f .modules
1218 then
1219 $ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile
1220 fi])
1221 ])dnl
1222
1223
1224 dnl EGG_SAVE_PARAMETERS()
1225 dnl
1226 AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1227 dnl Normally, we shouldn't use this level as it's not intended for this
1228 dnl type of code, but there's no other way to run it before the main
1229 dnl parameter loop in configure.
1230 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
1231 egg_ac_parameters="[$]*"
1232 AC_DIVERT_POP()dnl to NORMAL
1233 AC_SUBST(egg_ac_parameters)dnl
1234 ])dnl

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23