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 *** SQL Lite support independently of gnome for Tizen ***
133 dnl *************************
135 AC_ARG_ENABLE(sqlite,
136 AS_HELP_STRING([--enable-sqlite], [Enable SQL lite support ]), ,
139 if test "$enable_sqlite" != "no"; then
140 PKG_CHECK_MODULES(SQLITE, sqlite3, :, [AC_MSG_ERROR(dnl
141 [Could not find sqlite3 devel files:
145 Pass "--without-sqlite" to configure if you want to build libsoup
146 without sql lite support.])])
150 AC_SUBST(SQLITE_CFLAGS)
151 AC_SUBST(SQLITE_LIBS)
153 AM_CONDITIONAL(SQLLITE_SUPPORT, [test $enable_sqllite = yes])
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 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
166 if test $with_gnome != no; then
167 AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
175 dnl GTK_DOC_CHECK([1.10])
177 dnl *****************************
178 dnl *** gobject-introspection ***
179 dnl *****************************
180 GOBJECT_INTROSPECTION_CHECK([0.9.5])
182 AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
183 save_CFLAGS="$CFLAGS"
185 CFLAGS="$CFLAGS $GLIB_CFLAGS"
186 LIBS="$LIBS $GLIB_LIBS"
187 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
188 [return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
189 [have_glib_networking=yes],
190 [have_glib_networking=no],
191 [have_glib_networking="unknown (cross-compiling)"])
192 CFLAGS="$save_CFLAGS"
194 AC_MSG_RESULT($have_glib_networking)
196 AC_ARG_ENABLE(tls-check,
197 AS_HELP_STRING([--disable-tls-check], [Don't error out if glib-networking is unavailable]))
198 if test "$enable_tls_check" != "no" -a "$have_glib_networking" = "no"; then
199 AC_MSG_ERROR([libsoup requires glib-networking for TLS support.
201 If you are building a package, you can pass --disable-tls-check to
202 allow building libsoup anyway (since glib-networking is not actually
203 required at compile time), but you should be sure to add a runtime
207 dnl ******************************
208 dnl *** Stuff for regression tests
209 dnl ******************************
210 AC_MSG_NOTICE([checking for programs needed for regression tests])
212 AC_ARG_WITH(apache-httpd,
213 AS_HELP_STRING([--with-apache-httpd], [Path to apache httpd (for tests)]),
214 APACHE_HTTPD="$withval",
215 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd apache2 apache, no, ${PATH}:/usr/sbin)])
216 if test "$APACHE_HTTPD" != "no"; then
217 AC_MSG_CHECKING([Apache version])
218 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
219 case $apache_version in
221 AC_MSG_RESULT([$apache_version (ok)])
225 AC_MSG_RESULT([$apache_version (ok)])
229 AC_MSG_RESULT([$apache_version (ignoring)])
234 AC_SUBST(APACHE_HTTPD)
235 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
237 if test "$APACHE_HTTPD" != "no"; then
238 AC_MSG_CHECKING([for Apache module directory])
239 AC_ARG_WITH(apache-module-dir,
240 AS_HELP_STRING([--with-apache-module-dir], [Apache modules dirs (for tests)]),
241 apache_module_dirs="$withval",
242 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
243 mpm=`$APACHE_HTTPD -V -C "ServerName localhost" | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
244 # This only works with bash, but should fail harmlessly in sh
245 apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`])
246 for dir in $apache_module_dirs; do
247 if test -f $dir/mod_auth_digest.so; then
248 APACHE_MODULE_DIR="$dir"
250 if test -f $dir/mod_ssl.so; then
251 APACHE_SSL_MODULE_DIR="$dir"
252 IF_HAVE_APACHE_SSL=""
254 if test -f $dir/mod_php5.so; then
255 APACHE_PHP_MODULE_DIR="$dir"
256 APACHE_PHP_MODULE=mod_php5.so
258 if test -f $dir/libphp5.so; then
259 APACHE_PHP_MODULE_DIR="$dir"
260 APACHE_PHP_MODULE=libphp5.so
263 AC_MSG_RESULT($APACHE_MODULE_DIR)
264 AC_SUBST(APACHE_MODULE_DIR)
265 AC_SUBST(APACHE_SSL_MODULE_DIR)
266 AC_SUBST(APACHE_PHP_MODULE_DIR)
267 AC_SUBST(APACHE_PHP_MODULE)
270 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR" -a -n "$APACHE_SSL_MODULE_DIR"; then
271 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
272 if test $apache_version = 2.2; then
273 AC_DEFINE(HAVE_APACHE_2_2, 1, [Apache is 2.2.x])
275 AC_DEFINE(HAVE_APACHE_2_4, 1, [Apache is 2.4.x])
281 AM_CONDITIONAL(HAVE_APACHE, test "$have_apache" = 1)
282 AM_CONDITIONAL(HAVE_APACHE_2_2, test "$apache_version" = 2.2)
283 AM_CONDITIONAL(HAVE_APACHE_2_4, test "$apache_version" = 2.4)
285 if test "$have_apache" = 1; then
286 AC_CHECK_PROGS(PHP, php php5)
288 AC_MSG_CHECKING([for Apache PHP module])
289 if test -f $APACHE_PHP_MODULE_DIR/$APACHE_PHP_MODULE; then
296 AC_MSG_RESULT($have_php)
297 AC_SUBST(IF_HAVE_PHP)
299 if test "$have_php" = yes; then
300 AC_MSG_CHECKING([for php-xmlrpc])
301 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
305 AC_DEFINE(HAVE_PHP_XMLRPC, 1, [Have php-xmlrpc])
307 AC_MSG_RESULT($have_php_xmlrpc)
311 AC_PATH_PROG(CURL, curl, no)
312 if test "$CURL" != no; then
313 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
316 dnl **********************************************************
317 dnl *** path of NTLM single-sign-on helper ntlm_auth
318 dnl **********************************************************
319 AC_ARG_WITH(ntlm-auth,
320 AC_HELP_STRING([--with-ntlm-auth=PATH],[Where to look for ntlm_auth, path points to ntlm_auth installation (default: /usr/bin/ntlm_auth)]),
321 ntlm_auth="$withval",
322 [if test $os_win32 = yes; then ntlm_auth="no"; else ntlm_auth="/usr/bin/ntlm_auth"; fi])
323 if test "$ntlm_auth" != "no"; then
324 AC_DEFINE(USE_NTLM_AUTH, 1, [Whether or not use Samba's 'winbind' daemon helper 'ntlm_auth' for NTLM single-sign-on])
325 if test "$ntlm_auth" = "yes"; then
326 dnl --with-ntlm-auth (without path) used, use default path
327 ntlm_auth="/usr/bin/ntlm_auth"
331 AC_DEFINE_UNQUOTED(NTLM_AUTH, "$ntlm_auth", [Samba's 'winbind' daemon helper 'ntlm_auth' which can be used for NTLM single-sign-on])
333 dnl ****************************************************
334 dnl *** Warnings to show if using GCC ***
335 dnl *** (do this last so -Werror won't mess up tests ***
336 dnl ****************************************************
338 AC_ARG_ENABLE(more-warnings,
339 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
340 set_more_warnings=no)
342 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
344 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
345 -Werror=implicit-function-declaration \
346 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
347 -Wno-format-zero-length \
348 -Werror=missing-include-dirs -Werror=aggregate-return \
349 -Werror=declaration-after-statement"
352 dnl *************************
353 dnl *** Output Everything ***
354 dnl *************************
356 AC_CONFIG_HEADERS([config.h])
368 docs/reference/Makefile
369 libsoup/soup-version.h