/[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.34 - (show annotations) (download)
Wed Jun 20 14:44:16 2001 UTC (18 years, 4 months ago) by poptix
Branch: MAIN
Changes since 1.33: +4 -2 lines
Cygwin32 Fixes

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23