1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
6 AC_INIT([libsoup],[2.37.2.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=libsoup])
7 AC_CONFIG_SRCDIR([libsoup-2.4.pc.in])
8 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([foreign 1.9])
11 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
16 AC_SUBST(SOUP_API_VERSION)
18 # Increment on interface addition. Reset on removal.
21 # Increment on interface add, remove, or change.
24 # Increment on source change. Reset when CURRENT changes.
27 AC_SUBST(SOUP_CURRENT)
28 AC_SUBST(SOUP_REVISION)
31 dnl ***************************
32 dnl *** Set debugging flags ***
33 dnl ***************************
37 # Declare --enable-* args and collect ac_help strings
39 AS_HELP_STRING([--enable-debug=[no/minimum/yes]],
40 [turn on debugging (default=$debug_default)]),,
41 enable_debug=$debug_default)
44 if test "x$enable_debug" = "xyes"; then
45 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
46 SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
48 if test "x$enable_debug" = "xno"; then
49 SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
53 AC_SUBST(SOUP_DEBUG_FLAGS)
55 # Set the maintainer flags
56 #if test -d .git; then
57 # SOUP_MAINTAINER_FLAGS="-DG_DISABLE_DEPRECATED"
59 AC_SUBST(SOUP_MAINTAINER_FLAGS)
61 dnl ***************************
62 dnl *** Checks for programs ***
63 dnl ***************************
71 dnl ***********************
72 dnl *** Checks for glib ***
73 dnl ***********************
75 AM_PATH_GLIB_2_0(2.31.0,,,gobject gio)
76 if test "$GLIB_LIBS" = ""; then
77 AC_MSG_ERROR(GLIB 2.31.0 or later is required to build libsoup)
79 GLIB_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
81 PKG_CHECK_MODULES(XML, libxml-2.0)
85 dnl ***********************
86 dnl *** Check for Win32 ***
87 dnl ***********************
89 AC_MSG_CHECKING([for Win32])
93 CFLAGS="$CFLAGS -D_REENTRANT"
99 AC_MSG_RESULT([$os_win32])
100 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
102 dnl *******************
103 dnl *** Misc checks ***
104 dnl *******************
105 AC_CHECK_FUNCS(gmtime_r)
107 AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
109 dnl *********************
110 dnl *** GNOME support ***
111 dnl *********************
112 AC_MSG_CHECKING(whether to build libsoup-gnome)
114 AS_HELP_STRING([--without-gnome], [Do not build libsoup-gnome]),
115 :, [if test $os_win32 = yes; then with_gnome=no; else with_gnome=yes; fi])
116 AC_MSG_RESULT($with_gnome)
118 if test $with_gnome != no -a $os_win32 != yes; then
119 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1, :,
121 [Could not find gnome-keyring devel files.
122 Configure with --without-gnome if you wish to build only libsoup
123 without GNOME-specific features.]))
125 AC_SUBST(GNOME_KEYRING_CFLAGS)
126 AC_SUBST(GNOME_KEYRING_LIBS)
128 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
130 if test $with_gnome != no; then
131 AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
133 PKG_CHECK_MODULES(SQLITE, sqlite3, :, [AC_MSG_ERROR(dnl
134 [Could not find sqlite3 devel files:
138 Pass "--without-gnome" to configure if you want to build libsoup
139 without GNOME support.])])
142 AC_SUBST(SQLITE_CFLAGS)
143 AC_SUBST(SQLITE_LIBS)
149 GTK_DOC_CHECK([1.10])
151 dnl *****************************
152 dnl *** gobject-introspection ***
153 dnl *****************************
154 GOBJECT_INTROSPECTION_CHECK([0.9.5])
156 AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
157 save_CFLAGS="$CFLAGS"
159 CFLAGS="$CFLAGS $GLIB_CFLAGS"
160 LIBS="$LIBS $GLIB_LIBS"
161 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
162 [g_type_init (); return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
163 [have_glib_networking=yes],
164 [have_glib_networking=no],
165 [have_glib_networking="unknown (cross-compiling)"])
166 CFLAGS="$save_CFLAGS"
168 AC_MSG_RESULT($have_glib_networking)
170 AC_ARG_ENABLE(tls-check,
171 AS_HELP_STRING([--disable-tls-check], [Don't error out if glib-networking is unavailable]))
172 if test "$enable_tls_check" != "no" -a "$have_glib_networking" = "no"; then
173 AC_MSG_ERROR([libsoup requires glib-networking for TLS support.
175 If you are building a package, you can pass --disable-tls-check to
176 allow building libsoup anyway (since glib-networking is not actually
177 required at compile time), but you should be sure to add a runtime
181 dnl ******************************
182 dnl *** Stuff for regression tests
183 dnl ******************************
184 AC_MSG_NOTICE([checking for programs needed for regression tests])
185 MISSING_REGRESSION_TEST_PACKAGES=""
187 if test "$have_glib_networking" = "no"; then
188 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES glib-networking"
191 AC_ARG_WITH(apache-httpd,
192 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
193 APACHE_HTTPD="$withval",
194 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
195 if test "$APACHE_HTTPD" != "no"; then
196 AC_MSG_CHECKING([Apache version])
197 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
198 case $apache_version in
200 AC_MSG_RESULT([$apache_version (ok)])
203 AC_MSG_RESULT([$apache_version (ignoring)])
208 AC_SUBST(APACHE_HTTPD)
209 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
211 if test "$APACHE_HTTPD" != "no"; then
212 AC_MSG_CHECKING([for Apache module directory])
213 AC_ARG_WITH(apache-module-dir,
214 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
215 apache_module_dirs="$withval",
216 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
217 mpm=`$APACHE_HTTPD -V | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
218 # This only works with bash, but should fail harmlessly in sh
219 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
220 for dir in $apache_module_dirs; do
221 if test -f $dir/mod_auth_digest.so; then
222 APACHE_MODULE_DIR="$dir"
224 if test -f $dir/mod_ssl.so; then
225 APACHE_SSL_MODULE_DIR="$dir"
226 IF_HAVE_APACHE_SSL=""
228 if test -f $dir/mod_php5.so; then
229 APACHE_PHP_MODULE_DIR="$dir"
230 APACHE_PHP_MODULE=mod_php5.so
232 if test -f $dir/libphp5.so; then
233 APACHE_PHP_MODULE_DIR="$dir"
234 APACHE_PHP_MODULE=libphp5.so
237 AC_MSG_RESULT($APACHE_MODULE_DIR)
238 AC_SUBST(APACHE_MODULE_DIR)
239 AC_SUBST(APACHE_SSL_MODULE_DIR)
240 AC_SUBST(APACHE_PHP_MODULE_DIR)
241 AC_SUBST(APACHE_PHP_MODULE)
244 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
245 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
247 if test -z "$APACHE_PHP_MODULE_DIR"; then
248 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES mod_php5"
252 if test "$APACHE_HTTPD" = "no" -o -z "$APACHE_MODULE_DIR"; then
253 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES apache"
255 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES mod_ssl"
258 AM_CONDITIONAL(HAVE_APACHE, test $have_apache = 1)
260 if test "$have_apache" = 1; then
261 AC_CHECK_PROGS(PHP, php php5)
263 AC_MSG_CHECKING([for Apache PHP module])
264 if test -f $APACHE_PHP_MODULE_DIR/$APACHE_PHP_MODULE; then
270 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES php5"
272 AC_MSG_RESULT($have_php)
274 if test "$have_php" = yes; then
275 AC_MSG_CHECKING([for xmlrpc-epi-php])
276 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
277 have_xmlrpc_epi_php=no
278 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES php-xmlrpc"
280 have_xmlrpc_epi_php=yes
282 AC_MSG_RESULT($have_xmlrpc_epi_php)
286 AC_SUBST(IF_HAVE_PHP)
287 AM_CONDITIONAL(HAVE_XMLRPC_EPI_PHP, test "$have_xmlrpc_epi_php" = yes)
289 AC_PATH_PROG(CURL, curl, no)
290 if test "$CURL" != no; then
291 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
293 MISSING_REGRESSION_TEST_PACKAGES="$MISSING_REGRESSION_TEST_PACKAGES curl"
295 AM_CONDITIONAL(HAVE_CURL, test "$CURL" != no)
297 AC_SUBST(MISSING_REGRESSION_TEST_PACKAGES)
298 AM_CONDITIONAL(MISSING_REGRESSION_TEST_PACKAGES, test -n "$MISSING_REGRESSION_TEST_PACKAGES")
300 dnl **********************************************************
301 dnl *** path of NTLM single-sign-on helper ntlm_auth
302 dnl **********************************************************
303 AC_ARG_WITH(ntlm-auth,
304 AC_HELP_STRING([--with-ntlm-auth=PATH],[Where to look for ntlm_auth, path points to ntlm_auth installation (default: /usr/bin/ntlm_auth)]),
305 ntlm_auth="$withval",
306 [if test $os_win32 = yes; then ntlm_auth="no"; else ntlm_auth="/usr/bin/ntlm_auth"; fi])
307 if test "$ntlm_auth" != "no"; then
308 AC_DEFINE(USE_NTLM_AUTH, 1, [Whether or not use Samba's 'winbind' daemon helper 'ntlm_auth' for NTLM single-sign-on])
309 if test "$ntlm_auth" = "yes"; then
310 dnl --with-ntlm-auth (without path) used, use default path
311 ntlm_auth="/usr/bin/ntlm_auth"
315 AC_DEFINE_UNQUOTED(NTLM_AUTH, "$ntlm_auth", [Samba's 'winbind' daemon helper 'ntlm_auth' which can be used for NTLM single-sign-on])
317 dnl ****************************************************
318 dnl *** Warnings to show if using GCC ***
319 dnl *** (do this last so -Werror won't mess up tests ***
320 dnl ****************************************************
322 AC_ARG_ENABLE(more-warnings,
323 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
324 set_more_warnings=no)
326 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
328 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
329 -Werror=implicit-function-declaration \
330 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
331 -Werror=missing-include-dirs -Werror=aggregate-return \
332 -Werror=declaration-after-statement"
335 dnl *************************
336 dnl *** Output Everything ***
337 dnl *************************
339 AC_CONFIG_HEADERS([config.h])
349 docs/reference/Makefile
353 if test -n "$MISSING_REGRESSION_TEST_PACKAGES"; then
355 echo Some regression tests will not be run due to missing packages:
356 echo $MISSING_REGRESSION_TEST_PACKAGES