/[cvs]/eggdrop1.9/acinclude.m4
ViewVC logotype

Contents of /eggdrop1.9/acinclude.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download)
Sat Oct 20 01:19:41 2001 UTC (17 years, 6 months ago) by tothwolf
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
* added acconfig for an aux dir
* moved m4 files to acconfig
* modified EGG_LIBTOOL autoconf macro to pass --with-auxdir to libltdl
* added notice to bootstrap about libtool needing a patch

1 dnl acinclude.m4
2 dnl macros autoconf uses when building configure from configure.in
3 dnl
4 dnl $Id: acinclude.m4,v 1.9 2001/10/19 14:10:55 tothwolf 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 ])
17
18
19 dnl EGG_MSG_CONFIGURE_END()
20 dnl
21 AC_DEFUN(EGG_MSG_CONFIGURE_END, [dnl
22 AC_MSG_RESULT()
23 cat << EOF
24 ------------------------------------------------------------------------
25 Configuration:
26
27 Source code location: ${srcdir}
28 Compiler: ${CC}
29 Compiler flags: ${CFLAGS}
30 Host System Type: ${host}
31 Install path: ${prefix}
32
33 See config.h for further configuration information.
34 ------------------------------------------------------------------------
35 EOF
36 AC_MSG_RESULT()
37 AC_MSG_RESULT(Configure is done.)
38 AC_MSG_RESULT()
39 AC_MSG_RESULT([Type 'make' to create the bot.])
40 AC_MSG_RESULT()
41 ])
42
43
44 dnl EGG_CHECK_CC()
45 dnl
46 dnl FIXME: make a better test
47 dnl
48 AC_DEFUN(EGG_CHECK_CC, [dnl
49 if test "${cross_compiling-x}" = "x"
50 then
51 cat << 'EOF' >&2
52 configure: error:
53
54 This system does not appear to have a working C compiler.
55 A working C compiler is required to compile eggdrop.
56
57 EOF
58 exit 1
59 fi
60 ])
61
62
63 dnl EGG_CHECK_CCPIPE()
64 dnl
65 dnl Checks whether the compiler supports the `-pipe' flag, which
66 dnl speeds up the compilation.
67 AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
68 if test -z "$no_pipe"
69 then
70 if test -n "$GCC"
71 then
72 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
73 ac_old_CC="$CC"
74 CC="$CC -pipe"
75 AC_TRY_COMPILE(,, egg_cv_var_ccpipe=yes, egg_cv_var_ccpipe=no)
76 CC="$ac_old_CC"
77 ])
78 if test "$egg_cv_var_ccpipe" = "yes"
79 then
80 CC="$CC -pipe"
81 fi
82 fi
83 fi
84 ])
85
86
87 dnl EGG_PROG_STRIP()
88 dnl
89 AC_DEFUN(EGG_PROG_STRIP, [dnl
90 AC_CHECK_PROG(STRIP, strip, strip)
91 if test "${STRIP-x}" = "x"
92 then
93 STRIP=touch
94 fi
95 ])
96
97
98 dnl EGG_PROG_AWK()
99 dnl
100 AC_DEFUN(EGG_PROG_AWK, [dnl
101 # awk is needed for Tcl library and header checks, and eggdrop version subst
102 AC_PROG_AWK
103 if test "${AWK-x}" = "x"
104 then
105 cat << 'EOF' >&2
106 configure: error:
107
108 This system seems to lack a working 'awk' command.
109 A working 'awk' command is required to compile eggdrop.
110
111 EOF
112 exit 1
113 fi
114 ])
115
116
117 dnl EGG_PROG_BASENAME()
118 dnl
119 AC_DEFUN(EGG_PROG_BASENAME, [dnl
120 # basename is needed for Tcl library and header checks
121 AC_CHECK_PROG(BASENAME, basename, basename)
122 if test "${BASENAME-x}" = "x"
123 then
124 cat << 'EOF' >&2
125 configure: error:
126
127 This system seems to lack a working 'basename' command.
128 A working 'basename' command is required to compile eggdrop.
129
130 EOF
131 exit 1
132 fi
133 ])
134
135
136 dnl EGG_CHECK_OS()
137 dnl
138 dnl FIXME/NOTICE:
139 dnl This function is obsolete. Any NEW code/checks should be written
140 dnl as individual tests that will be checked on ALL operating systems.
141 dnl
142 AC_DEFUN(EGG_CHECK_OS, [dnl
143 AC_REQUIRE([AC_CANONICAL_HOST])
144
145 IRIX=no
146 DEFAULT_MAKE=static
147
148 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$EGG_UNAME -s`)
149 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$EGG_UNAME -r`)
150
151 case $host_os in
152 cygwin)
153 case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
154 1.*)
155 AC_PROG_CC_WIN32
156 CC="$CC $WIN32FLAGS"
157 AC_MSG_CHECKING(for /usr/lib/binmode.o)
158 if test -r /usr/lib/binmode.o
159 then
160 AC_MSG_RESULT(yes)
161 LIBS="$LIBS /usr/lib/binmode.o"
162 else
163 AC_MSG_RESULT(no)
164 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
165 fi
166 ;;
167 *)
168 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
169 ;;
170 esac
171 ;;
172 hpux*)
173 AC_DEFINE(HPUX_HACKS, 1,
174 [Define if running on hpux that supports dynamic linking])
175 case $host_os in
176 hpux10)
177 AC_DEFINE(HPUX10_HACKS, 1,
178 [Define if running on hpux 10.x])
179 ;;
180 esac
181 ;;
182 irix*)
183 IRIX=yes
184 ;;
185 osf*)
186 AC_DEFINE(STOP_UAC, 1,
187 [Define if running on OSF/1 platform])
188 ;;
189 next*)
190 AC_DEFINE(BORGCUBES, 1,
191 [Define if running on NeXT Step])
192 ;;
193 esac
194
195 ])
196
197
198 dnl EGG_CHECK_LIBS()
199 dnl
200 AC_DEFUN(EGG_CHECK_LIBS, [dnl
201 # FIXME: this needs to be fixed so that it works on IRIX
202 if test "$IRIX" = "yes"
203 then
204 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
205 else
206 AC_CHECK_LIB(socket, socket)
207 AC_CHECK_LIB(nsl, connect)
208 AC_CHECK_LIB(dns, gethostbyname)
209 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
210 # This is needed for Tcl libraries compiled with thread support
211 AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
212 ac_cv_lib_pthread_pthread_mutex_init=yes
213 ac_cv_lib_pthread="-lpthread"], [dnl
214 AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
215 ac_cv_lib_pthread_pthread_mutex_init=yes
216 ac_cv_lib_pthread="-lpthread"], [dnl
217 AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
218 ac_cv_lib_pthread_pthread_mutex_init=yes
219 ac_cv_lib_pthread="-lpthreads"], [dnl
220 AC_CHECK_FUNC(pthread_mutex_init, [dnl
221 ac_cv_lib_pthread_pthread_mutex_init=yes
222 ac_cv_lib_pthread=""],
223 ac_cv_lib_pthread_pthread_mutex_init=no)])])])
224 fi
225 ])
226
227
228 dnl EGG_C_LONG_LONG
229 dnl
230 AC_DEFUN(EGG_C_LONG_LONG, [dnl
231 # Code borrowed from Samba
232 AC_CACHE_CHECK([for long long], egg_cv_have_long_long, [
233 AC_TRY_RUN([
234 #include <stdio.h>
235 int main() {
236 long long x = 1000000;
237 x *= x;
238 exit(((x / 1000000) == 1000000) ? 0: 1);
239 }
240 ],
241 egg_cv_have_long_long="yes",
242 egg_cv_have_long_long="no",
243 egg_cv_have_long_long="cross")])
244 if test "$egg_cv_have_long_long" = "yes"
245 then
246 AC_DEFINE(HAVE_LONG_LONG, 1,
247 [Define if system supports long long])
248 fi
249 ])
250
251
252 dnl EGG_FUNC_C99_VSNPRINTF
253 dnl
254 AC_DEFUN(EGG_FUNC_C99_VSNPRINTF, [dnl
255 # Code borrowed from Samba
256 AC_CACHE_CHECK([for C99 vsnprintf], egg_cv_have_c99_vsnprintf, [
257 AC_TRY_RUN([
258 #include <sys/types.h>
259 #include <stdarg.h>
260 void foo(const char *format, ...) {
261 va_list ap;
262 int len;
263 char buf[5];
264
265 va_start(ap, format);
266 len = vsnprintf(0, 0, format, ap);
267 va_end(ap);
268 if (len != 5) exit(1);
269
270 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
271
272 exit(0);
273 }
274 int main(){
275 foo("hello");
276 }
277 ],
278 egg_cv_have_c99_vsnprintf="yes",
279 egg_cv_have_c99_vsnprintf="no",
280 egg_cv_have_c99_vsnprintf="cross")])
281 if test "$egg_cv_have_c99_vsnprintf" = "yes"
282 then
283 AC_DEFINE(HAVE_C99_VSNPRINTF, 1,
284 [Define if vsnprintf is C99 compliant])
285 else
286 egg_replace_snprintf="yes"
287 fi
288 ])
289
290
291 dnl EGG_REPLACE_SNPRINTF
292 dnl
293 AC_DEFUN(EGG_REPLACE_SNPRINTF, [dnl
294 if test "${egg_replace_snprintf-x}" = "yes"
295 then
296 AC_LIBOBJ(snprintf)
297 SNPRINTF_LIBS="-lm"
298 fi
299 AC_SUBST(SNPRINTF_LIBS)
300 ])
301
302
303 dnl EGG_TYPE_32BIT()
304 dnl
305 AC_DEFUN(EGG_TYPE_32BIT, [dnl
306 AC_CHECK_SIZEOF(unsigned int, 4)
307 if test "$ac_cv_sizeof_unsigned_int" = 4
308 then
309 AC_DEFINE(UNSIGNED_INT32, 1,
310 [Define this if an unsigned int is 32 bits])
311 else
312 AC_CHECK_SIZEOF(unsigned long, 4)
313 if test "$ac_cv_sizeof_unsigned_long" = 4
314 then
315 AC_DEFINE(UNSIGNED_LONG32, 1,
316 [Define this if an unsigned long is 32 bits])
317 fi
318 fi
319 ])
320
321
322 dnl EGG_CYGWIN()
323 dnl
324 dnl Check for Cygwin support.
325 AC_DEFUN(EGG_CYGWIN, [dnl
326 AC_CYGWIN
327 if test "$ac_cv_cygwin" = "yes"
328 then
329 AC_DEFINE(CYGWIN_HACKS, 1,
330 [Define if running under cygwin])
331 fi
332 ])
333
334
335 dnl EGG_TCL_WITH_OPTIONS()
336 dnl
337 AC_DEFUN(EGG_TCL_WITH_OPTIONS, [dnl
338 # oohh new configure --variables for those with multiple tcl libs
339 AC_ARG_WITH(tcllib,
340 AC_HELP_STRING([--with-tcllib=PATH],
341 [full path to tcl library]),
342 tcllibname="$withval")
343 AC_ARG_WITH(tclinc,
344 AC_HELP_STRING([--with-tclinc=PATH],
345 [full path to tcl header]),
346 tclincname="$withval")
347
348 WARN=0
349 # Make sure either both or neither $tcllibname and $tclincname are set
350 if test ! "${tcllibname-x}" = "x"
351 then
352 if test "${tclincname-x}" = "x"
353 then
354 WARN=1
355 tcllibname=""
356 TCLLIB=""
357 TCLINC=""
358 fi
359 else
360 if test ! "${tclincname-x}" = "x"
361 then
362 WARN=1
363 tclincname=""
364 TCLLIB=""
365 TCLINC=""
366 fi
367 fi
368 if test "$WARN" = 1
369 then
370 cat << 'EOF' >&2
371 configure: warning:
372
373 You must specify both --with-tcllib and --with-tclinc for them to work.
374 configure will now attempt to autodetect both the Tcl library and header...
375
376 EOF
377 fi
378 ])
379
380
381 dnl EGG_TCL_ENV()
382 dnl
383 AC_DEFUN(EGG_TCL_ENV, [dnl
384 WARN=0
385 # Make sure either both or neither $TCLLIB and $TCLINC are set
386 if test ! "${TCLLIB-x}" = "x"
387 then
388 if test "${TCLINC-x}" = "x"
389 then
390 WARN=1
391 WVAR1=TCLLIB
392 WVAR2=TCLINC
393 TCLLIB=""
394 fi
395 else
396 if test ! "${TCLINC-x}" = "x"
397 then
398 WARN=1
399 WVAR1=TCLINC
400 WVAR2=TCLLIB
401 TCLINC=""
402 fi
403 fi
404 if test "$WARN" = 1
405 then
406 cat << EOF >&2
407 configure: warning:
408
409 Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
410 Please set both TCLLIB and TCLINC correctly if you wish to use them.
411 configure will now attempt to autodetect both the Tcl library and header...
412
413 EOF
414 fi
415 ])
416
417
418 dnl EGG_TCL_WITH_TCLLIB()
419 dnl
420 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
421 # Look for Tcl library: if $tcllibname is set, check there first
422 if test ! "${tcllibname-x}" = "x"
423 then
424 if test -f "$tcllibname" && test -r "$tcllibname"
425 then
426 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
427 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
428 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
429 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
430 else
431 cat << EOF >&2
432 configure: warning:
433
434 The file '$tcllibname' given to option --with-tcllib is not valid.
435 configure will now attempt to autodetect both the Tcl library and header...
436
437 EOF
438 tcllibname=""
439 tclincname=""
440 TCLLIB=""
441 TCLLIBFN=""
442 TCLINC=""
443 TCLINCFN=""
444 fi
445 fi
446 ])
447
448
449 dnl EGG_TCL_WITH_TCLINC()
450 dnl
451 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
452 # Look for Tcl header: if $tclincname is set, check there first
453 if test ! "${tclincname-x}" = "x"
454 then
455 if test -f "$tclincname" && test -r "$tclincname"
456 then
457 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
458 TCLINCFN=`$BASENAME $tclincname`
459 else
460 cat << EOF >&2
461 configure: warning:
462
463 The file '$tclincname' given to option --with-tclinc is not valid.
464 configure will now attempt to autodetect both the Tcl library and header...
465
466 EOF
467 tcllibname=""
468 tclincname=""
469 TCLLIB=""
470 TCLLIBFN=""
471 TCLINC=""
472 TCLINCFN=""
473 fi
474 fi
475 ])
476
477
478 dnl EGG_TCL_FIND_LIBRARY()
479 dnl
480 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
481 # Look for Tcl library: if $TCLLIB is set, check there first
482 if test "${TCLLIBFN-x}" = "x"
483 then
484 if test ! "${TCLLIB-x}" = "x"
485 then
486 if test -d "$TCLLIB"
487 then
488 for tcllibfns in $tcllibnames
489 do
490 for tcllibext in $tcllibextensions
491 do
492 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
493 then
494 TCLLIBFN="$tcllibfns$tcllibext"
495 TCLLIBEXT="$tcllibext"
496 TCLLIBFNS="$tcllibfns"
497 break 2
498 fi
499 done
500 done
501 fi
502 if test "${TCLLIBFN-x}" = "x"
503 then
504 cat << 'EOF' >&2
505 configure: warning:
506
507 Environment variable TCLLIB was set, but incorrect.
508 Please set both TCLLIB and TCLINC correctly if you wish to use them.
509 configure will now attempt to autodetect both the Tcl library and header...
510
511 EOF
512 TCLLIB=""
513 TCLLIBFN=""
514 TCLINC=""
515 TCLINCFN=""
516 fi
517 fi
518 fi
519 ])
520
521
522 dnl EGG_TCL_FIND_HEADER()
523 dnl
524 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
525 # Look for Tcl header: if $TCLINC is set, check there first
526 if test "${TCLINCFN-x}" = "x"
527 then
528 if test ! "${TCLINC-x}" = "x"
529 then
530 if test -d "$TCLINC"
531 then
532 for tclheaderfn in $tclheadernames
533 do
534 if test -r "$TCLINC/$tclheaderfn"
535 then
536 TCLINCFN="$tclheaderfn"
537 break
538 fi
539 done
540 fi
541 if test "${TCLINCFN-x}" = "x"
542 then
543 cat << 'EOF' >&2
544 configure: warning:
545
546 Environment variable TCLINC was set, but incorrect.
547 Please set both TCLLIB and TCLINC correctly if you wish to use them.
548 configure will now attempt to autodetect both the Tcl library and header...
549
550 EOF
551 TCLLIB=""
552 TCLLIBFN=""
553 TCLINC=""
554 TCLINCFN=""
555 fi
556 fi
557 fi
558 ])
559
560
561 dnl EGG_TCL_CHECK_LIBRARY()
562 dnl
563 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
564 AC_MSG_CHECKING(for Tcl library)
565
566 # Attempt autodetect for $TCLLIBFN if it's not set
567 if test ! "${TCLLIBFN-x}" = "x"
568 then
569 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
570 else
571 for tcllibfns in $tcllibnames
572 do
573 for tcllibext in $tcllibextensions
574 do
575 for tcllibpath in $tcllibpaths
576 do
577 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
578 then
579 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
580 TCLLIB="$tcllibpath"
581 TCLLIBFN="$tcllibfns$tcllibext"
582 TCLLIBEXT="$tcllibext"
583 TCLLIBFNS="$tcllibfns"
584 break 3
585 fi
586 done
587 done
588 done
589 fi
590
591 # Show if $TCLLIBFN wasn't found
592 if test "${TCLLIBFN-x}" = "x"
593 then
594 AC_MSG_RESULT(not found)
595 fi
596 AC_SUBST(TCLLIB)
597 AC_SUBST(TCLLIBFN)
598 ])
599
600
601 dnl EGG_TCL_CHECK_HEADER()
602 dnl
603 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
604 AC_MSG_CHECKING(for Tcl header)
605
606 # Attempt autodetect for $TCLINCFN if it's not set
607 if test ! "${TCLINCFN-x}" = "x"
608 then
609 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
610 else
611 for tclheaderpath in $tclheaderpaths
612 do
613 for tclheaderfn in $tclheadernames
614 do
615 if test -r "$tclheaderpath/$tclheaderfn"
616 then
617 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
618 TCLINC="$tclheaderpath"
619 TCLINCFN="$tclheaderfn"
620 break 2
621 fi
622 done
623 done
624 # FreeBSD hack ...
625 if test "${TCLINCFN-x}" = "x"
626 then
627 for tcllibfns in $tcllibnames
628 do
629 for tclheaderpath in $tclheaderpaths
630 do
631 for tclheaderfn in $tclheadernames
632 do
633 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
634 then
635 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
636 TCLINC="$tclheaderpath/$tcllibfns"
637 TCLINCFN="$tclheaderfn"
638 break 3
639 fi
640 done
641 done
642 done
643 fi
644 fi
645
646 # Show if $TCLINCFN wasn't found
647 if test "${TCLINCFN-x}" = "x"
648 then
649 AC_MSG_RESULT(not found)
650 fi
651 AC_SUBST(TCLINC)
652 AC_SUBST(TCLINCFN)
653 ])
654
655
656 dnl EGG_CACHE_UNSET(CACHE-ID)
657 dnl
658 dnl Unsets a certain cache item. Typically called before using
659 dnl the AC_CACHE_*() macros.
660 AC_DEFUN(EGG_CACHE_UNSET, [dnl
661 unset $1
662 ])
663
664
665 dnl EGG_TCL_DETECT_CHANGE()
666 dnl
667 dnl Detect whether the tcl system has changed since our last
668 dnl configure run. Set egg_tcl_changed accordingly.
669 dnl
670 dnl Tcl related feature and version checks should re-run their
671 dnl checks as soon as egg_tcl_changed is set to "yes".
672 AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
673 AC_MSG_CHECKING(whether the tcl system has changed)
674 egg_tcl_changed=yes
675 egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
676 if test ! "$egg_tcl_id" = ":::"
677 then
678 egg_tcl_cached=yes
679 AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
680 egg_cv_var_tcl_id="$egg_tcl_id"
681 egg_tcl_cached=no
682 ])
683 if test "$egg_tcl_cached" = "yes"
684 then
685 if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
686 then
687 egg_tcl_changed=no
688 else
689 egg_cv_var_tcl_id="$egg_tcl_id"
690 fi
691 fi
692 fi
693 if test "$egg_tcl_changed" = "yes"
694 then
695 AC_MSG_RESULT(yes)
696 else
697 AC_MSG_RESULT(no)
698 fi
699 ])
700
701
702 dnl EGG_TCL_CHECK_VERSION()
703 dnl
704 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
705 # Both TCLLIBFN & TCLINCFN must be set, or we bail
706 TCL_FOUND=0
707 if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
708 then
709 TCL_FOUND=1
710
711 # Check Tcl's version
712 if test "$egg_tcl_changed" = "yes"
713 then
714 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
715 fi
716 AC_MSG_CHECKING(for Tcl version)
717 AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
718 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
719 ])
720
721 if test ! "${egg_cv_var_tcl_version-x}" = "x"
722 then
723 AC_MSG_RESULT($egg_cv_var_tcl_version)
724 else
725 AC_MSG_RESULT(not found)
726 TCL_FOUND=0
727 fi
728
729 # Check Tcl's patch level (if avaliable)
730 if test "$egg_tcl_changed" = "yes"
731 then
732 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
733 fi
734 AC_MSG_CHECKING(for Tcl patch level)
735 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
736 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
737 ])
738
739 if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
740 then
741 AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
742 else
743 egg_cv_var_tcl_patch_level="unknown"
744 AC_MSG_RESULT(unknown)
745 fi
746 fi
747
748 # Check if we found Tcl's version
749 if test "$TCL_FOUND" = 0
750 then
751 cat << 'EOF' >&2
752 configure: error:
753
754 I can't find Tcl on this system.
755
756 Eggdrop requires Tcl to compile. If you already have Tcl installed
757 on this system, and I just wasn't looking in the right place for it,
758 set the environment variables TCLLIB and TCLINC so I will know where
759 to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
760 run 'configure' again.
761
762 Read the README file if you don't know what Tcl is or how to get it
763 and install it.
764
765 EOF
766 exit 1
767 fi
768 ])
769
770
771 dnl EGG_TCL_CHECK_PRE70()
772 dnl
773 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
774 # Is this version of Tcl too old for us to use ?
775 TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
776 if test "$TCL_VER_PRE70" = "yes"
777 then
778 cat << EOF >&2
779 configure: error:
780
781 Your Tcl version is much too old for eggdrop to use.
782 I suggest you download and complie a more recent version.
783 The most reliable current version is $tclrecommendver and
784 can be downloaded from $tclrecommendsite
785
786 EOF
787 exit 1
788 fi
789 ])
790
791
792 dnl EGG_TCL_CHECK_PRE75()
793 dnl
794 AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
795 # Are we using a pre 7.5 Tcl version ?
796 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"}'`
797 if test "$TCL_VER_PRE75" = "yes"
798 then
799 AC_DEFINE(HAVE_PRE7_5_TCL, 1,
800 [Define for pre Tcl 7.5 compatibility])
801 fi
802 ])
803
804
805 dnl EGG_TCL_TESTLIBS()
806 dnl
807 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
808 # Set variables for Tcl library tests
809 TCL_TEST_LIB="$TCLLIBFNS"
810 TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
811
812 if test ! "${ac_cv_lib_pthread-x}" = "x"
813 then
814 TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
815 fi
816 ])
817
818
819 dnl EGG_TCL_CHECK_FREE()
820 dnl
821 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
822 if test "$egg_tcl_changed" = "yes"
823 then
824 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
825 fi
826
827 # Check for Tcl_Free()
828 AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free=yes, egg_cv_var_tcl_free=no, $TCL_TEST_OTHERLIBS)
829
830 if test "$egg_cv_var_tcl_free" = "yes"
831 then
832 AC_DEFINE(HAVE_TCL_FREE, 1,
833 [Define for Tcl that has Tcl_Free() (7.5p1 and later)])
834 fi
835 ])
836
837
838 dnl EGG_TCL_THREADS_OPTIONS()
839 dnl
840 AC_DEFUN(EGG_TCL_THREADS_OPTIONS, [dnl
841 AC_ARG_ENABLE(tcl-threads,
842 AC_HELP_STRING([--disable-tcl-threads],
843 [disable threaded tcl support if detected (ignore this option unless you know what you are doing)]),
844 enable_tcl_threads="$enableval",
845 enable_tcl_threads=yes)
846 ])
847
848
849 dnl EGG_TCL_CHECK_THREADS()
850 dnl
851 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
852 if test "$egg_tcl_changed" = "yes"
853 then
854 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
855 fi
856
857 # Check for TclpFinalizeThreadData()
858 AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded=yes, egg_cv_var_tcl_threaded=no, $TCL_TEST_OTHERLIBS)
859
860 if test "$egg_cv_var_tcl_threaded" = "yes"
861 then
862 if test "$enable_tcl_threads" = "no"
863 then
864
865 cat << 'EOF' >&2
866 configure: warning:
867
868 You have disabled threads support on a system with a threaded Tcl library.
869 Tcl features that rely on scheduled events may not function properly.
870
871 EOF
872 else
873 AC_DEFINE(HAVE_TCL_THREADS, 1,
874 [Define for Tcl that has threads])
875 fi
876
877 # Add pthread library to $LIBS if we need it
878 if test ! "${ac_cv_lib_pthread-x}" = "x"
879 then
880 LIBS="$ac_cv_lib_pthread $LIBS"
881 fi
882 fi
883 ])
884
885
886 dnl EGG_TCL_LIB_REQS()
887 dnl
888 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
889 if test "$ac_cv_cygwin" = "yes"
890 then
891 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
892 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
893 else
894 if test ! "$TCLLIBEXT" = ".a"
895 then
896 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
897 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
898 else
899 ## FIXME: this needs to be changed so that it will error and exit saying
900 ## you have to run ./configure --disable-shared
901 # Set default make as static for unshared Tcl library
902 if test ! "$DEFAULT_MAKE" = "static"
903 then
904 cat << 'EOF' >&2
905 configure: warning:
906
907 Your Tcl library is not a shared lib.
908 configure will now set default make type to static...
909
910 EOF
911 DEFAULT_MAKE=static
912 AC_SUBST(DEFAULT_MAKE)
913 fi
914
915 # Are we using a pre 7.4 Tcl version ?
916 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"}'`
917 if test "$TCL_VER_PRE74" = "no"
918 then
919
920 # Was the --with-tcllib option given ?
921 if test ! "${tcllibname-x}" = "x"
922 then
923 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
924 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
925 else
926 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
927 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
928 fi
929 else
930 cat << EOF >&2
931 configure: warning:
932
933 Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
934 There are known problems, but we will attempt to work around them.
935
936 EOF
937 TCL_REQS="libtcle.a"
938 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
939 fi
940 fi
941 fi
942 AC_SUBST(TCL_REQS)
943 AC_SUBST(TCL_LIBS)
944 ])
945
946
947 dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
948 dnl
949 dnl Replace FILE-NAME if the newly created contents differs from the existing
950 dnl file contents. Otherwise leave the file allone. This avoids needless
951 dnl recompiles.
952 dnl
953 define(EGG_REPLACE_IF_CHANGED, [dnl
954 AC_OUTPUT_COMMANDS([
955 egg_replace_file="$1"
956 echo "creating $1"
957 $2
958 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
959 then
960 echo "$1 is unchanged"
961 else
962 mv conftest.out $egg_replace_file
963 fi
964 rm -f conftest.out], [$3])
965 ])
966
967
968 dnl EGG_TCL_LUSH()
969 dnl
970 AC_DEFUN(EGG_TCL_LUSH, [dnl
971 EGG_REPLACE_IF_CHANGED(lush.h, [
972 cat > conftest.out << EGGEOF
973 /* Ignore me but do not erase me. I am a kludge. */
974
975 #include "$egg_tclinc/$egg_tclincfn"
976 EGGEOF], [
977 egg_tclinc="$TCLINC"
978 egg_tclincfn="$TCLINCFN"])
979 ])
980
981
982 dnl AC_PROG_CC_WIN32()
983 dnl
984 AC_DEFUN([AC_PROG_CC_WIN32], [
985 AC_MSG_CHECKING([how to access the Win32 API])
986 WIN32FLAGS=
987 AC_TRY_COMPILE(,[
988 #ifndef WIN32
989 # ifndef _WIN32
990 # error WIN32 or _WIN32 not defined
991 # endif
992 #endif], [
993 dnl found windows.h with the current config.
994 AC_MSG_RESULT([present by default])
995 ], [
996 dnl try -mwin32
997 ac_compile_save="$ac_compile"
998 dnl we change CC so config.log looks correct
999 save_CC="$CC"
1000 ac_compile="$ac_compile -mwin32"
1001 CC="$CC -mwin32"
1002 AC_TRY_COMPILE(,[
1003 #ifndef WIN32
1004 # ifndef _WIN32
1005 # error WIN32 or _WIN32 not defined
1006 # endif
1007 #endif], [
1008 dnl found windows.h using -mwin32
1009 AC_MSG_RESULT([found via -mwin32])
1010 ac_compile="$ac_compile_save"
1011 CC="$save_CC"
1012 WIN32FLAGS="-mwin32"
1013 ], [
1014 ac_compile="$ac_compile_save"
1015 CC="$save_CC"
1016 AC_MSG_RESULT([not found])
1017 ])
1018 ])
1019 ])
1020
1021
1022 dnl EGG_IPV6_OPTIONS()
1023 dnl
1024 AC_DEFUN(EGG_IPV6_OPTIONS, [dnl
1025 AC_MSG_CHECKING(whether you enabled IPv6 support)
1026 dnl dummy option for help string, next option is the real one
1027 AC_ARG_ENABLE(ipv6,
1028 AC_HELP_STRING([--enable-ipv6],
1029 [enable IPV6 support]),,)
1030 AC_ARG_ENABLE(ipv6,
1031 AC_HELP_STRING([--disable-ipv6],
1032 [disable IPV6 support]),
1033 [ ac_cv_ipv6="$enableval"
1034 AC_MSG_RESULT($ac_cv_ipv6)
1035 ], [
1036 if test "$egg_cv_ipv6_supported" = "yes"
1037 then
1038 ac_cv_ipv6=yes
1039 else
1040 ac_cv_ipv6=no
1041 fi
1042 AC_MSG_RESULT((default) $ac_cv_ipv6)
1043 ])
1044 if test "$ac_cv_ipv6" = "yes"
1045 then
1046 AC_DEFINE(IPV6, 1,
1047 [Define if you want IPv6 support])
1048 fi
1049 ])
1050
1051
1052 dnl EGG_TYPE_SOCKLEN_T
1053 dnl
1054 AC_DEFUN(EGG_TYPE_SOCKLEN_T, [dnl
1055 AC_CACHE_CHECK(for socklen_t, egg_cv_var_socklen_t, [
1056 AC_TRY_COMPILE([#include <sys/param.h>
1057 #include <sys/socket.h>
1058 #include <sys/types.h>
1059 ], [
1060 socklen_t x;
1061 x = 0;
1062 ], egg_cv_var_socklen_t=yes, egg_cv_var_socklen_t=no)
1063 ])
1064 if test "$egg_cv_var_socklen_t" = "no"
1065 then
1066 AC_DEFINE(socklen_t, unsigned,
1067 [Define to `unsigned' if something else doesn't define])
1068 fi
1069 ])
1070
1071
1072 dnl EGG_INADDR_LOOPBACK
1073 dnl
1074 AC_DEFUN(EGG_INADDR_LOOPBACK, [dnl
1075 AC_MSG_CHECKING(for INADDR_LOOPBACK)
1076 AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
1077 AC_TRY_COMPILE([
1078 #include <sys/socket.h>
1079 #include <netinet/in.h>
1080 #include <arpa/inet.h>
1081 ],[
1082 INADDR_LOOPBACK;
1083 ],
1084 adns_cv_decl_inaddrloopback=yes,
1085 adns_cv_decl_inaddrloopback=no)])
1086 if test "$adns_cv_decl_inaddrloopback" = "yes"
1087 then
1088 AC_MSG_RESULT(found)
1089 else
1090 AC_MSG_RESULT([not in standard headers, urgh...])
1091 AC_CHECK_HEADER(rpc/types.h,[
1092 AC_DEFINE(HAVEUSE_RPCTYPES_H, 1,
1093 [Define if we want to include rpc/types.h. Crap BSDs put INADDR_LOOPBACK there.])
1094 ],[
1095 AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
1096 ])
1097 fi
1098 ])
1099
1100
1101 dnl EGG_IPV6_SUPPORTED
1102 dnl
1103 AC_DEFUN(EGG_IPV6_SUPPORTED, [dnl
1104 AC_MSG_CHECKING(for kernel IPv6 support)
1105 AC_CACHE_VAL(egg_cv_ipv6_supported,[
1106 AC_TRY_RUN([
1107 #include <fcntl.h>
1108 #include <sys/socket.h>
1109 #include <sys/types.h>
1110 #include <netinet/in.h>
1111 #include <unistd.h>
1112 #include <errno.h>
1113 #include <stdio.h>
1114
1115 int main()
1116 {
1117 struct sockaddr_in6 sin6;
1118 int s = socket(AF_INET6, SOCK_STREAM, 0);
1119 if (s != -1)
1120 close(s);
1121 return s == -1;
1122 }
1123 ], egg_cv_ipv6_supported=yes, egg_cv_ipv6_supported=no,
1124 egg_cv_ipv6_supported=no)])
1125 if test "$egg_cv_ipv6_supported" = "yes"
1126 then
1127 AC_MSG_RESULT(yes)
1128 else
1129 AC_MSG_RESULT(no)
1130 fi
1131 ])
1132
1133
1134 dnl EGG_DEFINE_VERSION_NUM
1135 dnl
1136 AC_DEFUN(EGG_DEFINE_VERSION_NUM, [dnl
1137 egg_version_num=`echo $VERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d00", [$]1, [$]2, [$]3)}'`
1138 AC_DEFINE_UNQUOTED(VERSION_NUM, $egg_version_num,
1139 [Define version number])
1140 ])
1141
1142
1143 dnl EGG_GNU_GETTEXT
1144 dnl
1145 AC_DEFUN(EGG_GNU_GETTEXT, [dnl
1146 AC_MSG_CHECKING(for avaible translations)
1147 ALL_LINGUAS=""
1148 cd po
1149 for LOC in `ls *.po 2> /dev/null`
1150 do
1151 ALL_LINGUAS="$ALL_LINGUAS `echo $LOC | $AWK 'BEGIN {FS = "."} {printf("%s", [$]1)}'`"
1152 done
1153 cd ..
1154 AC_MSG_RESULT($ALL_LINGUAS)
1155
1156 AM_GNU_GETTEXT
1157 ])
1158
1159
1160 dnl EGG_LIBTOOL
1161 dnl
1162 AC_DEFUN(EGG_LIBTOOL, [dnl
1163 AC_DISABLE_FAST_INSTALL
1164 AC_DISABLE_STATIC
1165 AC_LIBTOOL_WIN32_DLL
1166 AC_LIBLTDL_CONVENIENCE
1167 AC_SUBST(INCLTDL)
1168 AC_SUBST(LIBLTDL)
1169 AC_LIBTOOL_DLOPEN
1170 AM_PROG_LIBTOOL
1171
1172 if test "x$enable_shared" = "xno"
1173 then
1174 AC_DEFINE_UNQUOTED(STATIC, 1, Define if build is static)
1175 fi
1176 ])
1177
1178
1179 dnl EGG_DEBUG_OPTIONS
1180 dnl
1181 AC_DEFUN(EGG_DEBUG_OPTIONS, [dnl
1182 AC_ARG_ENABLE(debug,
1183 AC_HELP_STRING([--disable-debug],
1184 [disable debug support]),
1185 debug="$enableval", debug=yes)
1186 if test "$debug" = "yes"
1187 then
1188 # FIXME: this should be done along with `--with-efence'
1189 AC_CHECK_LIB(efence, malloc)
1190 EGG_DEBUG="-DDEBUG"
1191 fi
1192 AC_SUBST(EGG_DEBUG)
1193 ])
1194
1195
1196 dnl EGG_COMPRESS_MODULE
1197 dnl
1198 AC_DEFUN(EGG_COMPRESS_MODULE, [dnl
1199
1200 egg_compress=no
1201
1202 AC_CHECK_LIB(z, gzopen, ZLIB="-lz", )
1203 AC_CHECK_HEADER(zlib.h)
1204
1205 # Disable the module if either the header file or the library
1206 # are missing.
1207 if test "${ZLIB-x}" = "x"
1208 then
1209 cat << 'EOF' >&2
1210 configure: warning:
1211
1212 Your system does not provide a working zlib compression library. The
1213 compress module will therefore be disabled.
1214
1215 EOF
1216 else
1217 if test ! "${ac_cv_header_zlib_h}" = "yes"
1218 then
1219 cat << 'EOF' >&2
1220 configure: warning:
1221
1222 Your system does not provide the necessary zlib header files. The
1223 compress module will therefore be disabled.
1224
1225 EOF
1226 else
1227 egg_compress=yes
1228 AC_FUNC_MMAP
1229 AC_SUBST(ZLIB)
1230 fi
1231 fi
1232
1233 AM_CONDITIONAL(EGG_COMPRESS, test "$egg_compress" = "yes")
1234 ])

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23