1 # Process this file with autoconf to produce a configure script.
3 # Require autoconf 2.12
9 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
15 SOUP_VERSION=$SOUP_MAJOR_VERSION.$SOUP_MINOR_VERSION.$SOUP_MICRO_VERSION
20 LT_RELEASE=$SOUP_VERSION
21 LT_CURRENT=$SOUP_INTERFACE_AGE
22 LT_REVISION=$SOUP_BINARY_AGE
23 LT_AGE=`expr $SOUP_BINARY_AGE - $SOUP_INTERFACE_AGE`
25 AC_SUBST(SOUP_MAJOR_VERSION)
26 AC_SUBST(SOUP_MINOR_VERSION)
27 AC_SUBST(SOUP_MICRO_VERSION)
28 AC_SUBST(SOUP_VERSION)
34 # Specify a configuration file
35 AM_CONFIG_HEADER(config.h)
38 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
40 # Initialize maintainer mode
44 # ****************************************
47 # Figure out debugging default, prior to $ac_help setup
48 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
49 if test `expr $SOUP_MINOR_VERSION \% 2` = 1 ; then
56 # Declare --enable-* args and collect ac_help strings
57 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
60 AC_MSG_CHECKING(for --enable-debug)
61 if test "x$enable_debug" = "xyes"; then
62 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
63 SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
66 if test "x$enable_debug" = "xno"; then
67 SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
72 AC_SUBST(SOUP_DEBUG_FLAGS)
75 # ****************************************
82 # Use an many warnings as possible
84 if test "x$GCC" = "xyes"; then
86 *[\ \ ]-Wall[\ \ ]*) ;;
87 *) CFLAGS="$CFLAGS -Wall" ;;
90 if test "x$enable_ansi" = "xyes"; then
92 *[\ \ ]-ansi[\ \ ]*) ;;
93 *) CFLAGS="$CFLAGS -ansi" ;;
97 *[\ \ ]-pedantic[\ \ ]*) ;;
98 *) CFLAGS="$CFLAGS -pedantic" ;;
104 # Use reentrant functions
105 CFLAGS="$CFLAGS -D_REENTRANT"
114 # ****************************************
115 # Check for libraries
119 [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
120 AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))
122 GLIB_CFLAGS=`glib-config --cflags glib`
123 GLIB_LIBS=`glib-config --libs glib`
125 AC_SUBST(GLIB_CFLAGS)
131 [LIBS="$LIBS $GNET_LIBS" CFLAGS="$CFLAGS $GNET_CFLAGS"],
132 AC_MSG_ERROR(Cannot find GNET: Is gnet-config in path?))
134 GNET_CFLAGS=`gnet-config --cflags gnet`
135 GNET_LIBS=`gnet-config --libs gnet`
137 AC_SUBST(GNET_CFLAGS)
141 # Need in.h and tcp.h for setting of TCP_NODELAY
142 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)
146 AC_CHECK_HEADERS(openssl/ssl.h)
149 # Set PACKAGE_SOURCE_DIR in config.h.
150 packagesrcdir=`cd $srcdir && pwd`
151 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
153 # If gcc is the compiler, compile with lots of warnings
154 if test "x$GCC" = "xyes"; then
155 CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations "