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
16 AC_SUBST(SOUP_MAJOR_VERSION)
17 AC_SUBST(SOUP_MINOR_VERSION)
18 AC_SUBST(SOUP_MICRO_VERSION)
19 AC_SUBST(SOUP_VERSION)
22 LT_RELEASE=$SOUP_VERSION
23 LT_CURRENT=$SOUP_MINOR_VERSION
24 LT_REVISION=$SOUP_MICRO_VERSION
25 LT_AGE=$SOUP_MINOR_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 AC_MSG_ERROR([Cannot find GLIB: Is glib-config in path?]))
121 GLIB_CFLAGS=`glib-config --cflags glib`
122 GLIB_LIBS=`glib-config --libs glib`
124 AC_SUBST(GLIB_CFLAGS)
130 AC_MSG_ERROR([Cannot find GNET: Is gnet-config in path?]))
132 GNET_CFLAGS=`gnet-config --cflags gnet`
133 GNET_LIBS=`gnet-config --libs gnet`
135 AC_SUBST(GNET_CFLAGS)
140 AC_PATH_PROG(XML_CONFIG,xml-config,no)
141 if test x$XML_CONFIG = xno; then
142 AC_MSG_ERROR([Cannot find LIBXML: Is xml-config in path?])
144 XML_CFLAGS=`xml-config --cflags`
145 XML_LIBS=`xml-config --libs`
152 save_CPPFLAGS=$CPPFLAGS
157 AC_CHECK_LIB(popt, poptGetContext,, AC_MSG_ERROR([popt is required]))
158 AC_CHECK_HEADERS(popt.h,, AC_MSG_ERROR([popt.h is required]))
160 POPT_CFLAGS=$CPPFLAGS
163 AC_SUBST(POPT_CFLAGS)
166 CPPFLAGS=$save_CPPFLAGS
170 # Need in.h and tcp.h for setting of TCP_NODELAY
171 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)
176 [ --enable-ssl turn on Secure Sockets Layer support [default=yes]
177 ([=no] will override --with-ssl)],,enable_ssl=yes)
179 AC_ARG_WITH(nspr-includes,
180 [ --with-nspr-includes Specify location of Netscape Portable Runtime headers],[
181 nspr_inc_prefix=-I$withval
184 AC_ARG_WITH(nspr-libs,
185 [ --with-nspr-libs Specify location of Netscape Portable Runtime libs],[
186 nspr_prefix=-L$withval
189 AC_ARG_WITH(nss-includes,
190 [ --with-nss-includes Specify location of NSS header files],[
191 nss_inc_prefix=-I$withval
194 AC_ARG_WITH(nss-libs,
195 [ --with-nss-libs Specify location of NSS libs],[
196 nss_prefix=-L$withval
200 AC_ARG_WITH(openssl-includes,
201 [ --with-openssl-includes Specify location of OpenSSL header files],[
202 openssl_inc_prefix=-I$withval
205 AC_ARG_WITH(openssl-libs,
206 [ --with-openssl-libs Specify location of OpenSSL libs],[
207 openssl_prefix=-L$withval
210 if test "x$enable_ssl" = xyes; then
211 save_CPPFLAGS=$CPPFLAGS
212 CPPFLAGS="$openssl_inc_prefix"
213 AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h,
214 [OPENSSL_CFLAGS="$CPPFLAGS"
215 OPENSSL_LIBS="$openssl_prefix -lssl -lcrypto"],
216 [OPENSSL_CFLAGS="" OPENSSL_LIBS=""; break;])
217 AC_SUBST(OPENSSL_CFLAGS)
218 AC_SUBST(OPENSSL_LIBS)
219 CPPFLAGS=$save_CPPFLAGS
221 save_CPPFLAGS=$CPPFLAGS
222 CPPFLAGS="$nspr_inc_prefix $nss_inc_prefix"
223 AC_CHECK_HEADERS(prthread.h security/ssl.h security/pk11func.h,
224 [NSS_CFLAGS="$CPPFLAGS"
225 NSS_LIBS="$nspr_prefix -lnspr4 $nss_prefix -lnss3"],
226 [NSS_CFLAGS="" NSS_LIBS=""; break;])
229 CPPFLAGS=$save_CPPFLAGS
232 # Set PACKAGE_SOURCE_DIR in config.h.
233 packagesrcdir=`cd $srcdir && pwd`
234 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
236 # If gcc is the compiler, compile with lots of warnings
237 if test "x$GCC" = "xyes"; then
238 CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations "
239 WSDL_CFLAGS="-Werror"
242 AC_SUBST(WSDL_CFLAGS)
253 src/soup-core/Makefile
254 src/soup-wsdl/Makefile
257 [chmod +x soup-config])