1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
6 AC_INIT(libsoup, 2.29.6)
7 AC_CONFIG_SRCDIR(libsoup-2.4.pc.in)
8 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([foreign])
11 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
13 AM_CONFIG_HEADER(config.h)
17 AC_SUBST(SOUP_API_VERSION)
19 # Increment on interface addition. Reset on removal.
22 # Increment on interface add, remove, or change.
25 # Increment on source change. Reset when CURRENT changes.
28 AC_SUBST(SOUP_CURRENT)
29 AC_SUBST(SOUP_REVISION)
32 dnl ***************************
33 dnl *** Set debugging flags ***
34 dnl ***************************
38 # Declare --enable-* args and collect ac_help strings
40 AS_HELP_STRING([--enable-debug=[no/minimum/yes]],
41 [turn on debugging (default=$debug_default)]),,
42 enable_debug=$debug_default)
45 if test "x$enable_debug" = "xyes"; then
46 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
47 SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
49 if test "x$enable_debug" = "xno"; then
50 SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
54 AC_SUBST(SOUP_DEBUG_FLAGS)
56 # Set the maintainer flags
58 SOUP_MAINTAINER_FLAGS="-DG_DISABLE_DEPRECATED"
59 AC_SUBST(SOUP_MAINTAINER_FLAGS)
62 dnl ***************************
63 dnl *** Checks for programs ***
64 dnl ***************************
77 # This isn't a program, but it doesn't fit anywhere else...
80 dnl ***********************
81 dnl *** Checks for glib ***
82 dnl ***********************
84 AM_PATH_GLIB_2_0(2.21.3,,,gobject gthread gio)
85 if test "$GLIB_LIBS" = ""; then
86 AC_MSG_ERROR(GLIB 2.21.3 or later is required to build libsoup)
88 GLIB_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
90 PKG_CHECK_MODULES(XML, libxml-2.0)
94 dnl ***********************
95 dnl *** Check for Win32 ***
96 dnl ***********************
98 AC_MSG_CHECKING([for Win32])
107 AC_MSG_RESULT([$os_win32])
108 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
110 dnl *******************
111 dnl *** Misc checks ***
112 dnl *******************
113 AC_CHECK_FUNCS(gmtime_r)
116 dnl *********************************
117 dnl *** Networking library checks ***
118 dnl *********************************
120 AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
122 dnl **********************************
123 dnl *** SSL Library check (GnuTLS) ***
124 dnl **********************************
127 AS_HELP_STRING([--disable-ssl], [Disable SSL/TLS support (not recommended)]),,
131 if test "$enable_ssl" != "no"; then
132 PKG_CHECK_MODULES(LIBGNUTLS, gnutls >= 2.1.7,
133 [AM_PATH_LIBGCRYPT([], have_ssl=yes, have_ssl=no)], have_ssl=no)
135 if test "$have_ssl" = "yes"; then
136 AC_DEFINE(HAVE_SSL, 1, [Defined if you have SSL support])
137 SSL_REQUIREMENT="gnutls"
139 if test "$enable_ssl" = "no"; then
140 AC_MSG_WARN(Disabling SSL support);
142 AC_MSG_ERROR([Could not configure SSL support.
143 Pass "--disable-ssl" if you really want to build without SSL support]);
147 AC_SUBST(LIBGNUTLS_CFLAGS)
148 AC_SUBST(LIBGNUTLS_LIBS)
149 AC_SUBST(SSL_REQUIREMENT)
151 dnl This is not supposed to be conditional, but...
152 AM_CONDITIONAL(HAVE_SSL, test $enable_ssl != no)
155 dnl *********************
156 dnl *** GNOME support ***
157 dnl *********************
158 AC_MSG_CHECKING(whether to build libsoup-gnome)
160 AS_HELP_STRING([--without-gnome], [Do not build libsoup-gnome]),
161 :, [if test $os_win32 = yes; then with_gnome=no; else with_gnome=yes; fi])
162 AC_MSG_RESULT($with_gnome)
164 if test $with_gnome != no; then
165 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1, :,
167 [Could not find gnome-keyring devel files.
168 Configure with --without-gnome if you wish to build only libsoup
169 without GNOME-specific features.]))
171 AC_SUBST(GNOME_KEYRING_CFLAGS)
172 AC_SUBST(GNOME_KEYRING_LIBS)
174 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
176 if test $with_gnome != no; then
177 AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
179 PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, :, [AC_MSG_ERROR(dnl
180 [Could not find libproxy:
184 This is required for GNOME proxy support.
186 Pass "--without-gnome" to configure if you want to build libsoup
187 without GNOME support.])])
189 PKG_CHECK_MODULES(GCONF, gconf-2.0, , [AC_MSG_ERROR(dnl
190 [Could not find GConf:
194 Due to bugs in libproxy as of the GNOME 2.26 freeze date, GConf is
195 *also* required for GNOME proxy support.
197 Pass "--without-gnome" to configure if you want to build libsoup
198 without GNOME support.])])
200 PKG_CHECK_MODULES(SQLITE, sqlite3, :, [AC_MSG_ERROR(dnl
201 [Could not find sqlite3 devel files:
205 Pass "--without-gnome" to configure if you want to build libsoup
206 without GNOME support.])])
209 AC_SUBST(GCONF_CFLAGS)
211 AC_SUBST(LIBPROXY_CFLAGS)
212 AC_SUBST(LIBPROXY_LIBS)
213 AC_SUBST(SQLITE_CFLAGS)
214 AC_SUBST(SQLITE_LIBS)
223 dnl *************************************
224 dnl *** Warnings to show if using GCC ***
225 dnl *************************************
227 AC_ARG_ENABLE(more-warnings,
228 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
229 set_more_warnings=no)
231 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
233 -Wall -Wstrict-prototypes -Wmissing-declarations \
234 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
235 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
236 -Waggregate-return -Wmissing-format-attribute"
238 for option in -Wmissing-include-dirs -Wundef; do
239 SAVE_CFLAGS="$CFLAGS"
240 CFLAGS="$CFLAGS $option"
241 AC_MSG_CHECKING([whether gcc understands $option])
242 AC_TRY_COMPILE([], [],
245 AC_MSG_RESULT($has_option)
246 if test $has_option = no; then
247 CFLAGS="$SAVE_CFLAGS"
252 if test "$os_win32" != yes; then
253 # Use reentrant functions (FIXME!)
254 CFLAGS="$CFLAGS -D_REENTRANT"
257 dnl ******************************
258 dnl *** Stuff for regression tests
259 dnl ******************************
260 AC_MSG_NOTICE([checking for programs needed for regression tests])
261 MISSING_REGRESSION_TEST_PACKAGES=""
262 if test $have_ssl = "no"; then
263 MISSING_REGRESSION_TEST_PACKAGES=" gnutls"
266 AC_ARG_WITH(apache-httpd,
267 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
268 APACHE_HTTPD="$withval",
269 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
270 if test "$APACHE_HTTPD" != "no"; then
271 AC_MSG_CHECKING([Apache version])
272 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
273 case $apache_version in
275 AC_MSG_RESULT([$apache_version (ok)])
278 AC_MSG_RESULT([$apache_version (ignoring)])
283 AC_SUBST(APACHE_HTTPD)
284 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
286 if test "$APACHE_HTTPD" != "no"; then
287 AC_MSG_CHECKING([for Apache module directory])
288 AC_ARG_WITH(apache-module-dir,
289 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
290 apache_module_dirs="$withval",
291 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
292 mpm=`$APACHE_HTTPD -V | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
293 # This only works with bash, but should fail harmlessly in sh
294 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
295 for dir in $apache_module_dirs; do
296 if test -f $dir/mod_auth_digest.so; then
297 APACHE_MODULE_DIR="$dir"
299 if test -f $dir/mod_ssl.so; then
300 APACHE_SSL_MODULE_DIR="$dir"
301 IF_HAVE_APACHE_SSL=""
303 if test -f $dir/mod_php5.so; then
304 APACHE_PHP_MODULE_DIR="$dir"
305 APACHE_PHP_MODULE=mod_php5.so
307 if test -f $dir/libphp5.so; then
308 APACHE_PHP_MODULE_DIR="$dir"
309 APACHE_PHP_MODULE=libphp5.so
312 AC_MSG_RESULT($APACHE_MODULE_DIR)
313 AC_SUBST(APACHE_MODULE_DIR)
314 AC_SUBST(APACHE_SSL_MODULE_DIR)
315 AC_SUBST(APACHE_PHP_MODULE_DIR)
316 AC_SUBST(APACHE_PHP_MODULE)
319 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
320 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
322 if test -z "$APACHE_PHP_MODULE_DIR"; then
323 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES mod_php5"
327 if test "$APACHE_HTTPD" = "no" -o -z "$APACHE_MODULE_DIR"; then
328 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES apache"
330 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES mod_ssl"
333 AM_CONDITIONAL(HAVE_APACHE, test $have_apache = 1)
335 if test "$have_apache" = 1; then
336 AC_CHECK_PROGS(PHP, php php5)
338 AC_MSG_CHECKING([for Apache PHP module])
339 if test -f $APACHE_PHP_MODULE_DIR/$APACHE_PHP_MODULE; then
345 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES php5"
347 AC_MSG_RESULT($have_php)
349 if test "$have_php" = yes; then
350 AC_MSG_CHECKING([for xmlrpc-epi-php])
351 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
352 have_xmlrpc_epi_php=no
353 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES php-xmlrpc"
355 have_xmlrpc_epi_php=yes
357 AC_MSG_RESULT($have_xmlrpc_epi_php)
361 AC_SUBST(IF_HAVE_PHP)
362 AM_CONDITIONAL(HAVE_XMLRPC_EPI_PHP, test "$have_xmlrpc_epi_php" = yes)
364 AC_PATH_PROG(CURL, curl, no)
365 if test "$CURL" != no; then
366 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
368 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES curl"
370 AM_CONDITIONAL(HAVE_CURL, test "$CURL" != no)
372 if test -n "$MISSING_REGRESSION_TEST_PACKAGES"; then
373 AC_MSG_NOTICE([Some regression tests will not be run due to missing packages:$MISSING_REGRESSION_TEST_PACKAGES])
375 AC_SUBST(MISSING_REGRESSION_TEST_PACKAGES)
376 AM_CONDITIONAL(MISSING_REGRESSION_TEST_PACKAGES, test -n "$MISSING_REGRESSION_TEST_PACKAGES")
378 dnl *************************
379 dnl *** Output Everything ***
380 dnl *************************
391 docs/reference/Makefile