/[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.50 - (show annotations) (download)
Thu Aug 9 04:06:32 2001 UTC (17 years, 10 months ago) by guppy
Branch: MAIN
Changes since 1.49: +7 -1 lines
PATCH: cygwinsharedtcl1 -- added Kirben's patch to sync upto 1.6

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23