1 # $Id: configure.in,v 1.3 2001/01/12 04:18:49 gram Exp $
3 dnl Process this file with autoconf 2.13 or later to produce a
4 dnl configure script; 2.12 doesn't generate a "configure" script that
5 dnl defines SHELL, and "Makefile.in" has
9 dnl which requires it to be defined - and there may be other problems
10 dnl with pre-2.13 "autoconf" as well.
16 AM_INIT_AUTOMAKE(libethereal.a, 0.8.15)
17 AM_CONFIG_HEADER(config.h)
19 dnl Checks for programs.
25 AC_PATH_PROG(LEX, flex)
29 # If we're running gcc, add '-Wall' to CFLAGS.
30 AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
31 if test x$GCC != x ; then
32 CFLAGS="-Wall $CFLAGS"
39 # Add any platform-specific compiler flags needed.
41 AC_MSG_CHECKING(for platform-specific compiler flags)
45 # Not GCC - assume it's the vendor's compiler.
50 # HP's ANSI C compiler; flags suggested by Jost Martin.
51 # "-Ae" for ANSI C plus extensions such as "long long".
52 # "+O2", for optimization. XXX - works with "-g"?
54 CFLAGS="-Ae +O2 $CFLAGS"
55 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
58 AC_MSG_RESULT(none needed)
62 AC_MSG_RESULT(none needed)
65 # Create DATAFILE_DIR #define for config.h
66 DATAFILE_DIR=$sysconfdir
68 test "x$prefix" = xNONE && prefix=$ac_default_prefix
69 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
70 eval echo "$DATAFILE_DIR"
72 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
73 AC_SUBST(DATAFILE_DIR)
75 # Checks for glib first, or gtk+ if not present
76 AM_PATH_GLIB(1.1.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS")
78 dnl Checks for header files
80 AC_CHECK_HEADERS(stdarg.h direct.h dirent.h fcntl.h netdb.h unistd.h)
81 AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/stat.h sys/time.h sys/types.h)
82 AC_CHECK_HEADERS(netinet/in.h)
83 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
84 AC_CHECK_HEADERS(dlfcn.h)
87 # XXX - we should also somehow arrange to support dynamic linking on
88 # HP-UX, even though it hasn't yet, apparently, implemented the
89 # UNIX standard "dlopen()" interface atop its own interface.
91 if test "$ac_cv_header_dlfcn_h" = yes ; then
92 AC_DEFINE(HAVE_PLUGINS)
95 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
96 INET_ATON_O="inet_aton.o")
97 if test "$ac_cv_func_inet_aton" = no ; then
98 INET_ATON_C="inet_aton.c"
99 INET_ATON_O="inet_aton.o"
100 AC_DEFINE(NEED_INET_ATON_H)
102 AC_SUBST(INET_ATON_C)
103 AC_SUBST(INET_ATON_O)
105 AC_CHECK_FUNC(inet_pton, [
106 dnl check for pre-BIND82 inet_pton() bug.
107 AC_MSG_CHECKING(for broken inet_pton)
108 AC_TRY_RUN([#include <sys/types.h>
109 #include <sys/socket.h>
110 #include <netinet/in.h>
111 #include <arpa/inet.h>
116 /* this should return 0 (error) */
117 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
121 }], [AC_MSG_RESULT(ok);
122 have_inet_pton=yes], [AC_MSG_RESULT(broken);
123 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
124 have_inet_pton=no])],
126 if test "$have_inet_pton" = no; then
127 INET_PTON_C="inet_pton.c"
128 INET_PTON_O="inet_pton.o"
133 AC_SUBST(INET_PTON_C)
134 AC_SUBST(INET_PTON_O)
136 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
137 INET_NTOP_O="inet_ntop.o")
138 if test "$ac_cv_func_inet_ntop" = no ; then
139 INET_NTOP_C="inet_ntop.c"
140 INET_NTOP_O="inet_ntop.o"
141 AC_DEFINE(NEED_INET_V6DEFS_H)
143 AC_SUBST(INET_NTOP_C)
144 AC_SUBST(INET_NTOP_O)