libproxy: add a PAC/WPAD handling D-Bus service
[platform/upstream/glib-networking.git] / configure.ac
1 AC_PREREQ(2.65)
2 AC_CONFIG_MACRO_DIR([m4])
3
4 AC_INIT([glib-networking],[2.29.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=network])
5
6 AC_CONFIG_SRCDIR([proxy/libproxy/glibproxyresolver.h])
7 AC_CONFIG_HEADERS([config.h])
8
9 dnl Other initialization
10 AM_INIT_AUTOMAKE
11 AM_MAINTAINER_MODE
12 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
13 LT_INIT
14
15 dnl Checks for programs.
16 AC_PROG_CC
17 AM_PROG_CC_C_O
18 AC_PROG_CPP
19
20 dnl Checks for libraries.
21
22 dnl ****************************
23 dnl *** Checks for intltool  ***
24 dnl ****************************
25
26 IT_PROG_INTLTOOL([0.35.0])
27 GETTEXT_PACKAGE=glib-networking
28
29 AC_SUBST([GETTEXT_PACKAGE])
30 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
31 AM_GLIB_GNU_GETTEXT
32
33 dnl *****************************
34 dnl *** Check GLib GIO        ***
35 dnl *****************************
36 AM_PATH_GLIB_2_0(2.27.90,,AC_MSG_ERROR(GLIB not found),gio)
37
38 GIO_MODULE_DIR=$($PKG_CONFIG --variable giomoduledir gio-2.0)
39 AS_IF([test "x$GIO_MODULE_DIR" = "x"],
40       [AC_MSG_FAILURE(GIO_MODULE_DIR is missing from gio-2.0.pc)])
41 AC_SUBST(GIO_MODULE_DIR)
42
43 AC_PATH_PROG(GIO_QUERYMODULES, gio-querymodules)
44 AC_SUBST(GIO_QUERYMODULES)
45
46 proxy_support=no
47 tls_support=no
48
49 dnl *****************************
50 dnl *** Checks for LibProxy   ***
51 dnl *****************************
52
53 AC_ARG_WITH(libproxy,
54     [AC_HELP_STRING([--with-libproxy],
55                     [support for libproxy @<:@default=check@:>@])],
56     [],
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)
66
67 dnl *****************************
68 dnl *** Checks for GNUTLS     ***
69 dnl *****************************
70 AC_ARG_WITH(gnutls,
71     [AC_HELP_STRING([--with-gnutls],
72                     [support for GNUTLS @<:@default=yes@:>@])],
73     [],
74     [with_gnutls=yes])
75 AS_IF([test "x$with_gnutls" != "xno"],
76     [PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.1.7],
77         [with_gnutls=yes
78          tls_support=gnutls
79          AM_PATH_LIBGCRYPT([])],
80         [AS_IF([test "x$with_gnutls" = "xyes"],
81                [AC_MSG_FAILURE("$GNUTLS_PKG_ERRORS")])])])
82 AM_CONDITIONAL(HAVE_GNUTLS, [test "x$with_gnutls" = "xyes"])
83 AC_SUBST(GNUTLS_CFLAGS)
84 AC_SUBST(GNUTLS_LIBS)
85
86 if test "x$with_gnutls" = "xyes"; then
87     AC_MSG_CHECKING([location of system Certificate Authority list])
88     AC_ARG_WITH(ca-certificates,
89                 [AC_HELP_STRING([--with-ca-certificates=@<:@path@:>@],
90                                 [path to system Certificate Authority list])])
91     if test "$with_ca_certificates" = "no"; then
92         AC_MSG_RESULT([disabled])
93     else
94         if test -z "$with_ca_certificates"; then
95             for f in /etc/pki/tls/certs/ca-bundle.crt \
96                      /etc/ssl/certs/ca-certificates.crt; do
97                 if test -f "$f"; then
98                     with_ca_certificates="$f"
99                 fi
100             done
101             if test -z "$with_ca_certificates"; then
102                 AC_MSG_ERROR([could not find. Use --with-ca-certificates=path to set, or --without-ca-certificates to disable])
103             fi
104         fi
105
106         AC_MSG_RESULT($with_ca_certificates)
107         AC_DEFINE_UNQUOTED(GTLS_SYSTEM_CA_FILE, ["$with_ca_certificates"], [The system TLS CA list])
108     fi
109 fi
110
111 dnl *************************************
112 dnl *** Warnings to show if using GCC ***
113 dnl *************************************
114
115 AC_ARG_ENABLE(more-warnings,
116               AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
117               set_more_warnings=no)
118
119 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
120         CFLAGS="$CFLAGS \
121                 -Wall -Wstrict-prototypes -Wmissing-declarations \
122                 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
123                 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
124                 -Waggregate-return -Wmissing-format-attribute"
125
126         for option in -Wmissing-include-dirs -Wundef; do
127                 SAVE_CFLAGS="$CFLAGS"
128                 CFLAGS="$CFLAGS $option"
129                 AC_MSG_CHECKING([whether gcc understands $option])
130                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
131                                   [has_option=yes],
132                                   [has_option=no])
133                 AC_MSG_RESULT($has_option)
134                 if test $has_option = no; then
135                         CFLAGS="$SAVE_CFLAGS"
136                 fi
137         done
138 fi
139
140 dnl *****************************
141 dnl *** done                  ***
142 dnl *****************************
143 AC_CONFIG_FILES([Makefile
144                  po/Makefile.in po/Makefile
145                  proxy/libproxy/Makefile
146                  tls/gnutls/Makefile
147                 ])
148 AC_OUTPUT
149
150 echo ""
151 echo "  Proxy support: $proxy_support"
152 echo "  TLS support:   $tls_support"
153 if test "$tls_support" != "no"; then
154     echo "  TLS CA file:   ${with_ca_certificates:-(none)}"
155     if test -n "$with_ca_certificates"; then
156         if ! test -f "$with_ca_certificates"; then
157             AC_MSG_WARN([Specified certificate authority file '$with_ca_certificates' does not exist])
158         fi
159     fi
160 fi