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 # gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
159 # it on it's own line.
160 m4_ifdef([GTK_DOC_CHECK], [
161 GTK_DOC_CHECK([1.20], [--flavour no-tmpl])
164 dnl *****************************
165 dnl *** gobject-introspection ***
166 dnl *****************************
167 GOBJECT_INTROSPECTION_CHECK([0.9.5])
169 if test "$found_introspection" != "yes" -a "$enable_vala" = ""; then
174 AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
175 save_CFLAGS="$CFLAGS"
177 CFLAGS="$CFLAGS $GLIB_CFLAGS"
178 LIBS="$LIBS $GLIB_LIBS"
179 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
180 [return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
181 [have_glib_networking=yes],
182 [have_glib_networking=no],
183 [have_glib_networking="unknown (cross-compiling)"])
184 CFLAGS="$save_CFLAGS"
186 AC_MSG_RESULT($have_glib_networking)
188 AC_ARG_ENABLE(tls-check,
189 AS_HELP_STRING([--disable-tls-check], [Don't error out if glib-networking is unavailable]))
190 if test "$enable_tls_check" != "no" -a "$have_glib_networking" = "no"; then
191 AC_MSG_ERROR([libsoup requires glib-networking for TLS support.
193 If you are building a package, you can pass --disable-tls-check to
194 allow building libsoup anyway (since glib-networking is not actually
195 required at compile time), but you should be sure to add a runtime
199 dnl ******************************
200 dnl *** Stuff for regression tests
201 dnl ******************************
202 AC_MSG_NOTICE([checking for programs needed for regression tests])
204 AC_ARG_WITH(apache-httpd,
205 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
206 APACHE_HTTPD="$withval",
207 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
208 if test "$APACHE_HTTPD" != "no"; then
209 AC_MSG_CHECKING([Apache version])
210 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
211 case $apache_version in
213 AC_MSG_RESULT([$apache_version (ok)])
216 AC_MSG_RESULT([$apache_version (ignoring)])
221 AC_SUBST(APACHE_HTTPD)
222 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
224 if test "$APACHE_HTTPD" != "no"; then
225 AC_MSG_CHECKING([for Apache module directory])
226 AC_ARG_WITH(apache-module-dir,
227 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
228 apache_module_dirs="$withval",
229 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
230 mpm=`$APACHE_HTTPD -V -C "ServerName localhost" | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
231 # This only works with bash, but should fail harmlessly in sh
232 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
233 for dir in $apache_module_dirs; do
234 if test -f $dir/mod_auth_digest.so; then
235 APACHE_MODULE_DIR="$dir"
237 if test -f $dir/mod_ssl.so; then
238 APACHE_SSL_MODULE_DIR="$dir"
239 IF_HAVE_APACHE_SSL=""
241 if test -f $dir/libphp7.so; then
242 APACHE_PHP_MODULE_DIR="$dir"
245 AC_MSG_RESULT($APACHE_MODULE_DIR)
246 AC_SUBST(APACHE_MODULE_DIR)
247 AC_SUBST(APACHE_SSL_MODULE_DIR)
248 AC_SUBST(APACHE_PHP_MODULE_DIR)
251 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
252 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
257 AM_CONDITIONAL(HAVE_APACHE, test "$have_apache" = 1)
259 if test "$have_apache" = 1; then
260 AC_CHECK_PROGS(PHP, php)
262 AC_MSG_CHECKING([for Apache PHP module])
263 if test -d "$APACHE_PHP_MODULE_DIR"; then
270 AC_MSG_RESULT($have_php)
271 AC_SUBST(IF_HAVE_PHP)
273 if test "$have_php" = yes; then
274 AC_MSG_CHECKING([for php-xmlrpc])
275 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
279 AC_DEFINE(HAVE_PHP_XMLRPC, 1, [Have php-xmlrpc])
281 AC_MSG_RESULT($have_php_xmlrpc)
284 if test -f "$APACHE_MODULE_DIR/mod_unixd.so"; then
287 IF_HAVE_MOD_UNIXD="#"
289 AC_SUBST(IF_HAVE_MOD_UNIXD)
292 AC_PATH_PROG(CURL, curl, no)
293 if test "$CURL" != no; then
294 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
297 dnl **********************************************************
298 dnl *** path of NTLM single-sign-on helper ntlm_auth
299 dnl **********************************************************
300 AC_ARG_WITH(ntlm-auth,
301 AC_HELP_STRING([--with-ntlm-auth=PATH],[Where to look for ntlm_auth, path points to ntlm_auth installation (default: /usr/bin/ntlm_auth)]),
302 ntlm_auth="$withval",
303 [if test $os_win32 = yes; then ntlm_auth="no"; else ntlm_auth="/usr/bin/ntlm_auth"; fi])
304 if test "$ntlm_auth" != "no"; then
305 AC_DEFINE(USE_NTLM_AUTH, 1, [Whether or not use Samba's 'winbind' daemon helper 'ntlm_auth' for NTLM single-sign-on])
306 if test "$ntlm_auth" = "yes"; then
307 dnl --with-ntlm-auth (without path) used, use default path
308 ntlm_auth="/usr/bin/ntlm_auth"
312 AC_DEFINE_UNQUOTED(NTLM_AUTH, "$ntlm_auth", [Samba's 'winbind' daemon helper 'ntlm_auth' which can be used for NTLM single-sign-on])
316 dnl **********************
317 dnl *** GSSAPI support ***
318 dnl **********************
320 AS_HELP_STRING([--with-gssapi],
321 [Build with GSSAPI support [default=auto]]))
323 if test "$with_gssapi" != "no"; then
324 AC_ARG_WITH(krb5-config,
325 AS_HELP_STRING([--with-krb5-config=PATH],[Where to look for krb5-config, path points to krb5-config installation (default: /usr/kerberos/bin/)]),
326 KRB5_CONFIG="$withval",
327 [AC_PATH_PROGS(KRB5_CONFIG, krb5-config, no, ${PATH}:/usr/kerberos/bin)])
329 if test "$KRB5_CONFIG" != "no"; then
330 KRB5_LIBS="`${KRB5_CONFIG} --libs gssapi`"
331 KRB5_CFLAGS="`${KRB5_CONFIG} --cflags gssapi`"
332 AC_SUBST(KRB5_CFLAGS)
334 if test "$KRB5_CONFIG" != none; then
335 AC_DEFINE(LIBSOUP_HAVE_GSSAPI, 1, [Whether or not GSSAPI libs are available])
338 if test "$with_gssapi" = "yes"; then
339 AC_MSG_ERROR([GSSAPI support requested but failed to found krb5-config. Try to set KRB5_CONFIG.])
344 dnl ****************************************************
345 dnl *** Warnings to show if using GCC ***
346 dnl *** (do this last so -Werror won't mess up tests ***
347 dnl ****************************************************
349 AC_ARG_ENABLE(more-warnings,
350 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
351 set_more_warnings=no)
353 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
355 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
356 -Werror=implicit-function-declaration \
357 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
358 -Wno-format-zero-length \
359 -Werror=missing-include-dirs -Werror=aggregate-return \
360 -Werror=declaration-after-statement"
363 ##################################################
364 # Visibility handling
365 ##################################################
367 SOUP_HIDDEN_VISIBILITY_CFLAGS=""
370 dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
371 AC_DEFINE([_SOUP_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
372 [defines how to decorate public symbols while building])
373 SOUP_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
376 dnl on other compilers, check if we can do -fvisibility=hidden
377 SAVED_CFLAGS="${CFLAGS}"
378 CFLAGS="-fvisibility=hidden"
379 AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
380 AC_TRY_COMPILE([], [return 0],
382 enable_fvisibility_hidden=yes,
384 enable_fvisibility_hidden=no)
385 CFLAGS="${SAVED_CFLAGS}"
387 AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
388 AC_DEFINE([_SOUP_EXTERN], [__attribute__((visibility("default"))) extern],
389 [defines how to decorate public symbols while building])
390 SOUP_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
394 AC_SUBST(SOUP_HIDDEN_VISIBILITY_CFLAGS)
396 dnl ****************************************************
397 dnl *** Check whether MSVC toolset is explicitly set ***
398 dnl ****************************************************
399 AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
400 AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
403 dnl *************************
404 dnl *** Output Everything ***
405 dnl *************************
407 AC_CONFIG_HEADERS([config.h])
420 docs/reference/Makefile
421 libsoup/soup-version.h
425 win32/vs9/soup-version-paths.vsprops
427 win32/vs10/soup-version-paths.props