2 AC_CONFIG_MACRO_DIR([m4])
4 AC_INIT([glib-networking],[2.37.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=network])
6 AC_CONFIG_SRCDIR([proxy/libproxy/glibproxyresolver.h])
7 AC_CONFIG_HEADERS([config.h])
9 dnl Other initialization
10 AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wno-portability])
11 AM_MAINTAINER_MODE([enable])
12 AM_SILENT_RULES([yes])
15 dnl Checks for programs.
20 dnl Checks for libraries.
22 dnl ****************************
23 dnl *** Checks for intltool ***
24 dnl ****************************
26 IT_PROG_INTLTOOL([0.35.0])
27 GETTEXT_PACKAGE=glib-networking
29 AC_SUBST([GETTEXT_PACKAGE])
30 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
33 dnl *****************************
34 dnl *** Check GLib GIO ***
35 dnl *****************************
36 AM_PATH_GLIB_2_0(2.35.8,,AC_MSG_ERROR(GLIB not found),gio)
37 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36"
39 GIO_MODULE_DIR=$($PKG_CONFIG --variable giomoduledir gio-2.0)
40 AS_IF([test "x$GIO_MODULE_DIR" = "x"],
41 [AC_MSG_FAILURE(GIO_MODULE_DIR is missing from gio-2.0.pc)])
42 AC_SUBST(GIO_MODULE_DIR)
44 AC_PATH_PROG(GIO_QUERYMODULES, gio-querymodules)
45 AC_SUBST(GIO_QUERYMODULES)
49 dnl *****************************
50 dnl *** Checks for LibProxy ***
51 dnl *****************************
54 [AC_HELP_STRING([--with-libproxy],
55 [support for libproxy @<:@default=check@:>@])],
57 [with_libproxy=check])
58 AS_IF([test "x$with_libproxy" != "xno"],
59 [PKG_CHECK_MODULES(LIBPROXY, [libproxy-1.0 >= 0.3.1],
60 [with_libproxy=yes; proxy_support=libproxy],
61 [AS_IF([test "x$with_libproxy" = "xyes"],
62 [AC_MSG_FAILURE("$LIBPROXY_PKG_ERRORS")])])])
63 AM_CONDITIONAL(HAVE_LIBPROXY, [test "x$with_libproxy" = "xyes"])
64 AC_SUBST(LIBPROXY_CFLAGS)
65 AC_SUBST(LIBPROXY_LIBS)
67 dnl **************************************
68 dnl *** Checks for GNOME proxy backend ***
69 dnl **************************************
70 AC_ARG_WITH(gnome-proxy,
71 [AC_HELP_STRING([--with-gnome-proxy],
72 [support for GNOME proxy configuration @<:@default=check@:>@])],
74 [with_gnome_proxy=check])
75 AS_IF([test "x$with_gnome_proxy" != "xno"],
76 [PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, [gsettings-desktop-schemas],
77 [with_gnome_proxy=yes; proxy_support="gnome $proxy_support"],
78 [AS_IF([test "x$with_gnome_proxy" = "xyes"],
79 [AC_MSG_FAILURE("$GSETTINGS_DESKTOP_SCHEMAS_PKG_ERRORS")])])])
80 AM_CONDITIONAL(HAVE_GNOME_PROXY, [test "x$with_gnome_proxy" = "xyes"])
81 AC_SUBST(GSETTINGS_DESKTOP_SCHEMAS_CFLAGS)
83 dnl *****************************
84 dnl *** Checks for GNUTLS ***
85 dnl *****************************
87 GNUTLS_MIN_REQUIRED=2.12.8
90 [AC_HELP_STRING([--with-gnutls],
91 [support for GNUTLS @<:@default=yes@:>@])],
94 if test "x$with_gnutls" != "xno"; then
95 PKG_CHECK_MODULES(GNUTLS,
96 [gnutls >= $GNUTLS_MIN_REQUIRED],
98 tls_support="${tls_support}gnutls "],
99 [AS_IF([test "x$with_gnutls" = "xyes"],
100 [AC_MSG_FAILURE("$GNUTLS_PKG_ERRORS")])])
102 AM_CONDITIONAL(HAVE_GNUTLS, [test "x$with_gnutls" = "xyes"])
103 AC_SUBST(GNUTLS_CFLAGS)
104 AC_SUBST(GNUTLS_LIBS)
106 if test "x$with_gnutls" = "xyes"; then
107 AC_MSG_CHECKING([location of system Certificate Authority list])
108 AC_ARG_WITH(ca-certificates,
109 [AC_HELP_STRING([--with-ca-certificates=@<:@path@:>@],
110 [path to system Certificate Authority list])])
111 if test "$with_ca_certificates" = "no"; then
112 AC_MSG_RESULT([disabled])
114 if test -z "$with_ca_certificates"; then
115 for f in /etc/pki/tls/certs/ca-bundle.crt \
116 /etc/ssl/certs/ca-certificates.crt \
117 /etc/ssl/ca-bundle.pem; do
118 if test -f "$f"; then
119 with_ca_certificates="$f"
122 if test -z "$with_ca_certificates"; then
123 AC_MSG_ERROR([could not find. Use --with-ca-certificates=path to set, or --without-ca-certificates to disable])
127 AC_MSG_RESULT($with_ca_certificates)
128 AC_DEFINE_UNQUOTED(GTLS_SYSTEM_CA_FILE, ["$with_ca_certificates"], [The system TLS CA list])
132 dnl *****************************
133 dnl *** Checks for pkcs11 ***
134 dnl *****************************
139 [AC_HELP_STRING([--with-pkcs11],
140 [support for pkcs11 @<:@default=check@:>@])],
143 if test "x$with_pkcs11" != "xno"; then
144 PKG_CHECK_MODULES(PKCS11,
145 [p11-kit-1 >= $P11_KIT_REQUIRED],
147 pkcs11_support=p11-kit
148 tls_support="${tls_support}gnutls-pkcs11 "
149 AC_DEFINE_UNQUOTED([HAVE_PKCS11], [1], [Building with PKCS#11 support])],
150 [AS_IF([test "x$with_pkcs11" = "xyes"],
151 [AC_MSG_FAILURE("$PKCS11_PKG_ERRORS")])
156 AM_CONDITIONAL(HAVE_PKCS11, [test "x$with_pkcs11" = "xyes"])
157 AC_SUBST(PKCS11_CFLAGS)
158 AC_SUBST(PKCS11_LIBS)
160 dnl ************************************
161 dnl *** Enable lcov coverage reports ***
162 dnl ************************************
165 AS_HELP_STRING([--enable-gcov],
167 [use_gcov=$enableval], [use_gcov=no])
169 if test "x$use_gcov" = "xyes"; then
171 if test "$GCC" != "yes"; then
172 AC_MSG_ERROR([GCC is required for --enable-gcov])
175 ltp_version_list="1.6 1.7 1.8 1.9"
176 AC_CHECK_PROG(LTP, lcov, lcov)
177 AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
180 AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
181 glib_cv_ltp_version=invalid
182 ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
183 for ltp_check_version in $ltp_version_list; do
184 if test "$ltp_version" = "$ltp_check_version"; then
185 glib_cv_ltp_version="$ltp_check_version (ok)"
190 ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
191 AC_MSG_ERROR([$ltp_msg])
194 case $glib_cv_ltp_version in
196 ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
197 AC_MSG_ERROR([$ltp_msg])
202 if test -z "$LTP_GENHTML"; then
203 AC_MSG_ERROR([Could not find genhtml from the LTP package])
206 AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
208 dnl Remove all optimization flags from CFLAGS
210 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
213 dnl Add the special gcc flags
214 CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
215 LDFLAGS="$LDFLAGS -lgcov"
218 dnl ****************************************************
219 dnl *** Warnings to show if using GCC ***
220 dnl *** (do this last so -Werror won't mess up tests ***
221 dnl ****************************************************
223 AC_ARG_ENABLE(more-warnings,
224 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
225 set_more_warnings=no)
227 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
229 -Wall -Wstrict-prototypes -Werror=missing-prototypes \
230 -Werror=implicit-function-declaration \
231 -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
232 -Werror=missing-include-dirs \
233 -Werror=declaration-after-statement"
236 dnl *****************************
238 dnl *****************************
239 AC_CONFIG_FILES([Makefile
240 po/Makefile.in po/Makefile
241 proxy/libproxy/Makefile
251 echo " Proxy support: ${proxy_support:-no}"
252 echo " TLS support: ${tls_support:-no}"
253 if test "$tls_support" != "no"; then
254 echo " PKCS#11 Support: $pkcs11_support"
255 echo " TLS CA file: ${with_ca_certificates:-(none)}"
256 if test -n "$with_ca_certificates"; then
257 if ! test -f "$with_ca_certificates"; then
258 AC_MSG_WARN([Specified certificate authority file '$with_ca_certificates' does not exist])