/[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.40 - (show annotations) (download)
Thu Jun 28 19:06:44 2001 UTC (18 years, 3 months ago) by guppy
Branch: MAIN
Changes since 1.39: +17 -4 lines
Kirben's binary patch for Cygwin

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23