Move the libethereal version to 0.8.15, and use the C preprocessor
[obnox/wireshark/wip.git] / epan / configure.in
1 # $Id: configure.in,v 1.3 2001/01/12 04:18:49 gram Exp $
2 dnl
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
6 dnl
7 dnl     SHELL = @SHELL@
8 dnl
9 dnl which requires it to be defined - and there may be other problems
10 dnl with pre-2.13 "autoconf" as well.
11 dnl
12 AC_INIT(epan.c)
13
14 AC_PREREQ(2.13)
15
16 AM_INIT_AUTOMAKE(libethereal.a, 0.8.15)
17 AM_CONFIG_HEADER(config.h)
18
19 dnl Checks for programs.
20 AC_PROG_CC
21 AC_PROG_CPP
22 AC_PROG_YACC
23 AM_PROG_LEX
24 AC_PROG_RANLIB
25 AC_PATH_PROG(LEX, flex)
26
27 AC_SUBST(FLEX_PATH)
28
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"
33   AC_MSG_RESULT(yes)
34 else
35   AC_MSG_RESULT(no)
36 fi
37
38 #
39 # Add any platform-specific compiler flags needed.
40 #
41 AC_MSG_CHECKING(for platform-specific compiler flags)
42 if test "x$GCC" = x
43 then
44         #
45         # Not GCC - assume it's the vendor's compiler.
46         #
47         case "$host_os" in
48         hpux*)
49                 #
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"?
53                 #
54                 CFLAGS="-Ae +O2 $CFLAGS"
55                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
56                 ;;
57         *)
58                 AC_MSG_RESULT(none needed)
59                 ;;
60         esac
61 else
62         AC_MSG_RESULT(none needed)
63 fi
64
65 # Create DATAFILE_DIR #define for config.h
66 DATAFILE_DIR=$sysconfdir
67 DATAFILE_DIR=`(
68     test "x$prefix" = xNONE && prefix=$ac_default_prefix
69     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
70     eval echo "$DATAFILE_DIR"
71 )`
72 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
73 AC_SUBST(DATAFILE_DIR)
74
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")
77
78 dnl Checks for header files
79 AC_HEADER_STDC
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)
85
86 #
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.
90 #
91 if test "$ac_cv_header_dlfcn_h" = yes ; then
92   AC_DEFINE(HAVE_PLUGINS)
93 fi
94
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)
101 fi
102 AC_SUBST(INET_ATON_C)
103 AC_SUBST(INET_ATON_O)
104
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>
112 int main()
113 {
114 #ifdef AF_INET6
115   char buf[16];
116   /* this should return 0 (error) */
117   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
118 #else
119   return 1;
120 #endif
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])],
125 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"
129 else
130   INET_PTON_C=""
131   INET_PTON_O=""
132 fi
133 AC_SUBST(INET_PTON_C)
134 AC_SUBST(INET_PTON_O)
135
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)
142 fi
143 AC_SUBST(INET_NTOP_C)
144 AC_SUBST(INET_NTOP_O)
145
146 AC_OUTPUT(Makefile)