/[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.33 - (show annotations) (download)
Thu Apr 19 04:31:51 2001 UTC (18 years, 6 months ago) by guppy
Branch: MAIN
Changes since 1.32: +3 -26 lines
updated the OS check for IRIX, thank you Kevin

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23