1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
6 AC_INIT(libsoup, 2.3.0)
7 AC_CONFIG_SRCDIR(libsoup.pc.in)
8 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
10 AM_CONFIG_HEADER(config.h)
15 AC_SUBST(SOUP_API_VERSION)
17 # Increment on interface addition. Reset on removal.
20 # Increment on interface add, remove, or change.
23 # Increment on source change. Reset when CURRENT changes.
26 AC_SUBST(SOUP_CURRENT)
27 AC_SUBST(SOUP_REVISION)
30 dnl ***************************
31 dnl *** Set debugging flags ***
32 dnl ***************************
36 # Declare --enable-* args and collect ac_help strings
38 [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,
39 enable_debug=$debug_default)
42 if test "x$enable_debug" = "xyes"; then
43 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
44 SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
46 if test "x$enable_debug" = "xno"; then
47 SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
51 AC_SUBST(SOUP_DEBUG_FLAGS)
54 dnl ***************************
55 dnl *** Checks for programs ***
56 dnl ***************************
69 # This isn't a program, but it doesn't fit anywhere else...
72 dnl ***********************
73 dnl *** Checks for glib ***
74 dnl ***********************
76 AM_PATH_GLIB_2_0(2.15.0,,,gobject gthread gio)
78 PKG_CHECK_MODULES(XML, libxml-2.0)
82 dnl ***********************
83 dnl *** Check for Win32 ***
84 dnl ***********************
86 AC_MSG_CHECKING([for Win32])
90 # Don't do this yet, as we want to support Windows 2000 which
92 # AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes])
93 # AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes])
94 # AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes])
95 # AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes])
96 # AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes])
102 AC_MSG_RESULT([$os_win32])
103 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
105 dnl *******************
106 dnl *** Misc checks ***
107 dnl *******************
108 AC_CHECK_FUNCS(gmtime_r)
109 AC_CHECK_FUNCS(timegm)
111 dnl *********************************
112 dnl *** Networking library checks ***
113 dnl *********************************
115 AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
116 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
118 AC_CHECK_FUNCS(inet_pton inet_ntop inet_aton getaddrinfo getnameinfo)
120 AC_CACHE_CHECK(IPv6 support, soup_cv_ipv6, [
121 AC_EGREP_HEADER(sockaddr_in6, netinet/in.h, soup_cv_ipv6=yes, soup_cv_ipv6=no)
123 case $soup_cv_ipv6 in
125 AC_DEFINE(HAVE_IPV6, 1, [Define if you have support for IPv6 sockets])
129 dnl **********************************
130 dnl *** SSL Library check (GnuTLS) ***
131 dnl **********************************
134 [ --enable-ssl Turn on Secure Sockets Layer support [default=yes]],,
137 if test "$enable_ssl" != "no"; then
138 PKG_CHECK_MODULES(LIBGNUTLS, gnutls,
139 [AM_PATH_LIBGCRYPT([], have_ssl=yes, have_ssl=no)], have_ssl=no)
140 if test "$have_ssl" = "yes"; then
141 AC_DEFINE(HAVE_SSL, 1, [Defined if you have SSL support])
142 SSL_REQUIREMENT="gnutls"
144 if test "$enable_ssl" = "auto"; then
145 AC_MSG_WARN(Disabling SSL support);
148 AC_MSG_ERROR(Could not configure SSL support);
153 AC_SUBST(LIBGNUTLS_CFLAGS)
154 AC_SUBST(LIBGNUTLS_LIBS)
155 AC_SUBST(SSL_REQUIREMENT)
157 dnl This is not supposed to be conditional, but...
158 AM_CONDITIONAL(HAVE_SSL, test $enable_ssl != no)
166 dnl *************************************
167 dnl *** Warnings to show if using GCC ***
168 dnl *************************************
170 AC_ARG_ENABLE(more-warnings,
171 [ --disable-more-warnings Inhibit compiler warnings],
172 set_more_warnings=no)
174 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
176 -Wall -Wstrict-prototypes -Wmissing-declarations \
177 -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
180 if test "$os_win32" != yes; then
181 # Use reentrant functions (FIXME!)
182 CFLAGS="$CFLAGS -D_REENTRANT"
185 dnl *************************************
186 dnl *** Apache (for regression tests) ***
187 dnl *************************************
189 AC_ARG_WITH(apache-httpd,
190 [ --with-apache-httpd Path to apache httpd (for tests)],
191 APACHE_HTTPD="$withval",
192 [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd, no, ${PATH}:/usr/sbin)])
193 if test "$APACHE_HTTPD" != "no"; then
194 AC_MSG_CHECKING([Apache version])
195 apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'`
196 case $apache_version in
198 AC_MSG_RESULT([$apache_version (ok)])
201 AC_MSG_RESULT([$apache_version (ignoring)])
206 AC_SUBST(APACHE_HTTPD)
207 AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd])
209 if test "$APACHE_HTTPD" != "no"; then
210 AC_MSG_CHECKING([for Apache module directory])
211 AC_ARG_WITH(apache-module-dir,
212 [ --with-apache-module-dir Apache modules dir (for tests)],
213 APACHE_MODULE_DIR="$withval",
214 [apache_prefix=`dirname \`dirname $APACHE_HTTPD\``
215 mpm=`$APACHE_HTTPD -V | sed -ne 's/^Server MPM: */-/p' | tr 'A-Z' 'a-z'`
216 # This only works with bash, but should fail harmlessly in sh
217 for dir in $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}; do
218 if test -f $dir/mod_auth_digest.so; then
219 APACHE_MODULE_DIR="$dir"
221 if test -f $dir/mod_ssl.so; then
222 APACHE_SSL_MODULE_DIR="$dir"
224 if test -f $dir/mod_php5.so; then
225 APACHE_PHP_MODULE_DIR="$dir"
226 APACHE_PHP_MODULE=mod_php5.so
228 if test -f $dir/libphp5.so; then
229 APACHE_PHP_MODULE_DIR="$dir"
230 APACHE_PHP_MODULE=libphp5.so
233 AC_MSG_RESULT($APACHE_MODULE_DIR)
234 AC_SUBST(APACHE_MODULE_DIR)
235 AC_SUBST(APACHE_SSL_MODULE_DIR)
236 AC_SUBST(APACHE_PHP_MODULE_DIR)
237 AC_SUBST(APACHE_PHP_MODULE)
240 if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR"; then
241 AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests])
246 AM_CONDITIONAL(HAVE_APACHE, test $have_apache = 1)
248 if test "$have_apache" = 1; then
249 AC_CHECK_PROGS(PHP, php php5)
251 AC_MSG_CHECKING([for Apache PHP module])
252 if test -f $APACHE_PHP_MODULE_DIR/$APACHE_PHP_MODULE; then
259 AC_MSG_RESULT($have_php)
261 if test "$have_php" = yes; then
262 AC_MSG_CHECKING([for xmlrpc-epi-php])
263 if $PHP --rf xmlrpc_server_create | grep -q "does not exist"; then
264 have_xmlrpc_epi_php=no
266 have_xmlrpc_epi_php=yes
268 AC_MSG_RESULT($have_xmlrpc_epi_php)
272 AC_SUBST(IF_HAVE_PHP)
273 AM_CONDITIONAL(HAVE_XMLRPC_EPI_PHP, test "$have_xmlrpc_epi_php" = yes)
275 dnl *******************************
276 dnl *** curl (for regression tests)
277 dnl *******************************
278 AC_PATH_PROG(CURL, curl, no)
279 if test "$CURL" != no; then
280 AC_DEFINE(HAVE_CURL, 1, [Whether or not curl can be used for tests])
282 AM_CONDITIONAL(HAVE_CURL, test "$CURL" != no)
284 dnl *************************
285 dnl *** Output Everything ***
286 dnl *************************
296 docs/reference/Makefile