Replaced CVS gnet feature for setting TCP_NODELAY
[platform/upstream/libsoup.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2
3 # Require autoconf 2.12
4 AC_PREREQ(2.12)
5
6 # Initialize autoconf
7 AC_INIT(configure.in)
8
9 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
10 SOUP_MAJOR_VERSION=0
11 SOUP_MINOR_VERSION=1
12 SOUP_MICRO_VERSION=5
13 SOUP_INTERFACE_AGE=0
14 SOUP_BINARY_AGE=0
15 SOUP_VERSION=$SOUP_MAJOR_VERSION.$SOUP_MINOR_VERSION.$SOUP_MICRO_VERSION
16 VERSION=$SOUP_VERSION
17 PACKAGE=soup
18 AC_DIVERT_POP()
19
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`
24
25 AC_SUBST(SOUP_MAJOR_VERSION)
26 AC_SUBST(SOUP_MINOR_VERSION)
27 AC_SUBST(SOUP_MICRO_VERSION)
28 AC_SUBST(SOUP_VERSION)
29 AC_SUBST(LT_RELEASE)
30 AC_SUBST(LT_CURRENT)
31 AC_SUBST(LT_REVISION)
32 AC_SUBST(LT_AGE)
33
34 # Specify a configuration file
35 AM_CONFIG_HEADER(config.h)
36
37 # Initialize automake
38 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
39
40 # Initialize maintainer mode
41 AM_MAINTAINER_MODE
42
43
44 # ****************************************
45 # Set debugging flags
46
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
50         debug_default=yes
51 else
52         debug_default=minimum
53 fi
54 AC_DIVERT_POP()
55
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)
58
59 # Set the debug flags
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"
64   AC_MSG_RESULT(yes)
65 else
66   if test "x$enable_debug" = "xno"; then
67     SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
68     AC_MSG_RESULT(no)
69   fi
70 fi
71
72 AC_SUBST(SOUP_DEBUG_FLAGS)
73
74
75 # ****************************************
76 # Check for programs
77
78 AC_PROG_CC
79 AM_PROG_CC_STDC
80 AC_PROG_INSTALL
81
82 # Use an many warnings as possible
83 changequote(,)
84 if test "x$GCC" = "xyes"; then
85   case " $CFLAGS " in
86   *[\ \ ]-Wall[\ \      ]*) ;;
87   *) CFLAGS="$CFLAGS -Wall" ;;
88   esac
89
90   if test "x$enable_ansi" = "xyes"; then
91     case " $CFLAGS " in
92     *[\ \       ]-ansi[\ \      ]*) ;;
93     *) CFLAGS="$CFLAGS -ansi" ;;
94     esac
95
96     case " $CFLAGS " in
97     *[\ \       ]-pedantic[\ \  ]*) ;;
98     *) CFLAGS="$CFLAGS -pedantic" ;;
99     esac
100   fi
101 fi
102 changequote([,])
103
104 # Use reentrant functions
105 CFLAGS="$CFLAGS -D_REENTRANT"
106
107 # Set STDC_HEADERS
108 AC_HEADER_STDC
109
110 # Initialize libtool
111 AM_PROG_LIBTOOL
112
113
114 # ****************************************
115 # Check for libraries
116
117 # Need GLIB
118 AM_PATH_GLIB(1.2.0,
119             [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
120             AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))
121
122 GLIB_CFLAGS=`glib-config --cflags glib`
123 GLIB_LIBS=`glib-config --libs glib`
124
125 AC_SUBST(GLIB_CFLAGS)
126 AC_SUBST(GLIB_LIBS)
127
128
129 # Need GNET
130 AM_PATH_GNET(1.0.0,
131              [LIBS="$LIBS $GNET_LIBS" CFLAGS="$CFLAGS $GNET_CFLAGS"],
132              AC_MSG_ERROR(Cannot find GNET: Is gnet-config in path?))
133
134 GNET_CFLAGS=`gnet-config --cflags gnet`
135 GNET_LIBS=`gnet-config --libs gnet`
136
137 AC_SUBST(GNET_CFLAGS)
138 AC_SUBST(GNET_LIBS)
139
140
141 # Need in.h and tcp.h for setting of TCP_NODELAY
142 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)
143
144
145 # Check for OpenSSL
146 AC_CHECK_HEADERS(openssl/ssl.h)
147
148
149 # Set PACKAGE_SOURCE_DIR in config.h.
150 packagesrcdir=`cd $srcdir && pwd`
151 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
152
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 "
156 fi
157
158 #       doc/Makefile
159 #       gnome-soup.spec
160
161 AC_OUTPUT([
162         Makefile
163         src/Makefile
164 ])
165