1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
5 m4_define([soup_major_version], [2])
6 m4_define([soup_minor_version], [62])
7 m4_define([soup_micro_version], [2])
10 AC_INIT([libsoup],[soup_major_version.soup_minor_version.soup_micro_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=libsoup])
11 AC_CONFIG_SRCDIR([libsoup-2.4.pc.in])
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_AUX_DIR([build-aux])
15 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz -Wno-portability])
16 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
20 SOUP_MAJOR_VERSION=soup_major_version
21 SOUP_MINOR_VERSION=soup_minor_version
22 SOUP_MICRO_VERSION=soup_micro_version
23 AC_SUBST(SOUP_MAJOR_VERSION)
24 AC_SUBST(SOUP_MINOR_VERSION)
25 AC_SUBST(SOUP_MICRO_VERSION)
28 AC_SUBST(SOUP_API_VERSION)
30 # Increment on interface addition. Reset on removal.
33 # Increment on interface add, remove, or change.
36 # Increment on source change. Reset when CURRENT changes.
39 AC_SUBST(SOUP_CURRENT)
40 AC_SUBST(SOUP_REVISION)
43 dnl ***************************
44 dnl *** Set debugging flags ***
45 dnl ***************************
49 # Declare --enable-* args and collect ac_help strings
51 AS_HELP_STRING([--enable-debug=[no/minimum/yes]],
52 [turn on debugging (default=$debug_default)]),,
53 enable_debug=$debug_default)
56 if test "x$enable_debug" = "xyes"; then
57 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
58 SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
60 if test "x$enable_debug" = "xno"; then
61 SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
65 AC_SUBST(SOUP_DEBUG_FLAGS)
67 dnl ***************************
68 dnl *** Checks for programs ***
69 dnl ***************************
77 dnl ***********************
78 dnl *** Checks for glib ***
79 dnl ***********************
82 AM_PATH_GLIB_2_0($GLIB_REQUIRED,,,gobject gio)
83 if test "$GLIB_LIBS" = ""; then
84 AC_MSG_ERROR(GLIB $GLIB_REQUIRED or later is required to build libsoup)
86 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38"
88 GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
89 AC_SUBST(GLIB_MAKEFILE)
93 PKG_CHECK_MODULES(XML, libxml-2.0)
97 PKG_CHECK_MODULES(SQLITE, sqlite3)
98 AC_SUBST(SQLITE_CFLAGS)
101 dnl ***********************
102 dnl *** Check for Win32 ***
103 dnl ***********************
105 AC_MSG_CHECKING([for Win32])
110 CFLAGS="$CFLAGS -D_REENTRANT"
121 AC_MSG_RESULT([$os_win32])
122 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
123 AM_CONDITIONAL(OS_LINUX, [test $os_linux = yes])
125 dnl ************************
126 dnl *** gettext/intltool ***
127 dnl ************************
128 IT_PROG_INTLTOOL([0.35.0])
129 GETTEXT_PACKAGE=libsoup
130 AC_SUBST([GETTEXT_PACKAGE])
131 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
133 dnl *******************
134 dnl *** Misc checks ***
135 dnl *******************
136 AC_CHECK_FUNCS(gmtime_r)
138 dnl *********************
139 dnl *** GNOME support ***
140 dnl *********************
141 AC_MSG_CHECKING(whether to build libsoup-gnome)
143 AS_HELP_STRING([--without-gnome], [Do not build libsoup-gnome]),
144 :, [if test $os_win32 = yes; then with_gnome=no; else with_gnome=yes; fi])
145 AC_MSG_RESULT($with_gnome)
147 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
149 if test $with_gnome != no; then
150 AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
158 dnl GTK_DOC_CHECK([1.10])
159 # gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
160 # it on it's own line.
161 m4_ifdef([GTK_DOC_CHECK], [
162 GTK_DOC_CHECK([1.20], [--flavour no-tmpl])
165 dnl *****************************
166 dnl *** gobject-introspection ***
167 dnl *****************************
168 GOBJECT_INTROSPECTION_CHECK([0.9.5])
170 if test "$found_introspection" != "yes" -a "$enable_vala" = ""; then
175 AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
176 save_CFLAGS="$CFLAGS"
178 CFLAGS="$CFLAGS $GLIB_CFLAGS"
179 LIBS="$LIBS $GLIB_LIBS"
180 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
181 [return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
182 [have_glib_networking=yes],
183 [have_glib_networking=no],
184 [have_glib_networking="unknown (cross-compiling)"])
185 CFLAGS="$save_CFLAGS"
187 AC_MSG_RESULT($have_glib_networking)
189 AC_ARG_ENABLE(tls-check,
190 AS_HELP_STRING([--disable-tls-check], [Don't error out if glib-networking is unavailable]))
191 if test "$enable_tls_check" != "no" -a "$have_glib_networking" = "no"; then
192 AC_MSG_ERROR([libsoup requires glib-networking for TLS support.
194 If you are building a package, you can pass --disable-tls-check to
195 allow building libsoup anyway (since glib-networking is not actually
196 required at compile time), but you should be sure to add a runtime
200 dnl ******************************
201 dnl *** Stuff for regression tests
202 dnl ******************************
203 AC_MSG_NOTICE([checking for programs needed for regression tests])
205 AC_ARG_WITH(apache-httpd,
206 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
207 APACHE_HTTPD="$withval",
208 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
209 if test "$APACHE_HTTPD" != "no"; then
210 AC_MSG_CHECKING([Apache version])
211 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
212 case $apache_version in
214 AC_MSG_RESULT([$apache_version (ok)])
217 AC_MSG_RESULT([$apache_version (ignoring)])
222 AC_SUBST(APACHE_HTTPD)
223 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
225 if test "$APACHE_HTTPD" != "no"; then
226 AC_MSG_CHECKING([for Apache module directory])
227 AC_ARG_WITH(apache-module-dir,
228 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
229 apache_module_dirs="$withval",
230 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
231 mpm=`$APACHE_HTTPD -V -C "ServerName localhost" | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
232 # This only works with bash, but should fail harmlessly in sh
233 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
234 for dir in $apache_module_dirs; do
235 if test -f $dir/mod_auth_digest.so; then
236 APACHE_MODULE_DIR="$dir"
238 if test -f $dir/mod_ssl.so; then
239 APACHE_SSL_MODULE_DIR="$dir"
240 IF_HAVE_APACHE_SSL=""
242 if test -f $dir/libphp7.so; then
243 APACHE_PHP_MODULE_DIR="$dir"
246 AC_MSG_RESULT($APACHE_MODULE_DIR)
247 AC_SUBST(APACHE_MODULE_DIR)
248 AC_SUBST(APACHE_SSL_MODULE_DIR)
249 AC_SUBST(APACHE_PHP_MODULE_DIR)
252 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
253 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
258 AM_CONDITIONAL(HAVE_APACHE, test "$have_apache" = 1)
260 if test "$have_apache" = 1; then
261 AC_CHECK_PROGS(PHP, php)
263 AC_MSG_CHECKING([for Apache PHP module])
264 if test -d "$APACHE_PHP_MODULE_DIR"; then
271 AC_MSG_RESULT($have_php)
272 AC_SUBST(IF_HAVE_PHP)
274 if test "$have_php" = yes; then
275 AC_MSG_CHECKING([for php-xmlrpc])
276 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
280 AC_DEFINE(HAVE_PHP_XMLRPC, 1, [Have php-xmlrpc])
282 AC_MSG_RESULT($have_php_xmlrpc)
285 if test -f "$APACHE_MODULE_DIR/mod_unixd.so"; then
288 IF_HAVE_MOD_UNIXD="#"
290 AC_SUBST(IF_HAVE_MOD_UNIXD)
293 AC_PATH_PROG(CURL, curl, no)
294 if test "$CURL" != no; then
295 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
298 dnl **********************************************************
299 dnl *** path of NTLM single-sign-on helper ntlm_auth
300 dnl **********************************************************
301 AC_ARG_WITH(ntlm-auth,
302 AC_HELP_STRING([--with-ntlm-auth=PATH],[Where to look for ntlm_auth, path points to ntlm_auth installation (default: /usr/bin/ntlm_auth)]),
303 ntlm_auth="$withval",
304 [if test $os_win32 = yes; then ntlm_auth="no"; else ntlm_auth="/usr/bin/ntlm_auth"; fi])
305 if test "$ntlm_auth" != "no"; then
306 AC_DEFINE(USE_NTLM_AUTH, 1, [Whether or not use Samba's 'winbind' daemon helper 'ntlm_auth' for NTLM single-sign-on])
307 if test "$ntlm_auth" = "yes"; then
308 dnl --with-ntlm-auth (without path) used, use default path
309 ntlm_auth="/usr/bin/ntlm_auth"
313 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 *** GSSAPI support ***
319 dnl **********************
321 AS_HELP_STRING([--with-gssapi],
322 [Build with GSSAPI support [default=auto]]))
324 if test "$with_gssapi" != "no"; then
325 AC_ARG_WITH(krb5-config,
326 AS_HELP_STRING([--with-krb5-config=PATH],[Where to look for krb5-config, path points to krb5-config installation (default: /usr/kerberos/bin/)]),
327 KRB5_CONFIG="$withval",
328 [AC_PATH_PROGS(KRB5_CONFIG, krb5-config, no, ${PATH}:/usr/kerberos/bin)])
330 if test "$KRB5_CONFIG" != "no"; then
331 KRB5_LIBS="`${KRB5_CONFIG} --libs gssapi`"
332 KRB5_CFLAGS="`${KRB5_CONFIG} --cflags gssapi`"
333 AC_SUBST(KRB5_CFLAGS)
335 if test "$KRB5_CONFIG" != none; then
336 AC_DEFINE(LIBSOUP_HAVE_GSSAPI, 1, [Whether or not GSSAPI libs are available])
339 if test "$with_gssapi" = "yes"; then
340 AC_MSG_ERROR([GSSAPI support requested but failed to found krb5-config. Try to set KRB5_CONFIG.])
345 dnl ****************************************************
346 dnl *** Warnings to show if using GCC ***
347 dnl *** (do this last so -Werror won't mess up tests ***
348 dnl ****************************************************
350 AC_ARG_ENABLE(more-warnings,
351 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
352 set_more_warnings=no)
354 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
356 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
357 -Werror=implicit-function-declaration \
358 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
359 -Wno-format-zero-length \
360 -Werror=missing-include-dirs -Werror=aggregate-return \
361 -Werror=declaration-after-statement"
364 ##################################################
365 # Visibility handling
366 ##################################################
368 SOUP_HIDDEN_VISIBILITY_CFLAGS=""
371 dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
372 AC_DEFINE([_SOUP_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
373 [defines how to decorate public symbols while building])
374 SOUP_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
377 dnl on other compilers, check if we can do -fvisibility=hidden
378 SAVED_CFLAGS="${CFLAGS}"
379 CFLAGS="-fvisibility=hidden"
380 AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
381 AC_TRY_COMPILE([], [return 0],
383 enable_fvisibility_hidden=yes,
385 enable_fvisibility_hidden=no)
386 CFLAGS="${SAVED_CFLAGS}"
388 AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
389 AC_DEFINE([_SOUP_EXTERN], [__attribute__((visibility("default"))) extern],
390 [defines how to decorate public symbols while building])
391 SOUP_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
395 AC_SUBST(SOUP_HIDDEN_VISIBILITY_CFLAGS)
397 dnl ****************************************************
398 dnl *** Check whether MSVC toolset is explicitly set ***
399 dnl ****************************************************
400 AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
401 AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
404 dnl *************************
405 dnl *** Output Everything ***
406 dnl *************************
408 AC_CONFIG_HEADERS([config.h])
421 docs/reference/Makefile
422 libsoup/soup-version.h
426 win32/vs9/soup-version-paths.vsprops
428 win32/vs10/soup-version-paths.props