dnl ******************************************* dnl *** Initialize automake and set version *** dnl ******************************************* AC_PREREQ(2.53) AC_INIT(libsoup, 2.2.100) AC_CONFIG_SRCDIR(libsoup.pc.in) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_PROG_MAKE_SET SOUP_API_VERSION=2.2 AC_SUBST(SOUP_API_VERSION) # Increment on interface addition. Reset on removal. SOUP_AGE=5 # Increment on interface add, remove, or change. SOUP_CURRENT=13 # Increment on source change. Reset when CURRENT changes. SOUP_REVISION=0 AC_SUBST(SOUP_CURRENT) AC_SUBST(SOUP_REVISION) AC_SUBST(SOUP_AGE) dnl *************************** dnl *** Set debugging flags *** dnl *************************** debug_default=minimum # Declare --enable-* args and collect ac_help strings AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],, enable_debug=$debug_default) # Set the debug flags if test "x$enable_debug" = "xyes"; then test "$cflags_set" = set || CFLAGS="$CFLAGS -g" SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG" else if test "x$enable_debug" = "xno"; then SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" fi fi AC_SUBST(SOUP_DEBUG_FLAGS) dnl *************************** dnl *** Checks for programs *** dnl *************************** AC_PROG_CC AM_PROG_CC_STDC AC_PROG_INSTALL # Set STDC_HEADERS AC_HEADER_STDC # Initialize libtool AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL # This isn't a program, but it doesn't fit anywhere else... AC_FUNC_ALLOCA dnl *********************** dnl *** Checks for glib *** dnl *********************** AM_PATH_GLIB_2_0(2.6.0,,,gobject gthread) PKG_CHECK_MODULES(XML, libxml-2.0) AC_SUBST(XML_CFLAGS) AC_SUBST(XML_LIBS) dnl *********************** dnl *** Check for Win32 *** dnl *********************** AC_MSG_CHECKING([for Win32]) case "$host" in *-*-mingw*) os_win32=yes # Don't do this yet, as we want to support Windows 2000 which # doesn't have these. # AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes]) # AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes]) # AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes]) # AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes]) # AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes]) ;; *) os_win32=no ;; esac AC_MSG_RESULT([$os_win32]) AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes]) dnl ******************* dnl *** Misc checks *** dnl ******************* AC_CHECK_FUNCS(gmtime_r) dnl ********************************* dnl *** Networking library checks *** dnl ********************************* AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNCS(inet_pton inet_ntop inet_aton getaddrinfo getnameinfo) AC_CACHE_CHECK(IPv6 support, soup_cv_ipv6, [ AC_EGREP_HEADER(sockaddr_in6, netinet/in.h, soup_cv_ipv6=yes, soup_cv_ipv6=no) ]) case $soup_cv_ipv6 in yes) AC_DEFINE(HAVE_IPV6, 1, [Define if you have support for IPv6 sockets]) ;; esac dnl ********************************** dnl *** SSL Library check (GnuTLS) *** dnl ********************************** AC_ARG_ENABLE(ssl, [ --enable-ssl Turn on Secure Sockets Layer support [default=yes]],, enable_ssl=auto) if test "$enable_ssl" != "no"; then PKG_CHECK_MODULES(LIBGNUTLS, gnutls, have_ssl=yes, have_ssl=no) if test "$have_ssl" = "yes"; then AC_DEFINE(HAVE_SSL, 1, [Defined if you have SSL support]) SSL_REQUIREMENT="gnutls" else if test "$enable_ssl" = "auto"; then AC_MSG_WARN(Disabling SSL support); enable_ssl=no; else AC_MSG_ERROR(Could not configure SSL support); fi fi fi AC_SUBST(LIBGNUTLS_CFLAGS) AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(SSL_REQUIREMENT) dnl *************** dnl *** gtk-doc *** dnl *************** GTK_DOC_CHECK([1.0]) dnl ************************************* dnl *** Warnings to show if using GCC *** dnl ************************************* AC_ARG_ENABLE(more-warnings, [ --disable-more-warnings Inhibit compiler warnings], set_more_warnings=no) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then CFLAGS="$CFLAGS \ -Wall -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith" fi if test "$os_win32" != yes; then # Use reentrant functions (FIXME!) CFLAGS="$CFLAGS -D_REENTRANT" fi dnl ************************************* dnl *** Apache (for regression tests) *** dnl ************************************* AC_ARG_WITH(apache-httpd, [ --with-apache-httpd Path to apache httpd (for tests)], APACHE_HTTPD="$withval", [AC_PATH_PROGS(APACHE_HTTPD, httpd2 httpd, no, ${PATH}:/usr/sbin)]) if test "$APACHE_HTTPD" != "no"; then AC_MSG_CHECKING([Apache version]) apache_version=`$APACHE_HTTPD -v 2>/dev/null | sed -ne 's/Server version: Apache\///p'` case $apache_version in 2.2.*) AC_MSG_RESULT([$apache_version (ok)]) ;; *) AC_MSG_RESULT([$apache_version (ignoring)]) APACHE_HTTPD="no" ;; esac fi AC_SUBST(APACHE_HTTPD) AC_DEFINE_UNQUOTED(APACHE_HTTPD, "$APACHE_HTTPD", [Apache httpd]) if test "$APACHE_HTTPD" != "no"; then AC_MSG_CHECKING([for Apache module directory]) AC_ARG_WITH(apache-module-dir, [ --with-apache-module-dir Apache modules dir (for tests)], APACHE_MODULE_DIR="$withval", [apache_prefix=`dirname \`dirname $APACHE_HTTPD\`` # This only works with bash, but should fail harmlessly in sh for dir in $apache_prefix/lib{64,}/{apache,http}{2,}{/modules,}; do if test -f $dir/mod_auth_digest.so; then APACHE_MODULE_DIR="$dir" break fi done]) AC_MSG_RESULT($APACHE_MODULE_DIR) AC_SUBST(APACHE_MODULE_DIR) fi if test "$APACHE_HTTPD" != "no" -a -n "$APACHE_MODULE_DIR"; then AC_DEFINE(HAVE_APACHE, 1, [Whether or not apache can be used for tests]) have_apache=1 else have_apache=0 fi AM_CONDITIONAL(HAVE_APACHE, test $have_apache = 1) if test "$have_apache" = 1; then AC_MSG_CHECKING([for mod_php5]) if test -f $APACHE_MODULE_DIR/mod_php5.so; then have_php=yes IF_HAVE_PHP="" else have_php=no IF_HAVE_PHP="#" fi AC_MSG_RESULT($have_php) if test "$have_php" = yes; then AC_MSG_CHECKING([for xmlrpc-epi-php]) if php5 --rf xmlrpc_server_create | grep -q "does not exist"; then have_xmlrpc_epi_php=no else have_xmlrpc_epi_php=yes fi AC_MSG_RESULT($have_xmlrpc_epi_php) fi fi AC_SUBST(IF_HAVE_PHP) AM_CONDITIONAL(HAVE_XMLRPC_EPI_PHP, test "$have_xmlrpc_epi_php" = yes) dnl ************************* dnl *** Output Everything *** dnl ************************* AC_OUTPUT([ libsoup.pc Makefile libsoup-zip libsoup/Makefile tests/Makefile tests/httpd.conf docs/Makefile docs/reference/Makefile ])