[18148] | 1 | dnl ******************************************* |
---|
| 2 | dnl *** Initialize automake and set version *** |
---|
| 3 | dnl ******************************************* |
---|
| 4 | |
---|
| 5 | AC_INIT(src/libsoup/soup.h) |
---|
| 6 | |
---|
| 7 | # Increment on interface addition. Reset on removal. |
---|
| 8 | SOUP_AGE=3 |
---|
| 9 | |
---|
| 10 | # Increment on interface add, remove, or change. |
---|
| 11 | SOUP_CURRENT=6 |
---|
| 12 | |
---|
| 13 | # Increment on source change. Reset when CURRENT changes. |
---|
| 14 | SOUP_REVISION=4 |
---|
| 15 | |
---|
| 16 | AC_SUBST(SOUP_CURRENT) |
---|
| 17 | AC_SUBST(SOUP_REVISION) |
---|
| 18 | AC_SUBST(SOUP_AGE) |
---|
| 19 | |
---|
| 20 | # Update in src/libsoup/soup-private.h for Windows |
---|
| 21 | AM_INIT_AUTOMAKE(soup, 0.7.10) |
---|
| 22 | |
---|
| 23 | AM_CONFIG_HEADER(config.h) |
---|
| 24 | AM_MAINTAINER_MODE |
---|
| 25 | AC_PROG_MAKE_SET |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | dnl *************************** |
---|
| 29 | dnl *** Set debugging flags *** |
---|
| 30 | dnl *************************** |
---|
| 31 | |
---|
| 32 | debug_default=minimum |
---|
| 33 | |
---|
| 34 | # Declare --enable-* args and collect ac_help strings |
---|
| 35 | AC_ARG_ENABLE(debug, |
---|
| 36 | [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],, |
---|
| 37 | enable_debug=$debug_default) |
---|
| 38 | |
---|
| 39 | # Set the debug flags |
---|
| 40 | if test "x$enable_debug" = "xyes"; then |
---|
| 41 | test "$cflags_set" = set || CFLAGS="$CFLAGS -g" |
---|
| 42 | SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG" |
---|
| 43 | else |
---|
| 44 | if test "x$enable_debug" = "xno"; then |
---|
| 45 | SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" |
---|
| 46 | fi |
---|
| 47 | fi |
---|
| 48 | |
---|
| 49 | AC_SUBST(SOUP_DEBUG_FLAGS) |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | dnl *************************** |
---|
| 53 | dnl *** Checks for programs *** |
---|
| 54 | dnl *************************** |
---|
| 55 | |
---|
| 56 | AC_PROG_CC |
---|
| 57 | AM_PROG_CC_STDC |
---|
| 58 | AC_PROG_INSTALL |
---|
| 59 | |
---|
| 60 | # Set STDC_HEADERS |
---|
| 61 | AC_HEADER_STDC |
---|
| 62 | |
---|
| 63 | # Initialize libtool |
---|
| 64 | AM_PROG_LIBTOOL |
---|
| 65 | |
---|
| 66 | # This isn't a program, but it doesn't fit anywhere else... |
---|
| 67 | AC_FUNC_ALLOCA |
---|
| 68 | |
---|
| 69 | dnl *********************** |
---|
| 70 | dnl *** Checks for glib *** |
---|
| 71 | dnl *********************** |
---|
| 72 | |
---|
| 73 | AC_MSG_CHECKING(whether to build against glib 2.0) |
---|
| 74 | AC_ARG_ENABLE(glib2, [\ |
---|
| 75 | --enable-glib2 Build Soup against glib 2.0], , |
---|
| 76 | enable_glib2=no) |
---|
| 77 | AC_MSG_RESULT($enable_glib2) |
---|
| 78 | |
---|
| 79 | if test x"$enable_glib2" != xno; then |
---|
| 80 | AM_PATH_GLIB_2_0(2.0.0,, AC_MSG_ERROR([Cannot find glib 2.0])) |
---|
| 81 | GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0` |
---|
| 82 | GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0` |
---|
| 83 | GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0` |
---|
| 84 | FAVOUR_LIBXML=2 |
---|
| 85 | SOUP_PKGCONFIG_REQUIRES="glib-2.0" |
---|
| 86 | AC_SUBST(SOUP_PKGCONFIG_REQUIRES) |
---|
| 87 | AC_DEFINE(SOUP_GLIB2) |
---|
| 88 | else |
---|
| 89 | AM_PATH_GLIB(1.2.0,, |
---|
| 90 | AC_MSG_ERROR([Cannot find GLIB: Is glib-config in path?])) |
---|
| 91 | GLIB_CFLAGS=`glib-config --cflags glib` |
---|
| 92 | GLIB_LIBS=`glib-config --libs glib` |
---|
| 93 | GMODULE_LIBS=`glib-config --libs gmodule` |
---|
| 94 | FAVOUR_LIBXML=1 |
---|
| 95 | SOUP_PKGCONFIG_REQUIRES="glib" |
---|
| 96 | AC_SUBST(SOUP_PKGCONFIG_REQUIRES) |
---|
| 97 | fi |
---|
| 98 | |
---|
| 99 | AC_SUBST(GLIB_CFLAGS) |
---|
| 100 | AC_SUBST(GLIB_LIBS) |
---|
| 101 | AC_SUBST(GMODULE_LIBS) |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | dnl **************************** |
---|
| 105 | dnl *** Checks for gnome-xml *** |
---|
| 106 | dnl **************************** |
---|
| 107 | |
---|
| 108 | AC_ARG_WITH(libxml, |
---|
| 109 | [ --with-libxml=[1/2] which version of libxml to use [default=$FAVOUR_LIBXML]],, |
---|
| 110 | with_libxml=$FAVOUR_LIBXML) |
---|
| 111 | |
---|
| 112 | if test "x$with_libxml" = "x" -o "$with_libxml" = "yes"; then |
---|
| 113 | with_libxml=$FAVOUR_LIBXML |
---|
| 114 | fi |
---|
| 115 | |
---|
| 116 | if test "$with_libxml" = "1"; then |
---|
| 117 | AC_PATH_PROG(XML_CONFIG,xml-config,no) |
---|
| 118 | if test x$XML_CONFIG = xno; then |
---|
| 119 | AC_MSG_ERROR([Cannot find LIBXML: Is xml-config in path?]) |
---|
| 120 | fi |
---|
| 121 | |
---|
| 122 | XML_MIN_VERSION=1.8.8 |
---|
| 123 | else |
---|
| 124 | if test "$with_libxml" = "2"; then |
---|
| 125 | AC_PATH_PROG(XML_CONFIG,xml2-config,no) |
---|
| 126 | if test x$XML_CONFIG = xno; then |
---|
| 127 | AC_MSG_ERROR([Cannot find LIBXML2: Is xml2-config in path?]) |
---|
| 128 | fi |
---|
| 129 | |
---|
| 130 | XML_MIN_VERSION=2.3.10 |
---|
| 131 | else |
---|
| 132 | AC_MSG_ERROR(Can't use libxml version $with_libxml) |
---|
| 133 | fi |
---|
| 134 | fi |
---|
| 135 | |
---|
| 136 | dnl Check version |
---|
| 137 | XML_VERSION=`$XML_CONFIG --version` |
---|
| 138 | ver=`echo $XML_VERSION | awk -F. '{printf("%d", ($1*1000+$2)*1000+$3);}'` |
---|
| 139 | minver=`echo $XML_MIN_VERSION | awk -F. '{printf("%d", ($1*1000+$2)*1000+$3);}'` |
---|
| 140 | if test "$minver" -gt "$ver" |
---|
| 141 | then |
---|
| 142 | AC_MSG_ERROR(Found libxml version $XML_VERSION. You need $XML_MIN_VERSION or newer) |
---|
| 143 | fi |
---|
| 144 | |
---|
| 145 | XML_CFLAGS=`$XML_CONFIG --cflags` |
---|
| 146 | XML_LIBS=`$XML_CONFIG --libs` |
---|
| 147 | |
---|
| 148 | AC_SUBST(XML_CFLAGS) |
---|
| 149 | AC_SUBST(XML_LIBS) |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | dnl *********************** |
---|
| 153 | dnl *** Checks for popt *** |
---|
| 154 | dnl *********************** |
---|
| 155 | |
---|
| 156 | AC_ARG_WITH(popt-includes, |
---|
| 157 | [ --with-popt-includes Specify location of popt headers], |
---|
| 158 | [popt_inc_prefix=-I$withval]) |
---|
| 159 | |
---|
| 160 | AC_ARG_WITH(popt-libs, |
---|
| 161 | [ --with-popt-libs Specify location of popt libs], |
---|
| 162 | [popt_prefix=$withval], |
---|
| 163 | [popt_prefix=/usr/lib]) |
---|
| 164 | |
---|
| 165 | save_CPPFLAGS=$CPPFLAGS |
---|
| 166 | save_LIBS=$LIBS |
---|
| 167 | CPPFLAGS="$CPPFLAGS $popt_inc_prefix" |
---|
| 168 | LIBS="$LIBS -L$popt_prefix" |
---|
| 169 | |
---|
| 170 | AC_CHECK_LIB(popt, |
---|
| 171 | poptGetContext, |
---|
| 172 | [POPT_LIBS="$LIBS -lpopt"] , |
---|
| 173 | AC_MSG_ERROR([popt is required])) |
---|
| 174 | AC_CHECK_HEADERS(popt.h, [POPT_CFLAGS="$CFLAGS"], AC_MSG_ERROR([popt.h is required])) |
---|
| 175 | |
---|
| 176 | CPPFLAGS=$save_CPPFLAGS |
---|
| 177 | LIBS=$save_LIBS |
---|
| 178 | |
---|
| 179 | AC_SUBST(POPT_CFLAGS) |
---|
| 180 | AC_SUBST(POPT_LIBS) |
---|
| 181 | |
---|
| 182 | |
---|
| 183 | dnl ********************************************** |
---|
| 184 | dnl *** Variable substitution for soup*Conf.sh *** |
---|
| 185 | dnl ********************************************** |
---|
| 186 | |
---|
| 187 | ### soupConf.sh |
---|
| 188 | SOUP_LIBDIR='-L${libdir}' |
---|
| 189 | SOUP_INCLUDEDIR=" -I${includedir}/soup $GLIB_CFLAGS $XML_CFLAGS" |
---|
| 190 | SOUP_LIBS="-lsoup $GLIB_LIBS $XML_LIBS" |
---|
| 191 | |
---|
| 192 | AC_SUBST(SOUP_LIBDIR) |
---|
| 193 | AC_SUBST(SOUP_INCLUDEDIR) |
---|
| 194 | AC_SUBST(SOUP_LIBS) |
---|
| 195 | |
---|
| 196 | ### soup-apacheConf.sh |
---|
| 197 | SOUP_APACHE_LIBDIR='-L${libdir}' |
---|
| 198 | SOUP_APACHE_INCLUDEDIR="$SOUP_INCLUDEDIR $APACHE_CFLAGS" |
---|
| 199 | SOUP_APACHE_LIBS="$SOUP_LIBS -lsoup-apache $APACHE_LIBS" |
---|
| 200 | |
---|
| 201 | AC_SUBST(SOUP_APACHE_LIBDIR) |
---|
| 202 | AC_SUBST(SOUP_APACHE_INCLUDEDIR) |
---|
| 203 | AC_SUBST(SOUP_APACHE_LIBS) |
---|
| 204 | |
---|
| 205 | ### soup-wsdlConf.sh |
---|
| 206 | SOUP_WSDL_LIBDIR='-L${libdir}' |
---|
| 207 | SOUP_WSDL_INCLUDEDIR=" -I${includedir}/soup $GLIB_CFLAGS $XML_CFLAGS" |
---|
| 208 | SOUP_WSDL_LIBS="$SOUP_LIBS -lwsdl" |
---|
| 209 | |
---|
| 210 | AC_SUBST(SOUP_WSDL_LIBDIR) |
---|
| 211 | AC_SUBST(SOUP_WSDL_INCLUDEDIR) |
---|
| 212 | AC_SUBST(SOUP_WSDL_LIBS) |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | dnl ********************************* |
---|
| 216 | dnl *** Networking library checks *** |
---|
| 217 | dnl ********************************* |
---|
| 218 | |
---|
| 219 | AC_CHECK_HEADERS(unistd.h) |
---|
| 220 | AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h) |
---|
| 221 | AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/poll.h sys/param.h sys/wait.h) |
---|
| 222 | AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) |
---|
| 223 | |
---|
| 224 | AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) |
---|
| 225 | AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) |
---|
| 226 | |
---|
| 227 | AC_CHECK_FUNCS(inet_pton inet_aton) |
---|
| 228 | |
---|
| 229 | ### Check if we have gethostbyname_r (if so, assume gethostbyaddr_r). |
---|
| 230 | AC_CHECK_FUNC(gethostbyname_r, |
---|
| 231 | [ |
---|
| 232 | dnl First check for the glibc variant of gethostbyname_r |
---|
| 233 | |
---|
| 234 | AC_MSG_CHECKING(for glibc gethostbyname_r) |
---|
| 235 | AC_TRY_LINK([ #include <netdb.h>],[ |
---|
| 236 | struct hostent result_buf; |
---|
| 237 | char buf[1024]; |
---|
| 238 | struct hostent* result; |
---|
| 239 | int h_errnop; |
---|
| 240 | |
---|
| 241 | gethostbyname_r("localhost", &result_buf, buf, sizeof(buf), |
---|
| 242 | &result, &h_errnop); |
---|
| 243 | ], [ |
---|
| 244 | |
---|
| 245 | dnl Have glibc gethostbyname_r |
---|
| 246 | |
---|
| 247 | AC_MSG_RESULT(yes) |
---|
| 248 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC) |
---|
| 249 | HAVE_GETHOSTBYNAME_R=yes |
---|
| 250 | |
---|
| 251 | ], [ |
---|
| 252 | |
---|
| 253 | dnl If we don't have glibc gethostbyname_r, check |
---|
| 254 | dnl for Solaris/Irix gethostbyname_r |
---|
| 255 | |
---|
| 256 | AC_MSG_RESULT(no) |
---|
| 257 | AC_MSG_CHECKING(for Solaris/Irix gethostbyname_r) |
---|
| 258 | AC_TRY_LINK([ #include <netdb.h>],[ |
---|
| 259 | struct hostent result; |
---|
| 260 | char buf[1024]; |
---|
| 261 | int h_errnop; |
---|
| 262 | |
---|
| 263 | gethostbyname_r("localhost", &result, buf, sizeof(buf), &h_errnop); |
---|
| 264 | |
---|
| 265 | ], [ |
---|
| 266 | |
---|
| 267 | dnl Have Solaris/Irix gethostbyname_r |
---|
| 268 | |
---|
| 269 | AC_MSG_RESULT(yes) |
---|
| 270 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_SOLARIS) |
---|
| 271 | HAVE_GETHOSTBYNAME_R=yes |
---|
| 272 | |
---|
| 273 | ], [ |
---|
| 274 | dnl If don't have Solaris/Irix gethostbyname_r, check |
---|
| 275 | dnl for HP-UX gethostbyname_r |
---|
| 276 | |
---|
| 277 | AC_MSG_RESULT(no) |
---|
| 278 | AC_MSG_CHECKING(for HP-UX gethostbyname_r) |
---|
| 279 | AC_TRY_LINK([ #include <netdb.h>],[ |
---|
| 280 | struct hostent result; |
---|
| 281 | char buf[1024]; |
---|
| 282 | gethostbyname_r("localhost", &result, buf); |
---|
| 283 | ], [ |
---|
| 284 | |
---|
| 285 | dnl Have HP-UX gethostbyname_r |
---|
| 286 | |
---|
| 287 | AC_MSG_RESULT(yes) |
---|
| 288 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_HPUX) |
---|
| 289 | HAVE_GETHOSTBYNAME_R=yes |
---|
| 290 | |
---|
| 291 | ] |
---|
| 292 | )] |
---|
| 293 | )] |
---|
| 294 | )]) |
---|
| 295 | |
---|
| 296 | ### If we don't have gethostbyname_r, try to use Glib mutexes |
---|
| 297 | if test -z "$HAVE_GETHOSTBYNAME_R"; then |
---|
| 298 | AM_PATH_GLIB(1.2.0, |
---|
| 299 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIB_MUTEX), [ |
---|
| 300 | AC_MSG_WARN(You have neither Glib threads nor the function |
---|
| 301 | gethostbyname_r. This means that calls to |
---|
| 302 | gethostbyname (called by the Soup address |
---|
| 303 | functions) will not be thread safe so could |
---|
| 304 | malfunction in programs that use threads.) |
---|
| 305 | ]) |
---|
| 306 | fi |
---|
| 307 | |
---|
| 308 | |
---|
| 309 | dnl **************************************************** |
---|
| 310 | dnl *** SSL Library checks (Mozilla NSS, or OpenSSL) *** |
---|
| 311 | dnl **************************************************** |
---|
| 312 | |
---|
| 313 | AC_ARG_ENABLE(ssl, |
---|
| 314 | [ --enable-ssl Turn on Secure Sockets Layer support [default=yes]],, |
---|
| 315 | enable_ssl=yes) |
---|
| 316 | |
---|
| 317 | AC_ARG_WITH(nspr-includes, |
---|
| 318 | [ --with-nspr-includes Specify location of Netscape Portable Runtime headers], |
---|
| 319 | [nspr_inc_prefix=-I$withval]) |
---|
| 320 | |
---|
| 321 | AC_ARG_WITH(nspr-libs, |
---|
| 322 | [ --with-nspr-libs Specify location of Netscape Portable Runtime libs], |
---|
| 323 | [nspr_prefix=$withval], |
---|
| 324 | [nspr_prefix=/usr/lib]) |
---|
| 325 | |
---|
| 326 | AC_ARG_WITH(nss-includes, |
---|
| 327 | [ --with-nss-includes Specify location of NSS header files], |
---|
| 328 | [nss_inc_prefix=-I$withval]) |
---|
| 329 | |
---|
| 330 | AC_ARG_WITH(nss-libs, |
---|
| 331 | [ --with-nss-libs Specify location of NSS libs], |
---|
| 332 | [nss_prefix=$withval], |
---|
| 333 | [nss_prefix=/usr/lib]) |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | AC_ARG_WITH(openssl-includes, |
---|
| 337 | [ --with-openssl-includes Specify location of OpenSSL header files], |
---|
| 338 | [openssl_inc_prefix=-I$withval]) |
---|
| 339 | |
---|
| 340 | AC_ARG_WITH(openssl-libs, |
---|
| 341 | [ --with-openssl-libs Specify location of OpenSSL libs], |
---|
| 342 | [openssl_prefix=$withval], |
---|
| 343 | [openssl_prefix=/usr/lib]) |
---|
| 344 | |
---|
| 345 | ### |
---|
| 346 | ### Allow for a custom SSL proxy name |
---|
| 347 | ### |
---|
| 348 | SSL_PROXY_NAME=soup-ssl-proxy |
---|
| 349 | AC_ARG_WITH(ssl-proxy-name, |
---|
| 350 | [ --with-ssl-proxy-name Custom name for ssl proxy executable [default=soup-ssl-proxy]], |
---|
| 351 | [SSL_PROXY_NAME=$withval], |
---|
| 352 | [SSL_PROXY_NAME=soup-ssl-proxy]) |
---|
| 353 | |
---|
| 354 | AC_DEFINE_UNQUOTED(SSL_PROXY_NAME, "${SSL_PROXY_NAME}") |
---|
| 355 | AC_SUBST(SSL_PROXY_NAME) |
---|
| 356 | |
---|
| 357 | ### |
---|
| 358 | ### Try to link statically with the SSL library |
---|
| 359 | ### |
---|
| 360 | AC_ARG_ENABLE(ssl-link-static, |
---|
| 361 | [ --enable-static-ssl Link with SSL library statically [default=no]], |
---|
| 362 | [enable_static_ssl=yes]) |
---|
| 363 | |
---|
| 364 | if test "x$enable_ssl" = xyes; then |
---|
| 365 | ### |
---|
| 366 | ### Check for OpenSSL |
---|
| 367 | ### |
---|
| 368 | save_CPPFLAGS=$CPPFLAGS |
---|
| 369 | CPPFLAGS="$CPPFLAGS $openssl_inc_prefix" |
---|
| 370 | AC_CHECK_LIB(dl, dlopen, DL_LDFLAGS="-ldl", DL_LDFLAGS="") |
---|
| 371 | AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, |
---|
| 372 | [enable_openssl="yes"], |
---|
| 373 | [enable_openssl="no"; break]) |
---|
| 374 | |
---|
| 375 | if test "x$enable_openssl" = xyes; then |
---|
| 376 | if test "x$enable_static_ssl" = "xyes"; then |
---|
| 377 | OPENSSL_LIBS="$openssl_prefix/libssl.a $openssl_prefix/libcrypto.a" |
---|
| 378 | else |
---|
| 379 | OPENSSL_LIBS="-L$openssl_prefix -lssl -lcrypto $DL_LDFLAGS" |
---|
| 380 | fi |
---|
| 381 | OPENSSL_CFLAGS=$CPPFLAGS |
---|
| 382 | AC_DEFINE(HAVE_OPENSSL) |
---|
| 383 | else |
---|
| 384 | OPENSSL_LIBS= |
---|
| 385 | OPENSSL_CFLAGS= |
---|
| 386 | fi |
---|
| 387 | |
---|
| 388 | AC_SUBST(OPENSSL_CFLAGS) |
---|
| 389 | AC_SUBST(OPENSSL_LIBS) |
---|
| 390 | CPPFLAGS=$save_CPPFLAGS |
---|
| 391 | |
---|
| 392 | ### |
---|
| 393 | ### Check for Mozilla NSS |
---|
| 394 | ### |
---|
| 395 | save_CPPFLAGS=$CPPFLAGS |
---|
| 396 | CPPFLAGS="$CPPFLAGS $nspr_inc_prefix $nss_inc_prefix" |
---|
| 397 | AC_CHECK_HEADERS(nss.h ssl.h pk11func.h, |
---|
| 398 | [enable_nss="yes"], |
---|
| 399 | [enable_nss="no"; break]) |
---|
| 400 | |
---|
| 401 | if test "x$enable_nss" = xyes; then |
---|
| 402 | if test "x$enable_static_ssl" = "xyes"; then |
---|
| 403 | NSS_LIBS="-lpthread $nspr_prefix/libnspr4.a $nspr_prefix/libplc4.a $nspr_prefix/libplds4.a $nss_prefix/libnssb.a" |
---|
| 404 | else |
---|
| 405 | NSS_LIBS="-lpthread -L$nspr_prefix -lnspr4 -lplc4 -lplds4 $nss_prefix -lnss3 -lssl3" |
---|
| 406 | fi |
---|
| 407 | NSS_CFLAGS=$CPPFLAGS |
---|
| 408 | AC_DEFINE(HAVE_NSS) |
---|
| 409 | else |
---|
| 410 | NSS_LIBS= |
---|
| 411 | NSS_CFLAGS= |
---|
| 412 | fi |
---|
| 413 | |
---|
| 414 | AC_SUBST(NSS_CFLAGS) |
---|
| 415 | AC_SUBST(NSS_LIBS) |
---|
| 416 | CPPFLAGS=$save_CPPFLAGS |
---|
| 417 | fi |
---|
| 418 | |
---|
| 419 | |
---|
| 420 | dnl ************************* |
---|
| 421 | dnl *** Checks for Apache *** |
---|
| 422 | dnl ************************* |
---|
| 423 | |
---|
| 424 | enable_apache="no" |
---|
| 425 | |
---|
| 426 | AC_PATH_PROG(APXS,apxs,no) |
---|
| 427 | if test x$APXS != xno; then |
---|
| 428 | APACHE_CFLAGS="-I`apxs -q INCLUDEDIR CFLAGS`" |
---|
| 429 | APACHE_LIBS=`apxs -q LDFLAGS_SHLIB LIBS_SHLIB` |
---|
| 430 | |
---|
| 431 | save_CPPFLAGS=$CPPFLAGS |
---|
| 432 | CPPFLAGS=$APACHE_CFLAGS |
---|
| 433 | AC_CHECK_HEADERS(httpd.h http_config.h http_core.h http_log.h http_main.h http_protocol.h, |
---|
| 434 | [enable_apache="yes"], |
---|
| 435 | [enable_apache="no" |
---|
| 436 | break]) |
---|
| 437 | CPPFLAGS=$save_CPPFLAGS |
---|
| 438 | |
---|
| 439 | AC_SUBST(APACHE_CFLAGS) |
---|
| 440 | AC_SUBST(APACHE_LIBS) |
---|
| 441 | fi |
---|
| 442 | |
---|
| 443 | |
---|
| 444 | dnl ********************************************* |
---|
| 445 | dnl *** Checks for gtk-doc (lifted from glib) *** |
---|
| 446 | dnl ********************************************* |
---|
| 447 | |
---|
| 448 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH Path to installed docs ]) |
---|
| 449 | |
---|
| 450 | if test "x$with_html_dir" = "x" ; then |
---|
| 451 | HTML_DIR='${datadir}/gtk-doc/html' |
---|
| 452 | else |
---|
| 453 | HTML_DIR=$with_html_dir |
---|
| 454 | fi |
---|
| 455 | |
---|
| 456 | AC_SUBST(HTML_DIR) |
---|
| 457 | |
---|
| 458 | AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) |
---|
| 459 | AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) |
---|
| 460 | AC_SUBST(HAVE_GTK_DOC) |
---|
| 461 | |
---|
| 462 | AC_CHECK_PROG(DB2HTML, db2html, true, false) |
---|
| 463 | AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) |
---|
| 464 | |
---|
| 465 | dnl Let people disable the gtk-doc stuff. |
---|
| 466 | AC_ARG_ENABLE(gtk-doc, |
---|
| 467 | [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], |
---|
| 468 | enable_gtk_doc="$enableval", |
---|
| 469 | enable_gtk_doc=auto) |
---|
| 470 | |
---|
| 471 | if test x$enable_gtk_doc = xauto ; then |
---|
| 472 | if test x$GTKDOC = xtrue ; then |
---|
| 473 | enable_gtk_doc=yes |
---|
| 474 | else |
---|
| 475 | enable_gtk_doc=no |
---|
| 476 | fi |
---|
| 477 | fi |
---|
| 478 | |
---|
| 479 | dnl NOTE: We need to use a separate automake conditional for this |
---|
| 480 | dnl to make this work with the tarballs. |
---|
| 481 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
| 482 | |
---|
| 483 | |
---|
| 484 | dnl ******************************************************* |
---|
| 485 | dnl *** Type alignment test (based on the one in ORBit) *** |
---|
| 486 | dnl ******************************************************* |
---|
| 487 | |
---|
| 488 | AC_DEFUN(AC_CHECK_ALIGNOF, |
---|
| 489 | [changequote(<<, >>)dnl |
---|
| 490 | dnl The name to #define. |
---|
| 491 | define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl |
---|
| 492 | dnl The cache variable name. |
---|
| 493 | define(<<AC_CV_NAME>>, translit(ac_cv_alignof_$1, [ *], [_p]))dnl |
---|
| 494 | changequote([, ])dnl |
---|
| 495 | AC_MSG_CHECKING(alignment of $1) |
---|
| 496 | align_save_libs="$LIBS" |
---|
| 497 | LIBS="$GLIB_LIBS $LIBS" |
---|
| 498 | AC_CACHE_VAL(AC_CV_NAME, |
---|
| 499 | [AC_TRY_RUN([ |
---|
| 500 | #include <stdio.h> |
---|
| 501 | #include <glib.h> |
---|
| 502 | typedef struct {char s1;} gstruct; |
---|
| 503 | struct test {char s1; $1 s2;}; |
---|
| 504 | main() |
---|
| 505 | { |
---|
| 506 | FILE *f=fopen("conftestval", "w"); |
---|
| 507 | if (!f) exit(1); |
---|
| 508 | fprintf(f, "%d\n", &(((struct test*)0)->s2)); |
---|
| 509 | exit(0); |
---|
| 510 | }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, AC_CV_NAME=0)])dnl |
---|
| 511 | AC_MSG_RESULT($AC_CV_NAME) |
---|
| 512 | LIBS="$align_save_libs" |
---|
| 513 | AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) |
---|
| 514 | undefine([AC_TYPE_NAME])dnl |
---|
| 515 | undefine([AC_CV_NAME])dnl |
---|
| 516 | ]) |
---|
| 517 | |
---|
| 518 | orig_CPPFLAGS=$CPPFLAGS |
---|
| 519 | CPPFLAGS=$GLIB_CFLAGS |
---|
| 520 | AC_CHECK_ALIGNOF(gboolean) |
---|
| 521 | AC_CHECK_ALIGNOF(gchar) |
---|
| 522 | AC_CHECK_ALIGNOF(guchar) |
---|
| 523 | AC_CHECK_ALIGNOF(gint) |
---|
| 524 | AC_CHECK_ALIGNOF(guint) |
---|
| 525 | AC_CHECK_ALIGNOF(gshort) |
---|
| 526 | AC_CHECK_ALIGNOF(gushort) |
---|
| 527 | AC_CHECK_ALIGNOF(glong) |
---|
| 528 | AC_CHECK_ALIGNOF(gulong) |
---|
| 529 | AC_CHECK_ALIGNOF(gint8) |
---|
| 530 | AC_CHECK_ALIGNOF(guint8) |
---|
| 531 | AC_CHECK_ALIGNOF(gint16) |
---|
| 532 | AC_CHECK_ALIGNOF(guint16) |
---|
| 533 | AC_CHECK_ALIGNOF(gint32) |
---|
| 534 | AC_CHECK_ALIGNOF(guint32) |
---|
| 535 | AC_CHECK_ALIGNOF(gfloat) |
---|
| 536 | AC_CHECK_ALIGNOF(gdouble) |
---|
| 537 | AC_CHECK_ALIGNOF(gpointer) |
---|
| 538 | AC_CHECK_ALIGNOF(gstruct) |
---|
| 539 | CPPFLAGS=$orig_CPPFLAGS |
---|
| 540 | |
---|
| 541 | |
---|
| 542 | dnl ************************************* |
---|
| 543 | dnl *** Warnings to show if using GCC *** |
---|
| 544 | dnl ************************************* |
---|
| 545 | |
---|
| 546 | AC_ARG_ENABLE(more-warnings, |
---|
| 547 | [ --disable-more-warnings Inhibit compiler warnings], |
---|
| 548 | set_more_warnings=no) |
---|
| 549 | |
---|
| 550 | if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then |
---|
| 551 | CFLAGS="$CFLAGS \ |
---|
| 552 | -Wall -Wstrict-prototypes -Wmissing-declarations \ |
---|
| 553 | -Wmissing-prototypes -Wnested-externs -Wpointer-arith" |
---|
| 554 | fi |
---|
| 555 | |
---|
| 556 | # Use reentrant functions |
---|
| 557 | CFLAGS="$CFLAGS -D_REENTRANT" |
---|
| 558 | |
---|
| 559 | dnl ***************************** |
---|
| 560 | dnl *** link proxy statically *** |
---|
| 561 | dnl ***************************** |
---|
| 562 | AC_ARG_ENABLE(static-proxy, |
---|
| 563 | [ --enable-static-proxy Build ${SSL_PROXY_NAME} statically ]) |
---|
| 564 | |
---|
| 565 | if test x"$enable_static_proxy" = xyes; then |
---|
| 566 | LINK_STATIC="-Wl,-Bstatic" |
---|
| 567 | LINK_DYNAMIC="-Wl,-Bdynamic" |
---|
| 568 | FORCE_SHLIBS="dl resolv rt nsl" |
---|
| 569 | for lib in $FORCE_SHLIBS; do |
---|
| 570 | OPENSSL_LIBS=`echo $OPENSSL_LIBS | sed "s/-l$lib/-Wl,-Bdynamic -l$lib -Wl,-Bstatic/"` |
---|
| 571 | GMODULE_LIBS=`echo $GMODULE_LIBS | sed "s/-l$lib/-Wl,-Bdynamic -l$lib -Wl,-Bstatic/"` |
---|
| 572 | done |
---|
| 573 | else |
---|
| 574 | LINK_STATIC= |
---|
| 575 | LINK_DYNAMIC= |
---|
| 576 | fi |
---|
| 577 | |
---|
| 578 | AC_SUBST(LINK_STATIC) |
---|
| 579 | AC_SUBST(LINK_DYNAMIC) |
---|
| 580 | |
---|
| 581 | dnl ************************* |
---|
| 582 | dnl *** Output Everything *** |
---|
| 583 | dnl ************************* |
---|
| 584 | |
---|
| 585 | AC_OUTPUT([ |
---|
| 586 | soup-config |
---|
| 587 | soup.pc |
---|
| 588 | soup.spec |
---|
| 589 | Makefile |
---|
| 590 | docs/Makefile |
---|
| 591 | docs/reference/Makefile |
---|
| 592 | src/Makefile |
---|
| 593 | src/libsoup/Makefile |
---|
| 594 | src/libsoup-apache/Makefile |
---|
| 595 | src/libwsdl/Makefile |
---|
| 596 | src/soup-httpd/Makefile |
---|
| 597 | src/soup-ssl-proxy/Makefile |
---|
| 598 | src/soup-wsdl/Makefile |
---|
| 599 | ]) |
---|
| 600 | |
---|
| 601 | echo " |
---|
| 602 | |
---|
| 603 | Configuration: |
---|
| 604 | |
---|
| 605 | Source code location: ${srcdir} |
---|
| 606 | Compiler: ${CC} |
---|
| 607 | Build flags: ${CFLAGS} ${SOUP_DEBUG_FLAGS} |
---|
| 608 | |
---|
| 609 | glib 2.0: ${enable_glib2} |
---|
| 610 | |
---|
| 611 | Static SSL Proxy: ${enable_static_proxy:-no} |
---|
| 612 | SSL Proxy Name: ${SSL_PROXY_NAME} |
---|
| 613 | |
---|
| 614 | OpenSSL support: ${enable_openssl} |
---|
| 615 | Mozilla NSS support: ${enable_nss} |
---|
| 616 | |
---|
| 617 | Apache module support: ${enable_apache} |
---|
| 618 | |
---|
| 619 | " |
---|