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

Annotation of /eggdrop1.8/aclocal.m4

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


Revision 1.12.2.2 - (hide annotations) (download)
Tue Feb 8 22:06:01 2011 UTC (8 years, 5 months ago) by thommey
Branch: gettext
Changes since 1.12.2.1: +11 -6 lines
merge changes from master into gettext

1 simple 1.1 dnl aclocal.m4: macros autoconf uses when building configure from configure.ac
2     dnl
3     dnl Copyright (C) 1999 - 2010 Eggheads Development Team
4     dnl
5     dnl This program is free software; you can redistribute it and/or
6     dnl modify it under the terms of the GNU General Public License
7     dnl as published by the Free Software Foundation; either version 2
8     dnl of the License, or (at your option) any later version.
9     dnl
10     dnl This program is distributed in the hope that it will be useful,
11     dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12     dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13     dnl GNU General Public License for more details.
14     dnl
15     dnl You should have received a copy of the GNU General Public License
16     dnl along with this program; if not, write to the Free Software
17     dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18     dnl
19 thommey 1.12.2.2 dnl $Id: aclocal.m4,v 1.12.2.1 2011/02/06 19:19:15 pseudo Exp $
20 simple 1.1 dnl
21    
22    
23     dnl
24     dnl Message macros.
25     dnl
26    
27    
28     dnl EGG_MSG_CONFIGURE_START()
29     dnl
30     AC_DEFUN([EGG_MSG_CONFIGURE_START],
31     [
32     AC_MSG_RESULT
33     AC_MSG_RESULT([This is Eggdrop's GNU configure script.])
34     AC_MSG_RESULT([It's going to run a bunch of tests to hopefully make your compile])
35     AC_MSG_RESULT([work without much twiddling.])
36     AC_MSG_RESULT
37     ])
38    
39    
40     dnl EGG_MSG_CONFIGURE_END()
41     dnl
42     AC_DEFUN([EGG_MSG_CONFIGURE_END],
43     [
44     AC_MSG_RESULT([Type 'make config' to configure the modules, or type 'make iconfig'])
45     AC_MSG_RESULT([to interactively choose which modules to compile.])
46     AC_MSG_RESULT
47     ])
48    
49    
50     dnl EGG_MSG_WEIRDOS()
51     dnl
52     dnl Print some messages at the end of configure to give extra information to
53     dnl users of 'weird' operating systems.
54     dnl
55     AC_DEFUN([EGG_MSG_WEIRDOS],
56     [
57     AC_MSG_RESULT([Operating System: $egg_cv_var_system_type $egg_cv_var_system_release])
58     AC_MSG_RESULT
59     if test "$UNKNOWN_OS" = yes; then
60     AC_MSG_RESULT([WARNING:])
61     AC_MSG_RESULT
62     AC_MSG_RESULT([ Unknown Operating System: $egg_cv_var_system_type $egg_cv_var_system_release])
63     AC_MSG_RESULT
64     AC_MSG_RESULT([ Module support has been disabled for this build.])
65     AC_MSG_RESULT
66     AC_MSG_RESULT([ Please let us know what type of system this is by e-mailing])
67     AC_MSG_RESULT([ bugs@eggheads.org. The output of uname -a, and some other basic])
68     AC_MSG_RESULT([ information about the OS should be included.])
69     AC_MSG_RESULT
70     else
71     if test "$WEIRD_OS" = yes; then
72     AC_MSG_RESULT([WARNING:])
73     AC_MSG_RESULT
74     AC_MSG_RESULT([ The operating system you are using has not yet had a great])
75     AC_MSG_RESULT([ deal of testing with Eggdrop. For this reason, this compile])
76     AC_MSG_RESULT([ will default to "make static".])
77     AC_MSG_RESULT
78     AC_MSG_RESULT([ To enable module support, type "make eggdrop" instead of just])
79     AC_MSG_RESULT([ "make" after you run "make config" (or "make iconfig").])
80     AC_MSG_RESULT
81     AC_MSG_RESULT([ As we have not done a sufficient amount of testing on this])
82     AC_MSG_RESULT([ OS, your feedback is greatly appreciated. Please let us know])
83     AC_MSG_RESULT([ at bugs@eggheads.org if there are any problems compiling with])
84     AC_MSG_RESULT([ module support, or if you got it to work :)])
85     AC_MSG_RESULT
86     fi
87     AC_MSG_RESULT([If you experience any problems compiling Eggdrop, please read the])
88     AC_MSG_RESULT([compile guide, found in doc/COMPILE-GUIDE.])
89     AC_MSG_RESULT
90     fi
91     ])
92    
93    
94     dnl EGG_APPEND_VAR()
95     dnl
96     dnl Append a non-empty string to a variable
97     dnl
98     dnl $1 = variable
99     dnl $2 = string
100     dnl
101     AC_DEFUN([EGG_APPEND_VAR],
102     [
103     if test "x$2" != x; then
104     if test "x$$1" = x; then
105     $1="$2"
106     else
107     $1="$$1 $2"
108     fi
109     fi
110     ])
111    
112    
113     dnl
114     dnl Compiler checks.
115     dnl
116    
117    
118     dnl EGG_CHECK_CCPIPE()
119     dnl
120     dnl This macro checks whether or not the compiler supports the `-pipe' flag,
121     dnl which speeds up the compilation.
122     dnl
123     AC_DEFUN([EGG_CHECK_CCPIPE],
124     [
125 pseudo 1.12.2.1 AC_CACHE_CHECK([whether the compiler understands -pipe], egg_cv_var_ccpipe, [
126     ac_old_CC="$CC"
127     CC="$CC -pipe"
128     AC_COMPILE_IFELSE([[
129     int main ()
130     {
131     return(0);
132     }
133     ]], [
134     egg_cv_var_ccpipe="yes"
135     ], [
136     egg_cv_var_ccpipe="no"
137 simple 1.1 ])
138 pseudo 1.12.2.1 CC="$ac_old_CC"
139     ])
140 simple 1.1
141 pseudo 1.12.2.1 if test "$egg_cv_var_ccpipe" = yes; then
142     EGG_APPEND_VAR(CFLAGS, -pipe)
143 simple 1.1 fi
144     ])
145    
146    
147     dnl EGG_CHECK_CCWALL()
148     dnl
149     dnl See if the compiler supports -Wall.
150     dnl
151     AC_DEFUN([EGG_CHECK_CCWALL],
152     [
153 pseudo 1.12.2.1 AC_CACHE_CHECK([whether the compiler understands -Wall], egg_cv_var_ccwall, [
154     ac_old_CFLAGS="$CFLAGS"
155     CFLAGS="$CFLAGS -Wall"
156     AC_COMPILE_IFELSE([[
157     int main ()
158     {
159     return(0);
160     }
161     ]], [
162     egg_cv_var_ccwall="yes"
163     ], [
164     egg_cv_var_ccwall="no"
165 simple 1.1 ])
166 pseudo 1.12.2.1 CFLAGS="$ac_old_CFLAGS"
167     ])
168 simple 1.1
169 pseudo 1.12.2.1 if test "$egg_cv_var_ccwall" = yes; then
170     EGG_APPEND_VAR(CFLAGS, -Wall)
171 simple 1.1 fi
172     ])
173    
174    
175     dnl
176     dnl Checks for types and functions.
177     dnl
178    
179    
180     dnl EGG_CHECK_SOCKLEN_T()
181     dnl
182     dnl Check for the socklen_t type.
183     dnl
184     AC_DEFUN([EGG_CHECK_SOCKLEN_T],
185     [
186     AC_CACHE_CHECK([for socklen_t], egg_cv_socklen_t, [
187     AC_RUN_IFELSE([[
188     #include <unistd.h>
189     #include <sys/param.h>
190     #include <sys/types.h>
191     #include <sys/socket.h>
192     #include <netinet/in.h>
193     #include <arpa/inet.h>
194    
195     int main()
196     {
197     socklen_t test = 55;
198    
199     if (test != 55)
200     exit(1);
201    
202     return(0);
203     }
204     ]], [
205     egg_cv_socklen_t="yes"
206     ], [
207     egg_cv_socklen_t="no"
208     ], [
209     egg_cv_socklen_t="cross"
210     ])
211     ])
212    
213     if test "$egg_cv_socklen_t" = yes; then
214     AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define to 1 if you have the `socklen_t' type.])
215     fi
216     ])
217    
218    
219     dnl
220 pseudo 1.12.2.1 dnl Make sure the compiler is determined and supports C89.
221     dnl
222     AC_DEFUN([EGG_CHECK_C89],
223 simple 1.1 [
224 pseudo 1.12.2.1 AC_REQUIRE([AC_PROG_CC])
225     AS_IF([test "x$ac_cv_prog_cc_c89" = "xno" || test "x$ac_cv_header_stdc" = "xno"], [
226     AC_MSG_ERROR([Your system doesn't support ANSI C89.])
227     ])
228 simple 1.1 ])
229    
230    
231     dnl
232     dnl Checks for programs.
233     dnl
234    
235    
236     dnl EGG_PROG_HEAD_1()
237     dnl
238     dnl This macro checks for the proper 'head -1' command variant to use.
239     dnl
240     AC_DEFUN([EGG_PROG_HEAD_1],
241     [
242     cat << 'EOF' > conftest.head
243     a
244     b
245     c
246     EOF
247    
248     for ac_prog in 'head -n 1' 'head -1' 'sed 1q'; do
249     AC_MSG_CHECKING([whether $ac_prog works])
250     AC_CACHE_VAL([ac_cv_prog_HEAD_1], [
251     if test -n "$HEAD_1"; then
252     # Let the user override the test.
253     ac_cv_prog_HEAD_1="$HEAD_1"
254     else
255     if test `cat conftest.head | $ac_prog` = a; then
256     ac_cv_prog_HEAD_1="$ac_prog"
257     fi
258     fi
259     ])
260     if test -n "$ac_cv_prog_HEAD_1"; then
261     AC_MSG_RESULT([yes])
262     break
263     else
264     AC_MSG_RESULT([no])
265     fi
266     done
267    
268     if test "x$ac_cv_prog_HEAD_1" = x; then
269     cat << 'EOF' >&2
270     configure: error:
271    
272     This system seems to lack a working 'head -1' or 'head -n 1' command.
273     A working 'head -1' (or equivalent) command is required to compile Eggdrop.
274    
275     EOF
276     exit 1
277     fi
278    
279     rm -f conftest.head
280     HEAD_1="$ac_cv_prog_HEAD_1"
281     AC_SUBST(HEAD_1)
282     ])
283    
284    
285     dnl EGG_PROG_AWK()
286     dnl
287     AC_DEFUN([EGG_PROG_AWK],
288     [
289     AC_PROG_AWK
290     if test "x$AWK" = x; then
291     cat << 'EOF' >&2
292     configure: error:
293    
294     This system seems to lack a working 'awk' command.
295     A working 'awk' command is required to compile Eggdrop.
296    
297     EOF
298     exit 1
299     fi
300     ])
301    
302    
303     dnl EGG_PROG_BASENAME()
304     dnl
305     AC_DEFUN([EGG_PROG_BASENAME],
306     [
307     AC_CHECK_PROG(BASENAME, basename, basename)
308     if test "x$BASENAME" = x; then
309     cat << 'EOF' >&2
310     configure: error:
311    
312     This system seems to lack a working 'basename' command.
313     A working 'basename' command is required to compile Eggdrop.
314    
315     EOF
316     exit 1
317     fi
318     ])
319    
320    
321     dnl EGG_ENABLE_STRIP()
322     dnl
323     AC_DEFUN([EGG_ENABLE_STRIP],
324     [
325 pseudo 1.12.2.1 AC_ARG_ENABLE([strip], AS_HELP_STRING([--enable-strip], [enable stripping of binaries]),
326 simple 1.1 [enable_strip="$enableval"],
327     [enable_strip="no"])
328    
329     if test "$enable_strip" = yes; then
330     cat << 'EOF' >&2
331    
332     configure: WARNING:
333    
334     Stripping the executable, while saving some disk space, will make bug
335     reports nearly worthless. If Eggdrop crashes and you wish to report
336     a bug, you will need to recompile with stripping disabled.
337    
338     EOF
339     else
340     STRIP="touch"
341     fi
342     ])
343    
344    
345     dnl
346     dnl Checks for operating system and module support.
347     dnl
348    
349    
350     dnl EGG_OS_VERSION()
351     dnl
352     AC_DEFUN([EGG_OS_VERSION],
353     [
354     dnl FIXME: Eventually replace these with the results of AC_CANONICAL_* below
355     AC_CACHE_CHECK([system type], egg_cv_var_system_type, [egg_cv_var_system_type=`$UNAME -s`])
356     AC_CACHE_CHECK([system release], egg_cv_var_system_release, [egg_cv_var_system_release=`$UNAME -r`])
357    
358     AC_CANONICAL_BUILD
359     AC_CANONICAL_HOST
360     AC_CANONICAL_TARGET
361     ])
362    
363    
364     dnl EGG_CYGWIN_BINMODE
365     dnl
366     dnl Check for binmode.o on Cygwin.
367     dnl
368     AC_DEFUN([EGG_CYGWIN_BINMODE],
369     [
370     if test "$EGG_CYGWIN" = yes; then
371     AC_MSG_CHECKING([for /usr/lib/binmode.o])
372     if test -r /usr/lib/binmode.o; then
373     AC_MSG_RESULT([yes])
374     EGG_APPEND_VAR(LIBS, /usr/lib/binmode.o)
375     else
376     AC_MSG_RESULT([no])
377     AC_MSG_WARN([Make sure the directory Eggdrop is installed into is mounted in binary mode.])
378     fi
379     fi
380     ])
381    
382    
383     dnl EGG_DARWIN_BUNDLE
384     dnl
385     dnl Locate bundle1.o on Darwin. Test systems seem to have it in /usr/lib,
386     dnl however the official docs say /lib.
387     dnl
388     AC_DEFUN([EGG_DARWIN_BUNDLE],
389     [
390     BUNDLE=""
391     for bundlepath in "/lib" "/usr/lib" "/usr/local/lib"; do
392     AC_MSG_CHECKING([for bundle1.o in ${bundlepath}])
393     if test -r "${bundlepath}/bundle1.o"; then
394     AC_MSG_RESULT([yes])
395     BUNDLE="${bundlepath}/bundle1.o"
396     break
397     else
398     AC_MSG_RESULT([no])
399     fi
400     done
401    
402     if test "x$BUNDLE" = x; then
403     cat << 'EOF' >&2
404     configure: WARNING:
405    
406     bundle1.o cannot be located. A module build might not compile correctly.
407    
408     EOF
409     fi
410     ])
411    
412    
413     dnl EGG_CHECK_MODULE_SUPPORT()
414     dnl
415     dnl Checks for module support. This should be run after EGG_OS_VERSION.
416     dnl
417     AC_DEFUN([EGG_CHECK_MODULE_SUPPORT],
418     [
419     MODULES_OK="yes"
420     MOD_EXT="so"
421 pseudo 1.2 DEFAULT_MAKE="debug"
422 simple 1.1 LOAD_METHOD="dl"
423     WEIRD_OS="yes"
424     UNKNOWN_OS="no"
425     MODULE_XLIBS=""
426    
427     AC_MSG_CHECKING([module loading capabilities])
428     AC_MSG_RESULT
429     AC_CHECK_HEADERS([dl.h dlfcn.h loader.h rld.h mach-o/dyld.h mach-o/rld.h])
430     AC_CHECK_FUNCS([dlopen load NSLinkModule shl_load rld_load])
431    
432     # Note to other maintainers:
433     # Bourne shell has no concept of "fall through"
434     case "$egg_cv_var_system_type" in
435     BSD/OS)
436     if test `echo "$egg_cv_var_system_release" | cut -d . -f 1` = 2; then
437     MODULES_OK="no"
438     fi
439     ;;
440     CYGWI*)
441     WEIRD_OS="no"
442     MOD_EXT="dll"
443     ;;
444     HP-UX)
445     LOAD_METHOD="shl"
446     ;;
447     dell)
448     # do nothing
449     ;;
450     IRIX)
451     # do nothing
452     ;;
453     Ultrix)
454     # No dlopen() or similar on Ultrix. We can't use modules.
455     MODULES_OK="no"
456     ;;
457     BeOS)
458     # We don't yet support BeOS's dynamic linking interface.
459     MODULES_OK="no"
460     ;;
461     Linux)
462     WEIRD_OS="no"
463     ;;
464     Lynx)
465     # do nothing
466     ;;
467     QNX)
468     # do nothing
469     # QNX (recent versions at least) support dlopen().
470     ;;
471     OSF1)
472     case `echo "$egg_cv_var_system_release" | cut -d . -f 1` in
473     1.*) LOAD_METHOD="loader" ;;
474     esac
475     ;;
476     SunOS)
477     if test `echo "$egg_cv_var_system_release" | cut -d . -f 1` = 5; then
478     # We've had quite a bit of testing on Solaris.
479     WEIRD_OS="no"
480     else
481     # SunOS 4
482     AC_DEFINE(DLOPEN_1, 1, [Define if running on SunOS 4.0.])
483     fi
484     ;;
485     *BSD)
486     # FreeBSD/OpenBSD/NetBSD all support dlopen() and have had plenty of
487     # testing with Eggdrop.
488     WEIRD_OS="no"
489     ;;
490     Darwin)
491     # We should support Mac OS X (at least 10.1 and later) now.
492     # Use rld on < 10.1.
493     if test "$ac_cv_func_NSLinkModule" = no; then
494     LOAD_METHOD="rld"
495     fi
496     LOAD_METHOD="dyld"
497     EGG_DARWIN_BUNDLE
498     EGG_APPEND_VAR(MODULE_XLIBS, $BUNDLE)
499     ;;
500     *)
501     if test -r /mach; then
502     # At this point, we're guessing this is NeXT Step. We support rld, so
503     # modules will probably work on NeXT now, but we have absolutely no way
504     # to test this. I've never even seen a NeXT box, let alone do I know of
505     # one I can test this on.
506     LOAD_METHOD="rld"
507     else
508     # QNX apparently supports dlopen()... Fallthrough.
509     if test -r /cmds; then
510     UNKNOWN_OS="yes"
511     MODULES_OK="no"
512     fi
513     fi
514     ;;
515     esac
516    
517     if test "$MODULES_OK" = yes; then
518     AC_DEFINE(MODULES_OK, 1, [Define if modules will work on your system.])
519     case $LOAD_METHOD in
520     dl)
521     AC_DEFINE(MOD_USE_DL, 1, [Define if modules should be loaded using the dl*() functions.])
522     ;;
523     shl)
524     AC_DEFINE(MOD_USE_SHL, 1, [Define if modules should be loaded using the shl_*() functions.])
525     ;;
526     dyld)
527     AC_DEFINE(MOD_USE_DYLD, 1, [Define if modules should be loaded using the NS*() functions.])
528     ;;
529     loader)
530     AC_DEFINE(MOD_USE_LOADER, 1, [Define if modules should be loaded using the ldr*() and *load() functions.])
531     ;;
532     rld)
533     AC_DEFINE(MOD_USE_RLD, 1, [Define if modules should be loaded using the rld_*() functions.])
534     ;;
535     esac
536     else
537     DEFAULT_MAKE="static"
538     fi
539    
540     if test "$WEIRD_OS" = yes; then
541     # Default to "make static" for 'weird' operating systems. Will print a
542     # note at the end of configure explaining. This way, Eggdrop should compile
543     # "out of the box" on most every operating system we know of, and they can
544     # do a "make eggdrop" if they want to use(/try to use) module support. - Wcc
545     DEFAULT_MAKE="static"
546     fi
547    
548     AC_SUBST(DEFAULT_MAKE)
549     AC_SUBST(MOD_EXT)
550     AC_SUBST(MODULE_XLIBS)
551     AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT", [Defines the extension of Eggdrop modules.])
552     ])
553    
554    
555     dnl EGG_CHECK_OS()
556     dnl
557     dnl Various operating system tests.
558     dnl
559     AC_DEFUN([EGG_CHECK_OS],
560     [
561     MOD_CC="$CC"
562     MOD_LD="$CC"
563     MOD_STRIP="$STRIP"
564     SHLIB_CC="$CC"
565     SHLIB_LD="$CC"
566     SHLIB_STRIP="$STRIP"
567     LINUX="no"
568     IRIX="no"
569     SUNOS="no"
570     HPUX="no"
571     EGG_CYGWIN="no"
572    
573     case "$egg_cv_var_system_type" in
574     BSD/OS)
575     case `echo "$egg_cv_var_system_release" | cut -d . -f 1` in
576     2)
577     # do nothing
578     ;;
579     3)
580     MOD_CC="shlicc"
581     MOD_LD="shlicc"
582     if test "$STRIP" != touch; then
583     MOD_STRIP="$STRIP -d"
584     fi
585     SHLIB_LD="shlicc -r"
586     SHLIB_STRIP="touch"
587     ;;
588     *)
589     if test "$STRIP" != touch; then
590     MOD_STRIP="$STRIP -d"
591     fi
592     SHLIB_CC="$CC -export-dynamic -fPIC"
593     SHLIB_LD="$CC -shared -nostartfiles"
594     ;;
595     esac
596     ;;
597     CYGWI*)
598     SHLIB_LD="$CC -shared"
599     MOD_CC="$CC"
600     MOD_LD="$CC"
601     EGG_CYGWIN="yes"
602     EGG_CYGWIN_BINMODE
603     AC_DEFINE(CYGWIN_HACKS, 1, [Define if running under Cygwin.])
604     ;;
605     HP-UX)
606     HPUX="yes"
607     if test "$CC" = cc; then
608     # HP-UX ANSI C Compiler.
609     MOD_LD="$CC +z"
610     SHLIB_CC="$CC +z"
611     else
612     # GCC
613     MOD_LD="$CC -fPIC -shared"
614     SHLIB_CC="$CC -fPIC"
615     fi
616     SHLIB_LD="ld -b"
617     ;;
618     dell)
619     SHLIB_STRIP="touch"
620     MOD_LD="$CC -lelf -lucb"
621     ;;
622     IRIX)
623     SHLIB_LD="ld -n32 -shared -rdata_shared"
624     IRIX="yes"
625     SHLIB_STRIP="touch"
626     ;;
627     Ultrix)
628     SHLIB_STRIP="touch"
629     DEFAULT_MAKE="static"
630     SHELL="/bin/sh5"
631     ;;
632     SINIX*)
633     SHLIB_STRIP="touch"
634     SHLIB_CC="cc -G"
635     ;;
636     BeOS)
637     # do nothing
638     ;;
639     Linux)
640     LINUX="yes"
641     MOD_LD="$CC"
642     SHLIB_CC="$CC -fPIC"
643     SHLIB_LD="$CC -shared -nostartfiles"
644     ;;
645     Lynx)
646     # do nothing
647     ;;
648     QNX)
649     SHLIB_LD="ld -shared"
650 pseudo 1.7 AC_DEFINE(QNX_HACKS, 1, [Define if running under QNX.])
651 simple 1.1 ;;
652     OSF1)
653     case `echo "$egg_cv_var_system_release" | cut -d . -f 1` in
654     V*)
655     # Digital OSF uses an ancient version of gawk
656     if test "$AWK" = gawk; then
657     AWK="awk"
658     fi
659     SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
660     SHLIB_STRIP="touch"
661     ;;
662     1.0|1.1|1.2)
663     SHLIB_LD="ld -R -export $@:"
664     ;;
665     1.*)
666     SHLIB_CC="$CC -fpic"
667     SHLIB_LD="ld -shared"
668     ;;
669     esac
670     AC_DEFINE(BROKEN_SNPRINTF, 1, [Define to use Eggdrop's snprintf functions regardless of HAVE_SNPRINTF.])
671     AC_DEFINE(STOP_UAC, 1, [Define if running on OSF/1 platform.])
672     ;;
673     SunOS)
674     if test `echo "$egg_cv_var_system_release" | cut -d . -f 1` = 5; then
675     # Solaris
676     if test -n "$GCC"; then
677     SHLIB_CC="$CC -fPIC"
678     SHLIB_LD="$CC -shared"
679     else
680     SHLIB_CC="$CC -KPIC"
681     SHLIB_LD="$CC -G -z text"
682     fi
683     else
684     # SunOS 4
685     SUNOS="yes"
686     SHLIB_LD="ld"
687     SHLIB_CC="$CC -PIC"
688     fi
689     ;;
690     *BSD)
691     # FreeBSD/OpenBSD/NetBSD
692     SHLIB_CC="$CC -fPIC"
693     SHLIB_LD="ld -Bshareable -x"
694     ;;
695     Darwin)
696     # Mac OS X
697     SHLIB_CC="$CC -fPIC"
698     SHLIB_LD="ld -bundle -undefined error"
699     AC_DEFINE(BIND_8_COMPAT, 1, [Define if running on Mac OS X with dns.mod.])
700     ;;
701     *)
702     if test -r /mach; then
703     # At this point, we're guessing this is NeXT Step.
704     AC_DEFINE(BORGCUBES, 1, [Define if running on NeXT Step.])
705     else
706     if test -r /cmds; then
707     # Probably QNX.
708     SHLIB_LD="ld -shared"
709     SHLIB_STRIP="touch"
710     fi
711     fi
712     ;;
713     esac
714    
715     AC_SUBST(MOD_LD)
716     AC_SUBST(MOD_CC)
717     AC_SUBST(MOD_STRIP)
718     AC_SUBST(SHLIB_LD)
719     AC_SUBST(SHLIB_CC)
720     AC_SUBST(SHLIB_STRIP)
721     ])
722    
723    
724     dnl
725     dnl Library tests.
726     dnl
727    
728    
729     dnl EGG_CHECK_LIBS()
730     dnl
731     AC_DEFUN([EGG_CHECK_LIBS],
732     [
733     # FIXME: this needs to be fixed so that it works on IRIX
734     if test "$IRIX" = yes; then
735     AC_MSG_WARN([Skipping library tests because they CONFUSE IRIX.])
736     else
737     AC_CHECK_LIB(socket, socket)
738     AC_CHECK_LIB(nsl, connect)
739     AC_CHECK_LIB(dns, gethostbyname)
740     AC_CHECK_LIB(dl, dlopen)
741     AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
742    
743     # This is needed for Tcl libraries compiled with thread support
744     AC_CHECK_LIB(pthread, pthread_mutex_init, [
745     ac_cv_lib_pthread_pthread_mutex_init="yes"
746     ac_cv_lib_pthread="-lpthread"
747     ], [
748     AC_CHECK_LIB(pthread, __pthread_mutex_init, [
749     ac_cv_lib_pthread_pthread_mutex_init="yes"
750     ac_cv_lib_pthread="-lpthread"
751     ], [
752     AC_CHECK_LIB(pthreads, pthread_mutex_init, [
753     ac_cv_lib_pthread_pthread_mutex_init="yes"
754     ac_cv_lib_pthread="-lpthreads"
755     ], [
756     AC_CHECK_FUNC(pthread_mutex_init, [
757     ac_cv_lib_pthread_pthread_mutex_init="yes"
758     ac_cv_lib_pthread=""
759     ], [
760     ac_cv_lib_pthread_pthread_mutex_init="no"
761     ]
762     )]
763     )]
764     )])
765    
766     if test "$SUNOS" = yes; then
767     # For suns without yp
768     AC_CHECK_LIB(dl, main)
769     else
770     if test "$HPUX" = yes; then
771     AC_CHECK_LIB(dld, shl_load)
772     fi
773     fi
774     fi
775     ])
776    
777    
778     dnl EGG_ARG_HANDLEN()
779     dnl
780     AC_DEFUN([EGG_ARG_HANDLEN], [
781 pseudo 1.12.2.1 AC_ARG_WITH(handlen, AS_HELP_STRING([--with-handlen=VALUE], [set the maximum length a handle on the bot can be]), [
782     if test -n $withval && test $withval -ge 9 && test $withval -le 32; then
783     AC_DEFINE_UNQUOTED(EGG_HANDLEN, $withval, [Define the maximum length of handles on the bot.])
784 simple 1.1 else
785     AC_MSG_WARN([Invalid handlen given (must be a number between 9 and 32), defaulting to 9.])
786     fi
787     ])
788     ])
789    
790     dnl
791     dnl Misc checks.
792     dnl
793    
794    
795     dnl EGG_EXEEXT()
796     dnl
797     dnl Test for executable suffix and define Eggdrop's executable name accordingly.
798     dnl
799     AC_DEFUN([EGG_EXEEXT], [
800 pseudo 1.12.2.1 EGGEXEC="eggdrop${EXEEXT}"
801 simple 1.1 AC_SUBST(EGGEXEC)
802     ])
803    
804    
805     dnl
806     dnl Tcl checks.
807     dnl
808    
809    
810     dnl EGG_TCL_ARG_WITH()
811     dnl
812     AC_DEFUN([EGG_TCL_ARG_WITH],
813     [
814 thommey 1.12.2.2 AC_ARG_WITH(tcllib, AS_HELP_STRING([--with-tcllib=PATH], [full path to Tcl library (e.g. /usr/lib/libtcl8.5.so)]), [tcllibname="$withval"])
815     AC_ARG_WITH(tclinc, AS_HELP_STRING([--with-tclinc=PATH], [full path to Tcl header (e.g. /usr/include/tcl.h)]), [tclincname="$withval"])
816 simple 1.1
817     WARN=0
818     # Make sure either both or neither $tcllibname and $tclincname are set
819     if test "x$tcllibname" != x; then
820     if test "x$tclincname" = x; then
821     WARN=1
822     tcllibname=""
823     TCLLIB=""
824     TCLINC=""
825     fi
826     else
827     if test "x$tclincname" != x; then
828     WARN=1
829     tclincname=""
830     TCLLIB=""
831     TCLINC=""
832     fi
833     fi
834    
835     if test "$WARN" = 1; then
836     cat << 'EOF' >&2
837     configure: WARNING:
838    
839     You must specify both --with-tcllib and --with-tclinc for either to work.
840    
841     configure will now attempt to autodetect both the Tcl library and header.
842    
843     EOF
844     fi
845     ])
846    
847    
848     dnl EGG_TCL_ENV()
849     dnl
850     AC_DEFUN([EGG_TCL_ENV],
851     [
852     WARN=0
853     # Make sure either both or neither $TCLLIB and $TCLINC are set
854     if test "x$TCLLIB" != x; then
855     if test "x$TCLINC" = x; then
856     WARN=1
857     WVAR1=TCLLIB
858     WVAR2=TCLINC
859     TCLLIB=""
860     fi
861     else
862     if test "x$TCLINC" != x; then
863     WARN=1
864     WVAR1=TCLINC
865     WVAR2=TCLLIB
866     TCLINC=""
867     fi
868     fi
869    
870     if test "$WARN" = 1; then
871     cat << EOF >&2
872     configure: WARNING:
873    
874     Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
875     Please set both TCLLIB and TCLINC correctly if you wish to use them.
876    
877     configure will now attempt to autodetect both the Tcl library and header.
878    
879     EOF
880     fi
881     ])
882    
883    
884     dnl EGG_TCL_WITH_TCLLIB()
885     dnl
886     AC_DEFUN([EGG_TCL_WITH_TCLLIB],
887     [
888     # Look for Tcl library: if $tcllibname is set, check there first
889     if test "x$tcllibname" != x; then
890     if test -f "$tcllibname" && test -r "$tcllibname"; then
891     TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
892     TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
893     TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
894     TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
895     else
896     cat << EOF >&2
897     configure: WARNING:
898    
899     The file '$tcllibname' given to option --with-tcllib is not valid.
900 thommey 1.12.2.2 Specify the full path including the file name (e.g. /usr/lib/libtcl8.5.so)
901 simple 1.1
902     configure will now attempt to autodetect both the Tcl library and header.
903    
904     EOF
905     tcllibname=""
906     tclincname=""
907     TCLLIB=""
908     TCLLIBFN=""
909     TCLINC=""
910     TCLINCFN=""
911     fi
912     fi
913     ])
914    
915    
916     dnl EGG_TCL_WITH_TCLINC()
917     dnl
918     AC_DEFUN([EGG_TCL_WITH_TCLINC],
919     [
920     # Look for Tcl header: if $tclincname is set, check there first
921     if test "x$tclincname" != x; then
922     if test -f "$tclincname" && test -r "$tclincname"; then
923     TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
924     TCLINCFN=`$BASENAME $tclincname`
925     else
926     cat << EOF >&2
927     configure: WARNING:
928    
929     The file '$tclincname' given to option --with-tclinc is not valid.
930 thommey 1.12.2.2 Specify the full path including the file name (e.g. /usr/include/tcl.h)
931 simple 1.1
932     configure will now attempt to autodetect both the Tcl library and header.
933    
934     EOF
935     tcllibname=""
936     tclincname=""
937     TCLLIB=""
938     TCLLIBFN=""
939     TCLINC=""
940     TCLINCFN=""
941     fi
942     fi
943     ])
944    
945    
946     dnl EGG_TCL_FIND_LIBRARY()
947     dnl
948     AC_DEFUN([EGG_TCL_FIND_LIBRARY],
949     [
950     # Look for Tcl library: if $TCLLIB is set, check there first
951     if test "x$TCLLIBFN" = x && test "x$TCLLIB" != x; then
952     if test -d "$TCLLIB"; then
953     for tcllibfns in $tcllibnames; do
954     for tcllibext in $tcllibextensions; do
955     if test -r "${TCLLIB}/lib${tcllibfns}${tcllibext}"; then
956     TCLLIBFN="${tcllibfns}${tcllibext}"
957     TCLLIBEXT="$tcllibext"
958     TCLLIBFNS="$tcllibfns"
959     break 2
960     fi
961     done
962     done
963     fi
964    
965     if test "x$TCLLIBFN" = x; then
966     cat << 'EOF' >&2
967     configure: WARNING:
968    
969     Environment variable TCLLIB was set, but incorrectly.
970     Please set both TCLLIB and TCLINC correctly if you wish to use them.
971    
972     configure will now attempt to autodetect both the Tcl library and header.
973    
974     EOF
975     TCLLIB=""
976     TCLLIBFN=""
977     TCLINC=""
978     TCLINCFN=""
979     fi
980     fi
981     ])
982    
983    
984     dnl EGG_TCL_FIND_HEADER()
985     dnl
986     AC_DEFUN([EGG_TCL_FIND_HEADER],
987     [
988     # Look for Tcl header: if $TCLINC is set, check there first
989     if test "x$TCLINCFN" = x && test "x$TCLINC" != x; then
990     if test -d "$TCLINC"; then
991     for tclheaderfn in $tclheadernames; do
992     if test -r "${TCLINC}/${tclheaderfn}"; then
993     TCLINCFN="$tclheaderfn"
994     break
995     fi
996     done
997     fi
998    
999     if test "x$TCLINCFN" = x; then
1000     cat << 'EOF' >&2
1001     configure: WARNING:
1002    
1003     Environment variable TCLINC was set, but incorrectly.
1004     Please set both TCLLIB and TCLINC correctly if you wish to use them.
1005    
1006     configure will now attempt to autodetect both the Tcl library and header.
1007    
1008     EOF
1009     TCLLIB=""
1010     TCLLIBFN=""
1011     TCLINC=""
1012     TCLINCFN=""
1013     fi
1014     fi
1015     ])
1016    
1017    
1018     dnl EGG_TCL_CHECK_LIBRARY()
1019     dnl
1020     AC_DEFUN([EGG_TCL_CHECK_LIBRARY],
1021     [
1022     AC_MSG_CHECKING([for Tcl library])
1023    
1024     # Attempt autodetect for $TCLLIBFN if it's not set
1025     if test "x$TCLLIBFN" != x; then
1026     AC_MSG_RESULT([using ${TCLLIB}/lib${TCLLIBFN}])
1027     else
1028     for tcllibfns in $tcllibnames; do
1029     for tcllibext in $tcllibextensions; do
1030     for tcllibpath in $tcllibpaths; do
1031     if test -r "${tcllibpath}/lib${tcllibfns}${tcllibext}"; then
1032     AC_MSG_RESULT([found ${tcllibpath}/lib${tcllibfns}${tcllibext}])
1033     TCLLIB="$tcllibpath"
1034     TCLLIBFN="${tcllibfns}${tcllibext}"
1035     TCLLIBEXT="$tcllibext"
1036     TCLLIBFNS="$tcllibfns"
1037     break 3
1038     fi
1039     done
1040     done
1041     done
1042     fi
1043    
1044     # Show if $TCLLIBFN wasn't found
1045     if test "x$TCLLIBFN" = x; then
1046     AC_MSG_RESULT([not found])
1047     fi
1048    
1049     AC_SUBST(TCLLIB)
1050     AC_SUBST(TCLLIBFN)
1051     ])
1052    
1053    
1054     dnl EGG_TCL_CHECK_HEADER()
1055     dnl
1056     AC_DEFUN([EGG_TCL_CHECK_HEADER],
1057     [
1058     AC_MSG_CHECKING([for Tcl header])
1059    
1060     # Attempt autodetect for $TCLINCFN if it's not set
1061     if test "x$TCLINCFN" != x; then
1062     AC_MSG_RESULT([using ${TCLINC}/${TCLINCFN}])
1063     else
1064     for tclheaderpath in $tclheaderpaths; do
1065     for tclheaderfn in $tclheadernames; do
1066     if test -r "${tclheaderpath}/${tclheaderfn}"; then
1067     AC_MSG_RESULT([found ${tclheaderpath}/${tclheaderfn}])
1068     TCLINC="$tclheaderpath"
1069     TCLINCFN="$tclheaderfn"
1070     break 2
1071     fi
1072     done
1073     done
1074    
1075     # FreeBSD hack ...
1076     if test "x$TCLINCFN" = x; then
1077     for tcllibfns in $tcllibnames; do
1078     for tclheaderpath in $tclheaderpaths; do
1079     for tclheaderfn in $tclheadernames; do
1080     if test -r "${tclheaderpath}/${tcllibfns}/${tclheaderfn}"; then
1081     AC_MSG_RESULT([found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}])
1082     TCLINC="${tclheaderpath}/${tcllibfns}"
1083     TCLINCFN="$tclheaderfn"
1084     break 3
1085     fi
1086     done
1087     done
1088     done
1089     fi
1090     fi
1091    
1092     if test "x$TCLINCFN" = x; then
1093     AC_MSG_RESULT([not found])
1094     fi
1095    
1096     AC_SUBST(TCLINC)
1097     AC_SUBST(TCLINCFN)
1098     ])
1099    
1100    
1101     dnl EGG_CACHE_UNSET(CACHE-ID)
1102     dnl
1103     dnl Unsets a certain cache item. Typically called before using the AC_CACHE_*()
1104     dnl macros.
1105     dnl
1106     AC_DEFUN([EGG_CACHE_UNSET], [unset $1])
1107    
1108    
1109     dnl EGG_TCL_DETECT_CHANGE()
1110     dnl
1111     dnl Detect whether the Tcl system has changed since our last configure run.
1112     dnl Set egg_tcl_changed accordingly.
1113     dnl
1114     dnl Tcl related feature and version checks should re-run their checks as soon
1115     dnl as egg_tcl_changed is set to "yes".
1116     dnl
1117     AC_DEFUN([EGG_TCL_DETECT_CHANGE],
1118     [
1119     dnl NOTE: autoconf 2.50+ disables config.cache by default.
1120     dnl These checks don't do us much good if cache is disabled.
1121     AC_MSG_CHECKING([whether the Tcl system has changed])
1122     egg_tcl_changed="yes"
1123     egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
1124     if test "$egg_tcl_id" != ":::"; then
1125     egg_tcl_cached="yes"
1126     AC_CACHE_VAL(egg_cv_var_tcl_id, [
1127     egg_cv_var_tcl_id="$egg_tcl_id"
1128     egg_tcl_cached="no"
1129     ])
1130     if test "$egg_tcl_cached" = yes; then
1131     if test "x$egg_cv_var_tcl_id" = "x$egg_tcl_id"; then
1132     egg_tcl_changed="no"
1133     else
1134     egg_cv_var_tcl_id="$egg_tcl_id"
1135     fi
1136     fi
1137     fi
1138    
1139     if test "$egg_tcl_changed" = yes; then
1140     AC_MSG_RESULT([yes])
1141     else
1142     AC_MSG_RESULT([no])
1143     fi
1144     ])
1145    
1146    
1147     dnl EGG_TCL_CHECK_VERSION()
1148     dnl
1149     AC_DEFUN([EGG_TCL_CHECK_VERSION],
1150     [
1151     # Both TCLLIBFN & TCLINCFN must be set, or we bail
1152     TCL_FOUND=0
1153     if test "x$TCLLIBFN" != x && test "x$TCLINCFN" != x; then
1154     TCL_FOUND=1
1155    
1156     # Check Tcl's version
1157     if test "$egg_tcl_changed" = yes; then
1158     EGG_CACHE_UNSET(egg_cv_var_tcl_version)
1159     fi
1160    
1161     AC_MSG_CHECKING([for Tcl version])
1162     AC_CACHE_VAL(egg_cv_var_tcl_version, [
1163     egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
1164     ])
1165    
1166     if test "x$egg_cv_var_tcl_version" != x; then
1167     AC_MSG_RESULT([$egg_cv_var_tcl_version])
1168     else
1169     AC_MSG_RESULT([not found])
1170     TCL_FOUND=0
1171     fi
1172    
1173     # Check Tcl's patch level (if available)
1174     if test "$egg_tcl_changed" = yes; then
1175     EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
1176     fi
1177     AC_MSG_CHECKING([for Tcl patch level])
1178     AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [
1179     eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
1180     ])
1181    
1182     if test "x$egg_cv_var_tcl_patch_level" != x; then
1183     AC_MSG_RESULT([$egg_cv_var_tcl_patch_level])
1184     else
1185     egg_cv_var_tcl_patch_level="unknown"
1186     AC_MSG_RESULT([unknown])
1187     fi
1188     fi
1189    
1190     # Check if we found Tcl's version
1191     if test "$TCL_FOUND" = 0; then
1192     cat << 'EOF' >&2
1193     configure: error:
1194    
1195     Tcl cannot be found on this system.
1196    
1197 thommey 1.12.2.2 Eggdrop requires Tcl and the Tcl development files to compile.
1198     If you already have Tcl installed on this system, make sure you
1199     also have the development files (common package names include
1200     'tcl-dev' and 'tcl-devel'). If I just wasn't looking
1201     in the right place for it, re-run ./configure using the
1202     --with-tcllib='/path/to/libtcl.so' and
1203 simple 1.1 --with-tclinc='/path/to/tcl.h' options.
1204    
1205     See doc/COMPILE-GUIDE's 'Tcl Detection and Installation' section for more
1206     information.
1207    
1208     EOF
1209     exit 1
1210     fi
1211     ])
1212    
1213    
1214     dnl EGG_TCL_CHECK_PRE70()
1215     dnl
1216     AC_DEFUN([EGG_TCL_CHECK_PRE70],
1217     [
1218     # Is this version of Tcl too old for us to use ?
1219     TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
1220     if test "$TCL_VER_PRE70" = yes; then
1221     cat << EOF >&2
1222     configure: error:
1223    
1224     Your Tcl version is much too old for Eggdrop to use. You should
1225     download and compile a more recent version. The most reliable
1226     current version is $tclrecommendver and can be downloaded from
1227     ${tclrecommendsite}.
1228    
1229     See doc/COMPILE-GUIDE's 'Tcl Detection and Installation' section
1230     for more information.
1231    
1232     EOF
1233     exit 1
1234     fi
1235     ])
1236    
1237    
1238     dnl EGG_TCL_TESTLIBS()
1239     dnl
1240     AC_DEFUN([EGG_TCL_TESTLIBS],
1241     [
1242     # Set variables for Tcl library tests
1243     TCL_TEST_LIB="$TCLLIBFNS"
1244     TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
1245     if test "x$ac_cv_lib_pthread" != x; then
1246     TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
1247     fi
1248     ])
1249    
1250    
1251     dnl EGG_TCL_CHECK_FREE()
1252     dnl
1253     AC_DEFUN([EGG_TCL_CHECK_FREE],
1254     [
1255     if test "$egg_tcl_changed" = yes; then
1256     EGG_CACHE_UNSET(egg_cv_var_tcl_free)
1257     fi
1258    
1259     # Check for Tcl_Free()
1260     AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, [egg_cv_var_tcl_free="yes"], [egg_cv_var_tcl_free="no"], $TCL_TEST_OTHERLIBS)
1261    
1262     if test "$egg_cv_var_tcl_free" = yes; then
1263     AC_DEFINE(HAVE_TCL_FREE, 1, [Define for Tcl that has Tcl_Free() (7.5p1 and later).])
1264     fi
1265     ])
1266    
1267    
1268     dnl EGG_TCL_CHECK_GETCURRENTTHREAD
1269     dnl
1270     AC_DEFUN([EGG_TCL_CHECK_GETCURRENTTHREAD],
1271     [
1272     if test "$egg_tcl_changed" = yes; then
1273     EGG_CACHE_UNSET(egg_cv_var_tcl_getcurrentthread)
1274     fi
1275    
1276     # Check for Tcl_GetCurrentThread()
1277     AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetCurrentThread, [egg_cv_var_tcl_getcurrentthread="yes"], [egg_cv_var_tcl_getcurrentthread="no"], $TCL_TEST_OTHERLIBS)
1278     if test "$egg_cv_var_tcl_getcurrentthread" = yes; then
1279     AC_DEFINE(HAVE_TCL_GETCURRENTTHREAD, 1, [Define for Tcl that has Tcl_GetCurrentThread() (8.1a2 and later).])
1280    
1281     # Add pthread library to $LIBS if we need it for threaded Tcl
1282     if test "x$ac_cv_lib_pthread" != x; then
1283     EGG_APPEND_VAR(LIBS, $ac_cv_lib_pthread)
1284     fi
1285     fi
1286     ])
1287    
1288    
1289     dnl EGG_TCL_CHECK_GETTHREADDATA
1290     dnl
1291     AC_DEFUN([EGG_TCL_CHECK_GETTHREADDATA],
1292     [
1293     if test "$egg_tcl_changed" = yes; then
1294     EGG_CACHE_UNSET(egg_cv_var_tcl_getthreaddata)
1295     fi
1296    
1297     # Check for Tcl_GetThreadData()
1298     AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetThreadData, [egg_cv_var_tcl_getthreaddata="yes"], [egg_cv_var_tcl_getthreaddata="no"], $TCL_TEST_OTHERLIBS)
1299     if test "$egg_cv_var_tcl_getthreaddata" = yes; then
1300     AC_DEFINE(HAVE_TCL_GETTHREADDATA, 1, [Define for Tcl that has Tcl_GetThreadData() (8.1a2 and later).])
1301     fi
1302     ])
1303    
1304    
1305     dnl EGG_TCL_CHECK_SETNOTIFIER
1306     dnl
1307     AC_DEFUN([EGG_TCL_CHECK_SETNOTIFIER],
1308     [
1309     if test "$egg_tcl_changed" = yes; then
1310     EGG_CACHE_UNSET(egg_cv_var_tcl_setnotifier)
1311     fi
1312    
1313     # Check for Tcl_SetNotifier()
1314     AC_CHECK_LIB($TCL_TEST_LIB, Tcl_SetNotifier, [egg_cv_var_tcl_setnotifier="yes"], [egg_cv_var_tcl_setnotifier="no"], $TCL_TEST_OTHERLIBS)
1315     if test "$egg_cv_var_tcl_setnotifier" = yes; then
1316     AC_DEFINE(HAVE_TCL_SETNOTIFIER, 1, [Define for Tcl that has Tcl_SetNotifier() (8.2b1 and later).])
1317     fi
1318     ])
1319    
1320 thommey 1.4 dnl EGG_TCL_CHECK_NOTIFIER_INIT
1321     dnl
1322     AC_DEFUN([EGG_TCL_CHECK_NOTIFIER_INIT],
1323     [
1324     if test "$egg_tcl_changed" = yes; then
1325     EGG_CACHE_UNSET(egg_cv_var_tcl_notifier_init)
1326     fi
1327    
1328     # Check for Tcl_NotifierProcs member initNotifierProc
1329     AC_CHECK_MEMBER([Tcl_NotifierProcs.initNotifierProc], [egg_cv_var_tcl_notifier_init="yes"], [egg_cv_var_tcl_notifier_init="no"], [[#include "$TCLINC/$TCLINCFN"]])
1330     if test "$egg_cv_var_tcl_notifier_init" = yes; then
1331     AC_DEFINE(HAVE_TCL_NOTIFIER_INIT, 1, [Define for Tcl that has the Tcl_NotiferProcs struct member initNotifierProc (8.4 and later).])
1332     fi
1333     ])
1334    
1335 simple 1.1
1336     dnl EGG_TCL_LIB_REQS()
1337     dnl
1338     AC_DEFUN([EGG_TCL_LIB_REQS],
1339     [
1340     if test "$EGG_CYGWIN" = yes; then
1341     TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
1342     TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1343     else
1344     if test "$TCLLIBEXT" != ".a"; then
1345     TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
1346     TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1347     else
1348     # Set default make as static for unshared Tcl library
1349     if test "$DEFAULT_MAKE" != static; then
1350     cat << 'EOF' >&2
1351     configure: WARNING:
1352    
1353     Your Tcl library is not a shared lib.
1354     configure will now set default make type to static.
1355    
1356     EOF
1357     DEFAULT_MAKE="static"
1358     AC_SUBST(DEFAULT_MAKE)
1359     fi
1360    
1361     # Are we using a pre 7.4 Tcl version ?
1362     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"}'`
1363     if test "$TCL_VER_PRE74" = no; then
1364    
1365     # Was the --with-tcllib option given ?
1366     if test "x$tcllibname" != x; then
1367     TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
1368     TCL_LIBS="${TCLLIB}/lib${TCLLIBFN} $EGG_MATH_LIB"
1369     else
1370     TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
1371     TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1372     fi
1373     else
1374     cat << EOF >&2
1375     configure: WARNING:
1376    
1377     Your Tcl version ($egg_cv_var_tcl_version) is older than 7.4.
1378     There are known problems, but we will attempt to work around them.
1379    
1380     EOF
1381     TCL_REQS="libtcle.a"
1382     TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1383     fi
1384     fi
1385     fi
1386    
1387     AC_SUBST(TCL_REQS)
1388     AC_SUBST(TCL_LIBS)
1389     ])
1390    
1391    
1392     dnl EGG_SUBST_EGGVERSION()
1393     dnl
1394     AC_DEFUN([EGG_SUBST_EGGVERSION],
1395     [
1396 pseudo 1.12.2.1 egg_version_num=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
1397     AC_SUBST(EGGVERSION, $PACKAGE_VERSION)
1398 simple 1.1 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num, [Defines the current Eggdrop version.])
1399     ])
1400    
1401    
1402     dnl EGG_SUBST_DEST()
1403     AC_DEFUN([EGG_SUBST_DEST],
1404     [
1405     if test "x$DEST" = x; then
1406     DEST=\${prefix}
1407     fi
1408     AC_SUBST(DEST)
1409     ])
1410    
1411    
1412     dnl EGG_SUBST_MOD_UPDIR()
1413     dnl
1414     dnl Since module's Makefiles aren't generated by configure, some paths in
1415     dnl src/mod/Makefile.in take care of them. For correct path "calculation", we
1416     dnl need to keep absolute paths in mind (which don't need a "../" prepended).
1417     dnl
1418     AC_DEFUN([EGG_SUBST_MOD_UPDIR], [
1419     case "$srcdir" in
1420     [[\\/]]* | ?:[[\\/]]*)
1421     MOD_UPDIR=""
1422     ;;
1423     *)
1424     MOD_UPDIR="../"
1425     ;;
1426     esac
1427     AC_SUBST(MOD_UPDIR)
1428     ])
1429    
1430    
1431     dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1432     dnl
1433     dnl Replace FILE-NAME if the newly created contents differs from the existing
1434     dnl file contents. Otherwise, leave the file alone. This avoids needless
1435     dnl recompiles.
1436     dnl
1437     m4_define(EGG_REPLACE_IF_CHANGED,
1438     [
1439     AC_CONFIG_COMMANDS([replace-if-changed], [[
1440     egg_replace_file="$1"
1441     $2
1442     if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file; then
1443     echo "$1 is unchanged"
1444     else
1445     echo "creating $1"
1446     mv conftest.out $egg_replace_file
1447     fi
1448     rm -f conftest.out
1449     ]],
1450     [[$3]])
1451     ])
1452    
1453    
1454     dnl EGG_TCL_LUSH()
1455     dnl
1456     AC_DEFUN([EGG_TCL_LUSH],
1457     [
1458     EGG_REPLACE_IF_CHANGED(lush.h, [
1459     cat > conftest.out << EOF
1460    
1461     /* Ignore me but do not erase me. I am a kludge. */
1462    
1463     #include "${egg_tclinc}/${egg_tclincfn}"
1464    
1465     EOF
1466     ], [
1467     egg_tclinc="$TCLINC"
1468     egg_tclincfn="$TCLINCFN"
1469     ])
1470     ])
1471    
1472    
1473     dnl EGG_DEBUG_ENABLE()
1474     dnl
1475     AC_DEFUN([EGG_DEBUG_ENABLE],
1476     [
1477 pseudo 1.12.2.1 AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable generic debug code (default for 'make debug')]), [enable_debug="$enableval"], [enable_debug="auto"])
1478     AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug], [disable generic debug code]), [enable_debug="$enableval"], [enable_debug="auto"])
1479     AC_ARG_ENABLE(debug-assert, AS_HELP_STRING([--enable-debug-assert], [enable assert debug code (default for 'make debug')]), [enable_debug_assert="$enableval"], [enable_debug_assert="auto"])
1480     AC_ARG_ENABLE(debug-assert, AS_HELP_STRING([--disable-debug-assert], [disable assert debug code]), [enable_debug_assert="$enableval"], [enable_debug_assert="auto"])
1481     AC_ARG_ENABLE(debug-mem, AS_HELP_STRING([--enable-debug-mem], [enable memory debug code (default for 'make debug')]), [enable_debug_mem="$enableval"], [enable_debug_mem="auto"])
1482     AC_ARG_ENABLE(debug-mem, AS_HELP_STRING([--disable-debug-mem], [disable memory debug code]), [enable_debug_mem="$enableval"], [enable_debug_mem="auto"])
1483     AC_ARG_ENABLE(debug-dns, AS_HELP_STRING([--enable-debug-dns], [enable dns.mod debug messages (default for 'make debug')]), [enable_debug_dns="$enableval"], [enable_debug_dns="auto"])
1484     AC_ARG_ENABLE(debug-dns, AS_HELP_STRING([--disable-debug-dns], [disable dns.mod debug messages]), [enable_debug_dns="$enableval"], [enable_debug_dns="auto"])
1485     AC_ARG_ENABLE(debug-context, AS_HELP_STRING([--enable-debug-context], [enable context debug code (default)]), [enable_debug_context="$enableval"], [enable_debug_context="auto"])
1486     AC_ARG_ENABLE(debug-context, AS_HELP_STRING([--disable-debug-context], [disable context debug code]), [enable_debug_context="$enableval"], [enable_debug_context="auto"])
1487 simple 1.1 ])
1488    
1489    
1490     dnl EGG_DEBUG_DEFAULTS()
1491     dnl
1492     AC_DEFUN([EGG_DEBUG_DEFAULTS],
1493     [
1494     # Defaults:
1495    
1496     # make: 'eggdrop' or 'static'
1497     default_std_debug="no"
1498     default_std_debug_assert="no"
1499     default_std_debug_mem="no"
1500     default_std_debug_context="yes"
1501     default_std_debug_dns="no"
1502    
1503     # make: 'debug' or 'sdebug'
1504     default_deb_debug="yes"
1505     default_deb_debug_assert="yes"
1506     default_deb_debug_mem="yes"
1507     default_deb_debug_context="yes"
1508     default_deb_debug_dns="yes"
1509    
1510     if test "$DEFAULT_MAKE" = eggdrop || test "$DEFAULT_MAKE" = static; then
1511     default_debug="$default_std_debug"
1512     default_debug_assert="$default_std_debug_assert"
1513     default_debug_mem="$default_std_debug_mem"
1514     default_debug_context="$default_std_debug_context"
1515     default_debug_dns="$default_std_debug_dns"
1516     else
1517     default_debug="$default_deb_debug"
1518     default_debug_assert="$default_deb_debug_assert"
1519     default_debug_mem="$default_deb_debug_mem"
1520     default_debug_context="$default_deb_debug_context"
1521     default_debug_dns="$default_deb_debug_dns"
1522     fi
1523    
1524     debug_options="debug debug_assert debug_mem debug_dns"
1525    
1526     debug_cflags_debug="-g3 -DDEBUG"
1527     debug_cflags_debug_assert="-DDEBUG_ASSERT"
1528     debug_cflags_debug_mem="-DDEBUG_MEM"
1529     debug_cflags_debug_dns="-DDEBUG_DNS"
1530     debug_stdcflags_debug=""
1531     debug_stdcflags_debug_assert=""
1532     debug_stdcflags_debug_mem=""
1533     debug_stdcflags_debug_dns=""
1534     debug_debcflags_debug=""
1535     debug_debcflags_debug_assert=""
1536     debug_debcflags_debug_mem=""
1537     debug_debcflags_debug_dns=""
1538     ])
1539    
1540    
1541     dnl EGG_DEBUG_OPTIONS()
1542     dnl
1543     AC_DEFUN([EGG_DEBUG_OPTIONS],
1544     [
1545     for enable_option in $debug_options; do
1546    
1547     eval enable_value=\$enable_$enable_option
1548    
1549     # Check if either --enable-<opt> or --disable-<opt> was used
1550     if test "$enable_value" != auto; then
1551     # Make sure an invalid option wasn't passed as --enable-<opt>=foo
1552     if test "$enable_value" != yes && test "$enable_value" != no; then
1553     opt_name=`echo $enable_option | sed 's/_/-/g'`
1554     eval opt_default=\$default_$enable_option
1555     AC_MSG_WARN([Invalid option '$enable_value' passed to --enable-${opt_name}, defaulting to '$opt_default'])
1556     eval enable_$enable_option="auto"
1557     fi
1558     fi
1559    
1560     if test "$enable_value" = auto; then
1561     # Note: options generally should not end up in both std and deb but
1562     # there may be options in the future where this behavior is desired.
1563     if test `eval echo '${'default_std_$enable_option'}'` = yes; then
1564     eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
1565     fi
1566     if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
1567     eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
1568     fi
1569     else
1570     if test "$enable_value" = yes; then
1571     # If option defaults to 'yes' for debug, always put it in stdcflags
1572     # when the option is forced on because someone may want it enabled
1573     # for a non-debug build.
1574     if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
1575     eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
1576     else
1577     # option defaulted to 'no' so put it in debcflags
1578     eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
1579     fi
1580     fi
1581     fi
1582     done
1583     ])
1584    
1585    
1586     dnl EGG_DEBUG_CFLAGS()
1587     dnl
1588     AC_DEFUN([EGG_DEBUG_CFLAGS],
1589     [
1590     for cflg_option in $debug_options; do
1591     eval stdcflg_value=\$debug_stdcflags_$cflg_option
1592     EGG_APPEND_VAR(CFLGS, $stdcflg_value)
1593    
1594     eval debcflg_value=\$debug_debcflags_$cflg_option
1595     EGG_APPEND_VAR(DEBCFLGS, $debcflg_value)
1596     done
1597    
1598     # Disable debug symbol stripping if compiled with --enable-debug
1599     # This will result in core dumps that are actually useful.
1600     if test "x$debug_stdcflags_debug" != x; then
1601     STRIP="touch"
1602     MOD_STRIP="touch"
1603     SHLIB_STRIP="touch"
1604     fi
1605    
1606     AC_SUBST(CFLGS)
1607     AC_SUBST(DEBCFLGS)
1608     ])
1609    
1610    
1611     dnl EGG_ENABLE_DEBUG_CONTEXT()
1612     dnl
1613     AC_DEFUN([EGG_ENABLE_DEBUG_CONTEXT],
1614     [
1615     # Check if either --enable-debug-context or --disable-debug-context was used
1616     if test "$enable_debug_context" != auto; then
1617    
1618     # Make sure an invalid option wasn't passed as --enable-debug-context=foo
1619     if test "$enable_debug_context" != yes && test "$enable_debug_context" != no; then
1620     AC_MSG_WARN([Invalid option '$enable_debug_context' passed to --enable-debug-context, defaulting to '$default_debug_context'])
1621     enable_debug_context="$default_debug_context"
1622     fi
1623     else
1624     enable_debug_context="$default_debug_context"
1625     fi
1626    
1627     if test "$enable_debug_context" = yes; then
1628     AC_DEFINE(DEBUG_CONTEXT, 1, [Define for context debugging.])
1629     else
1630     cat << 'EOF' >&2
1631     configure: WARNING:
1632    
1633     You have disabled context debugging.
1634    
1635     Eggdrop will not be able to provide context information if it crashes.
1636     Bug reports without context are less helpful when tracking down bugs.
1637    
1638     EOF
1639     fi
1640     ])
1641    
1642    
1643     dnl EGG_CATCH_MAKEFILE_REBUILD()
1644     dnl
1645     AC_DEFUN([EGG_CATCH_MAKEFILE_REBUILD],
1646     [
1647     AC_CONFIG_COMMANDS([catch-make-rebuild], [[
1648     if test -f .modules; then
1649     $srcdir/misc/modconfig --top_srcdir="$srcdir/src" Makefile
1650     fi
1651     ]])
1652     ])
1653    
1654    
1655     dnl EGG_SAVE_PARAMETERS()
1656     dnl
1657     dnl Remove --cache-file and --srcdir arguments so they do not pile up.
1658     dnl
1659     AC_DEFUN([EGG_SAVE_PARAMETERS],
1660     [
1661     egg_ac_parameters=
1662     ac_prev=
1663     for ac_arg in $ac_configure_args; do
1664     if test -n "$ac_prev"; then
1665     ac_prev=
1666     continue
1667     fi
1668     case $ac_arg in
1669     -cache-file | --cache-file | --cache-fil | --cache-fi | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1670     ac_prev=cache_file ;;
1671     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1672     ;;
1673     --config-cache | -C)
1674     ;;
1675     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1676     ac_prev=srcdir ;;
1677     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1678     ;;
1679     *) egg_ac_parameters="$egg_ac_parameters $ac_arg" ;;
1680     esac
1681     done
1682    
1683     AC_SUBST(egg_ac_parameters)
1684 pseudo 1.6 AC_DEFINE_UNQUOTED(EGG_AC_ARGS, "$egg_ac_parameters", [Arguments passed to configure])
1685 simple 1.1 ])
1686    
1687    
1688 pseudo 1.3 dnl EGG_IPV6_COMPAT
1689     dnl
1690     AC_DEFUN([EGG_IPV6_COMPAT],
1691     [
1692     if test "$enable_ipv6" = "yes"; then
1693     AC_CHECK_FUNCS([inet_pton gethostbyname2])
1694 pseudo 1.5 AC_CHECK_TYPES([struct in6_addr], egg_cv_var_have_in6_addr="yes", egg_cv_var_have_in6_addr="no", [
1695     #include <sys/types.h>
1696     #include <netinet/in.h>
1697     ])
1698 pseudo 1.3 if test "$egg_cv_var_have_in6_addr" = "yes"; then
1699     # Check for in6addr_any
1700     AC_CACHE_CHECK([for the in6addr_any constant], [egg_cv_var_have_in6addr_any], [
1701 pseudo 1.5 AC_TRY_COMPILE([
1702     #include <sys/types.h>
1703     #include <netinet/in.h>
1704     ], [struct in6_addr i6 = in6addr_any;],
1705     [egg_cv_var_have_in6addr_any="yes"], [egg_cv_var_have_in6addr_any="no"])
1706 pseudo 1.3 ])
1707     if test "$egg_cv_var_have_in6addr_any" = "yes"; then
1708     AC_DEFINE(HAVE_IN6ADDR_ANY, 1, [Define to 1 if you have the in6addr_any constant.])
1709     fi
1710     # Check for in6addr_loopback
1711     AC_CACHE_CHECK([for the in6addr_loopback constant], [egg_cv_var_have_in6addr_loopback], [
1712 pseudo 1.5 AC_TRY_COMPILE([
1713     #include <sys/types.h>
1714     #include <netinet/in.h>
1715     ], [struct in6_addr i6 = in6addr_loopback;],
1716     [egg_cv_var_have_in6addr_loopback="yes"], [egg_cv_var_have_in6addr_loopback="no"])
1717 pseudo 1.3 ])
1718     if test "$egg_cv_var_have_in6addr_loopback" = "yes"; then
1719     AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1, [Define to 1 if you have the in6addr_loopback constant.])
1720     fi
1721 pseudo 1.5 AC_CHECK_TYPES([struct sockaddr_in6], , , [
1722     #include <sys/types.h>
1723     #include <netinet/in.h>
1724     ])
1725 pseudo 1.3 else
1726     AC_MSG_NOTICE([no in6_addr found, skipping dependent checks. Custom definitions will be used.])
1727     fi
1728     fi
1729     ])
1730    
1731    
1732     dnl EGG_IPV6_ENABLE
1733     dnl
1734     AC_DEFUN([EGG_IPV6_ENABLE],
1735     [
1736     AC_ARG_ENABLE(ipv6,
1737 pseudo 1.12.2.1 AS_HELP_STRING([--enable-ipv6], [enable IPv6 support (autodetect)]),
1738 pseudo 1.3 [enable_ipv6="$enableval"], [enable_ipv6="$egg_cv_var_ipv6_supported"])
1739     AC_ARG_ENABLE(ipv6,
1740 pseudo 1.12.2.1 AS_HELP_STRING([--disable-ipv6], [disable IPv6 support]), [enable_ipv6="$enableval"])
1741 pseudo 1.3
1742     if test "$enable_ipv6" = "yes"; then
1743     if test "$egg_cv_var_ipv6_supported" = "no"; then
1744     AC_MSG_WARN([You have enabled IPv6 but your system doesn't seem to support it.])
1745     AC_MSG_WARN([Eggdrop will compile but will be limited to IPv4 on this host.])
1746     fi
1747     AC_DEFINE(IPV6, 1, [Define to 1 if you want to enable IPv6 support.])
1748     fi
1749     ])
1750    
1751    
1752     dnl EGG_IPV6_STATUS
1753     dnl
1754     AC_DEFUN([EGG_IPV6_STATUS],
1755     [
1756     AC_CACHE_CHECK([for system IPv6 support], [egg_cv_var_ipv6_supported], [
1757     AC_RUN_IFELSE([[
1758     #include <unistd.h>
1759     #include <sys/socket.h>
1760     #include <netinet/in.h>
1761    
1762     int main()
1763     {
1764     int s = socket(AF_INET6, SOCK_STREAM, 0);
1765    
1766     if (s != -1)
1767     close(s);
1768    
1769     return((s == -1));
1770     }
1771     ]], [
1772     egg_cv_var_ipv6_supported="yes"
1773     ], [
1774     egg_cv_var_ipv6_supported="no"
1775     ])
1776     ])
1777     ])
1778 pseudo 1.8
1779    
1780     dnl EGG_TLS_ENABLE
1781     dnl
1782     AC_DEFUN([EGG_TLS_ENABLE],
1783     [
1784     AC_MSG_CHECKING([whether to enable TLS support])
1785     AC_ARG_ENABLE(tls,
1786 pseudo 1.12.2.1 AS_HELP_STRING([--enable-tls], [enable TLS support (autodetect)]),
1787 pseudo 1.8 [enable_tls="$enableval"])
1788     AC_ARG_ENABLE(tls,
1789 pseudo 1.12.2.1 AS_HELP_STRING([--disable-tls], [disable TLS support]), [enable_tls="$enableval"],
1790 pseudo 1.8 [enable_tls="autodetect"])
1791    
1792     AC_MSG_RESULT([$enable_tls])
1793     ])
1794    
1795    
1796     dnl EGG_TLS_WITHSSL
1797     dnl
1798     AC_DEFUN(EGG_TLS_WITHSSL,
1799     [
1800     save_LIBS="$LIBS"
1801 pseudo 1.12.2.1 AC_ARG_WITH(sslinc, AS_HELP_STRING([--with-sslinc=PATH], [Path to OpenSSL headers]), [
1802 pseudo 1.8 if test "$enable_tls" != "no"; then
1803     if test -d "$withval"; then
1804     save_CC="$CC"
1805     save_CPP="$CPP"
1806     CC="$CC -I$withval"
1807     CPP="$CPP -I$withval"
1808     AC_CHECK_HEADERS([openssl/ssl.h openssl/x509v3.h], [sslinc="-I$withval"], [
1809     AC_MSG_WARN([Invalid path to OpenSSL headers. $withval/openssl/ doesn't contain the required files.])
1810     sslinc=""
1811     break
1812     ], [[
1813     #ifdef CYGWIN_HACKS
1814     # ifndef __int64
1815     # define __int64 long long
1816     # endif
1817     #endif
1818     ]])
1819     AC_SUBST(SSL_INCLUDES, [$sslinc])
1820     CC="$save_CC"
1821     CPP="$save_CPP"
1822     else
1823     AC_MSG_WARN([Invalid path to OpenSSL headers. $withval is not a directory.])
1824     fi
1825     fi
1826     ])
1827    
1828 pseudo 1.12.2.1 AC_ARG_WITH(ssllib, AS_HELP_STRING([--with-ssllib=PATH], [Path to OpenSSL libraries]),
1829 pseudo 1.8 [
1830     if test "$enable_tls" != "no"; then
1831     if test -d "$withval"; then
1832 pseudo 1.11 AC_CHECK_LIB(ssl, SSL_accept, , [havessllib="no"], [-L$withval -lcrypto])
1833     AC_CHECK_LIB(crypto, X509_digest, , [havessllib="no"], [-L$withval -lssl])
1834 pseudo 1.8 if test "$havessllib" = "no"; then
1835     AC_MSG_WARN([Invalid path to OpenSSL libs. $withval doesn't contain the required files.])
1836     else
1837     AC_SUBST(SSL_LIBS, [-L$withval])
1838     fi
1839     else
1840     AC_MSG_WARN([You have specified an invalid path to OpenSSL libs. $withval is not a directory.])
1841     fi
1842     fi
1843     ])
1844     ])
1845    
1846    
1847     dnl EGG_TLS_DETECT
1848     dnl
1849     AC_DEFUN([EGG_TLS_DETECT],
1850     [
1851     if test "$enable_tls" != "no"; then
1852     if test -z "$SSL_INCLUDES"; then
1853     AC_CHECK_HEADERS([openssl/ssl.h openssl/x509v3.h], , [havesslinc="no"], [
1854     #ifdef CYGWIN_HACKS
1855     # ifndef __int64
1856     # define __int64 long long
1857     # endif
1858     #endif
1859     ])
1860     fi
1861     if test -z "$SSL_LIBS"; then
1862     AC_CHECK_LIB(ssl, SSL_accept, , [havessllib="no"], [-lcrypto])
1863     AC_CHECK_LIB(crypto, X509_digest, , [havessllib="no"], [-lssl])
1864 pseudo 1.9 AC_CHECK_FUNCS([EVP_md5 EVP_sha1 a2i_IPADDRESS hex_to_string string_to_hex], , [[
1865 pseudo 1.8 havessllib="no"
1866     break
1867     ]])
1868     fi
1869     if test "$enable_tls" = "yes"; then
1870     if test "$havesslinc" = "no"; then
1871     AC_MSG_WARN([Cannot find OpenSSL headers.])
1872     AC_MSG_WARN([Please specify the path to the openssl include dir using --with-sslinc=path])
1873     fi
1874     if test "$havessllib" = "no"; then
1875     AC_MSG_WARN([Cannot find OpenSSL libraries.])
1876     AC_MSG_WARN([Please specify the path to libssl and libcrypto using --with-ssllib=path])
1877     fi
1878     fi
1879     AC_MSG_CHECKING([for OpenSSL])
1880     if test "$havesslinc" = "no" || test "$havessllib" = "no"; then
1881 pseudo 1.10 AC_MSG_RESULT([no (make sure you have version 0.9.8 or higher installed)])
1882 pseudo 1.8 LIBS="$save_LIBS"
1883     else
1884     AC_MSG_RESULT([yes])
1885     if test "$EGG_CYGWIN" = "yes"; then
1886     AC_CHECK_TYPE([__int64], , [
1887     AC_DEFINE([__int64], [long long], [Define this to a 64-bit type on Cygwin to satisfy OpenSSL dependencies.])
1888     ])
1889     fi
1890 pseudo 1.9 AC_CHECK_FUNCS([RAND_status])
1891 pseudo 1.8 AC_DEFINE(TLS, 1, [Define this to enable SSL support.])
1892     EGG_MD5_COMPAT
1893     fi
1894     fi
1895     ])
1896    
1897    
1898     dnl EGG_MD5_COMPAT
1899     dnl
1900     AC_DEFUN([EGG_MD5_COMPAT],
1901     [
1902     save_CC="$CC"
1903     save_CPP="$CPP"
1904     CC="$CC $sslinc"
1905     CPP="$CPP $sslinc"
1906     AC_CHECK_HEADERS([openssl/md5.h], [
1907     AC_CHECK_FUNCS([MD5_Init MD5_Update MD5_Final], , [havesslmd5="no"])
1908     ])
1909     if test "$havesslmd5" != "no"; then
1910     AC_DEFINE(HAVE_OPENSSL_MD5, 1, [Define this if your OpenSSL library has MD5 cipher support.])
1911     fi
1912     CC="$save_CC"
1913     CPP="$save_CPP"
1914     ])

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23