1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
5 m4_define([soup_major_version], [2])
6 m4_define([soup_minor_version], [46])
7 m4_define([soup_micro_version], [0])
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])
109 CFLAGS="$CFLAGS -D_REENTRANT"
115 AC_MSG_RESULT([$os_win32])
116 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
118 dnl ************************
119 dnl *** gettext/intltool ***
120 dnl ************************
121 IT_PROG_INTLTOOL([0.35.0])
122 GETTEXT_PACKAGE=libsoup
123 AC_SUBST([GETTEXT_PACKAGE])
124 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
126 dnl *******************
127 dnl *** Misc checks ***
128 dnl *******************
129 AC_CHECK_FUNCS(gmtime_r)
131 dnl *********************
132 dnl *** GNOME support ***
133 dnl *********************
134 AC_MSG_CHECKING(whether to build libsoup-gnome)
136 AS_HELP_STRING([--without-gnome], [Do not build libsoup-gnome]),
137 :, [if test $os_win32 = yes; then with_gnome=no; else with_gnome=yes; fi])
138 AC_MSG_RESULT($with_gnome)
140 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
142 if test $with_gnome != no; then
143 AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
151 GTK_DOC_CHECK([1.10])
153 dnl *****************************
154 dnl *** gobject-introspection ***
155 dnl *****************************
156 GOBJECT_INTROSPECTION_CHECK([0.9.5])
158 AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
159 save_CFLAGS="$CFLAGS"
161 CFLAGS="$CFLAGS $GLIB_CFLAGS"
162 LIBS="$LIBS $GLIB_LIBS"
163 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
164 [return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
165 [have_glib_networking=yes],
166 [have_glib_networking=no],
167 [have_glib_networking="unknown (cross-compiling)"])
168 CFLAGS="$save_CFLAGS"
170 AC_MSG_RESULT($have_glib_networking)
172 AC_ARG_ENABLE(tls-check,
173 AS_HELP_STRING([--disable-tls-check], [Don't error out if glib-networking is unavailable]))
174 if test "$enable_tls_check" != "no" -a "$have_glib_networking" = "no"; then
175 AC_MSG_ERROR([libsoup requires glib-networking for TLS support.
177 If you are building a package, you can pass --disable-tls-check to
178 allow building libsoup anyway (since glib-networking is not actually
179 required at compile time), but you should be sure to add a runtime
183 dnl ******************************
184 dnl *** Stuff for regression tests
185 dnl ******************************
186 AC_MSG_NOTICE([checking for programs needed for regression tests])
188 AC_ARG_WITH(apache-httpd,
189 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
190 APACHE_HTTPD="$withval",
191 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
192 if test "$APACHE_HTTPD" != "no"; then
193 AC_MSG_CHECKING([Apache version])
194 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
195 case $apache_version in
197 AC_MSG_RESULT([$apache_version (ok)])
201 AC_MSG_RESULT([$apache_version (ok)])
205 AC_MSG_RESULT([$apache_version (ignoring)])
210 AC_SUBST(APACHE_HTTPD)
211 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
213 if test "$APACHE_HTTPD" != "no"; then
214 AC_MSG_CHECKING([for Apache module directory])
215 AC_ARG_WITH(apache-module-dir,
216 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
217 apache_module_dirs="$withval",
218 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
219 mpm=`$APACHE_HTTPD -V -C "ServerName localhost" | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
220 # This only works with bash, but should fail harmlessly in sh
221 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
222 for dir in $apache_module_dirs; do
223 if test -f $dir/mod_auth_digest.so; then
224 APACHE_MODULE_DIR="$dir"
226 if test -f $dir/mod_ssl.so; then
227 APACHE_SSL_MODULE_DIR="$dir"
228 IF_HAVE_APACHE_SSL=""
230 if test -f $dir/mod_php5.so; then
231 APACHE_PHP_MODULE_DIR="$dir"
232 APACHE_PHP_MODULE=mod_php5.so
234 if test -f $dir/libphp5.so; then
235 APACHE_PHP_MODULE_DIR="$dir"
236 APACHE_PHP_MODULE=libphp5.so
239 AC_MSG_RESULT($APACHE_MODULE_DIR)
240 AC_SUBST(APACHE_MODULE_DIR)
241 AC_SUBST(APACHE_SSL_MODULE_DIR)
242 AC_SUBST(APACHE_PHP_MODULE_DIR)
243 AC_SUBST(APACHE_PHP_MODULE)
246 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
247 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
248 if test $apache_version = 2.2; then
249 AC_DEFINE(HAVE_APACHE_2_2, 1, [Apache is 2.2.x])
251 AC_DEFINE(HAVE_APACHE_2_4, 1, [Apache is 2.4.x])
257 AM_CONDITIONAL(HAVE_APACHE, test "$have_apache" = 1)
258 AM_CONDITIONAL(HAVE_APACHE_2_2, test "$apache_version" = 2.2)
259 AM_CONDITIONAL(HAVE_APACHE_2_4, test "$apache_version" = 2.4)
261 if test "$have_apache" = 1; then
262 AC_CHECK_PROGS(PHP, php php5)
264 AC_MSG_CHECKING([for Apache PHP module])
265 if test -f $APACHE_PHP_MODULE_DIR/$APACHE_PHP_MODULE; then
272 AC_MSG_RESULT($have_php)
273 AC_SUBST(IF_HAVE_PHP)
275 if test "$have_php" = yes; then
276 AC_MSG_CHECKING([for php-xmlrpc])
277 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
281 AC_DEFINE(HAVE_PHP_XMLRPC, 1, [Have php-xmlrpc])
283 AC_MSG_RESULT($have_php_xmlrpc)
287 AC_PATH_PROG(CURL, curl, no)
288 if test "$CURL" != no; then
289 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
292 dnl **********************************************************
293 dnl *** path of NTLM single-sign-on helper ntlm_auth
294 dnl **********************************************************
295 AC_ARG_WITH(ntlm-auth,
296 AC_HELP_STRING([--with-ntlm-auth=PATH],[Where to look for ntlm_auth, path points to ntlm_auth installation (default: /usr/bin/ntlm_auth)]),
297 ntlm_auth="$withval",
298 [if test $os_win32 = yes; then ntlm_auth="no"; else ntlm_auth="/usr/bin/ntlm_auth"; fi])
299 if test "$ntlm_auth" != "no"; then
300 AC_DEFINE(USE_NTLM_AUTH, 1, [Whether or not use Samba's 'winbind' daemon helper 'ntlm_auth' for NTLM single-sign-on])
301 if test "$ntlm_auth" = "yes"; then
302 dnl --with-ntlm-auth (without path) used, use default path
303 ntlm_auth="/usr/bin/ntlm_auth"
307 AC_DEFINE_UNQUOTED(NTLM_AUTH, "$ntlm_auth", [Samba's 'winbind' daemon helper 'ntlm_auth' which can be used for NTLM single-sign-on])
309 dnl ****************************************************
310 dnl *** Warnings to show if using GCC ***
311 dnl *** (do this last so -Werror won't mess up tests ***
312 dnl ****************************************************
314 AC_ARG_ENABLE(more-warnings,
315 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
316 set_more_warnings=no)
318 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
320 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
321 -Werror=implicit-function-declaration \
322 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
323 -Wno-format-zero-length \
324 -Werror=missing-include-dirs -Werror=aggregate-return \
325 -Werror=declaration-after-statement"
328 dnl *************************
329 dnl *** Output Everything ***
330 dnl *************************
332 AC_CONFIG_HEADERS([config.h])
344 docs/reference/Makefile
345 libsoup/soup-version.h