/[cvs]/eggdrop1.6/aclocal.m4
ViewVC logotype

Contents of /eggdrop1.6/aclocal.m4

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


Revision 1.71 - (show annotations) (download)
Tue Jun 10 15:16:07 2003 UTC (18 years, 3 months ago) by stdarg
Branch: MAIN
CVS Tags: r1, blah, test
Changes since 1.70: +2 -1 lines
* Make room for the core file if we're not stripping the files
* When I do cvs diff config.h.in, there's one of those id tags in it.. isn't that wrong?

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23