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