File: configure.ac

package info (click to toggle)
glib-networking 2.50.0-1+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,132 kB
  • sloc: ansic: 12,323; sh: 5,186; makefile: 248; sed: 16
file content (260 lines) | stat: -rw-r--r-- 8,581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
AC_PREREQ(2.65)
AC_CONFIG_MACRO_DIR([m4])

AC_INIT([glib-networking],[2.50.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=network])

AC_CONFIG_SRCDIR([proxy/libproxy/glibproxyresolver.h])
AC_CONFIG_HEADERS([config.h])

dnl Other initialization
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wno-portability])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
LT_INIT

dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP

dnl Checks for libraries.

dnl ****************************
dnl *** Checks for gettext   ***
dnl ****************************
AM_GNU_GETTEXT_VERSION([0.19.4])
AM_GNU_GETTEXT([external])

GETTEXT_PACKAGE=glib-networking
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])

dnl *****************************
dnl *** Check GLib GIO        ***
dnl *****************************
AM_PATH_GLIB_2_0(2.46.0,,AC_MSG_ERROR(GLIB not found),gio)
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46"

GIO_MODULE_DIR=$($PKG_CONFIG --variable giomoduledir gio-2.0)
AS_IF([test "$GIO_MODULE_DIR" = ""],
      [AC_MSG_FAILURE(GIO_MODULE_DIR is missing from gio-2.0.pc)])
AC_SUBST(GIO_MODULE_DIR)

AC_PATH_PROG(GIO_QUERYMODULES, gio-querymodules)
AC_SUBST(GIO_QUERYMODULES)

GLIB_TESTS

dnl *****************************
dnl *** Checks for LibProxy   ***
dnl *****************************

AC_ARG_WITH(libproxy,
    [AC_HELP_STRING([--with-libproxy],
                    [support for libproxy @<:@default=check@:>@])],
    [],
    [with_libproxy=check])
AS_IF([test "$with_libproxy" != "no"],
    [PKG_CHECK_MODULES(LIBPROXY, [libproxy-1.0 >= 0.3.1],
        [with_libproxy=yes; proxy_support=libproxy],
        [AS_IF([test "$with_libproxy" = "yes"],
               [AC_MSG_FAILURE("$LIBPROXY_PKG_ERRORS")])])])
AM_CONDITIONAL(HAVE_LIBPROXY, [test "$with_libproxy" = "yes"])
AC_SUBST(LIBPROXY_CFLAGS)
AC_SUBST(LIBPROXY_LIBS)

dnl **************************************
dnl *** Checks for GNOME proxy backend ***
dnl **************************************
AC_ARG_WITH(gnome-proxy,
    [AC_HELP_STRING([--with-gnome-proxy],
                    [support for GNOME proxy configuration @<:@default=check@:>@])],
    [],
    [with_gnome_proxy=check])
AS_IF([test "$with_gnome_proxy" != "no"],
    [PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, [gsettings-desktop-schemas],
        [with_gnome_proxy=yes; proxy_support="gnome $proxy_support"],
	[AS_IF([test "$with_gnome_proxy" = "yes"],
               [AC_MSG_FAILURE("$GSETTINGS_DESKTOP_SCHEMAS_PKG_ERRORS")])])])
AM_CONDITIONAL(HAVE_GNOME_PROXY, [test "$with_gnome_proxy" = "yes"])
AC_SUBST(GSETTINGS_DESKTOP_SCHEMAS_CFLAGS)

dnl *****************************
dnl *** Checks for GNUTLS     ***
dnl *****************************

GNUTLS_MIN_REQUIRED=3.0

AC_ARG_WITH(gnutls,
    [AC_HELP_STRING([--with-gnutls],
                    [support for GNUTLS @<:@default=yes@:>@])],
    [],
    [with_gnutls=yes])
if test "$with_gnutls" != "no"; then
	PKG_CHECK_MODULES(GNUTLS,
	                  [gnutls >= $GNUTLS_MIN_REQUIRED],
	                  [with_gnutls=yes
	                   tls_support="${tls_support}gnutls "],
	                  [AS_IF([test "$with_gnutls" = "yes"],
	                         [AC_MSG_FAILURE("$GNUTLS_PKG_ERRORS")])])
fi
AM_CONDITIONAL(HAVE_GNUTLS, [test "$with_gnutls" = "yes"])
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LIBS)

if test "$with_gnutls" = "yes"; then
    AC_MSG_CHECKING([location of system Certificate Authority list])
    AC_ARG_WITH(ca-certificates,
		[AC_HELP_STRING([--with-ca-certificates=@<:@path@:>@],
				[path to system Certificate Authority list])])
    if test "$with_ca_certificates" = "no"; then
        AC_MSG_RESULT([disabled])
    else
        if test -z "$with_ca_certificates"; then
	    for f in /etc/pki/tls/certs/ca-bundle.crt \
	       	     /etc/ssl/certs/ca-certificates.crt \
		     /etc/ssl/ca-bundle.pem; do
		if test -f "$f"; then
		    with_ca_certificates="$f"
		fi
	    done
	    if test -z "$with_ca_certificates"; then
		AC_MSG_ERROR([could not find. Use --with-ca-certificates=path to set, or --without-ca-certificates to disable])
	    fi
        fi

        AC_MSG_RESULT($with_ca_certificates)
        AC_DEFINE_UNQUOTED(GTLS_SYSTEM_CA_FILE, ["$with_ca_certificates"], [The system TLS CA list])
    fi
fi

dnl *****************************
dnl *** Checks for pkcs11    ***
dnl *****************************

P11_KIT_REQUIRED=0.8

AC_ARG_WITH(pkcs11,
	[AC_HELP_STRING([--with-pkcs11],
	                [support for pkcs11 @<:@default=check@:>@])],
	                [],
	                [with_pkcs11=check])
if test "$with_pkcs11" != "no"; then
	PKG_CHECK_MODULES(PKCS11,
	                  [p11-kit-1 >= $P11_KIT_REQUIRED],
	                  [with_pkcs11=yes
	                   pkcs11_support=p11-kit
	                   tls_support="${tls_support}gnutls-pkcs11 "
	                   AC_DEFINE_UNQUOTED([HAVE_PKCS11], [1], [Building with PKCS#11 support])],
	                  [AS_IF([test "$with_pkcs11" = "yes"],
	                         [AC_MSG_FAILURE("$PKCS11_PKG_ERRORS")])
	                   pkcs11_support=no])
else
	pkcs11_support=no
fi
AM_CONDITIONAL(HAVE_PKCS11, [test "$with_pkcs11" = "yes"])
AC_SUBST(PKCS11_CFLAGS)
AC_SUBST(PKCS11_LIBS)

dnl ************************************
dnl *** Enable lcov coverage reports ***
dnl ************************************

AC_ARG_ENABLE(gcov,
  AS_HELP_STRING([--enable-gcov],
		 [Enable gcov]),
  [use_gcov=$enableval], [use_gcov=no])

if test "$use_gcov" = "yes"; then
  dnl we need gcc:
  if test "$GCC" != "yes"; then
    AC_MSG_ERROR([GCC is required for --enable-gcov])
  fi

  ltp_version_list="1.6 1.7 1.8 1.9"
  AC_CHECK_PROG(LTP, lcov, lcov)
  AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)

  if test "$LTP"; then
    AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
      glib_cv_ltp_version=invalid
      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
      for ltp_check_version in $ltp_version_list; do
        if test "$ltp_version" = "$ltp_check_version"; then
          glib_cv_ltp_version="$ltp_check_version (ok)"
        fi
      done
    ])
  else
    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
    AC_MSG_ERROR([$ltp_msg])
  fi

  case $glib_cv_ltp_version in
    ""|invalid[)]
      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
      AC_MSG_ERROR([$ltp_msg])
      LTP="exit 0;"
      ;;
  esac

  if test -z "$LTP_GENHTML"; then
    AC_MSG_ERROR([Could not find genhtml from the LTP package])
  fi

  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])

  dnl Remove all optimization flags from CFLAGS
  changequote({,})
  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
  changequote([,])

  dnl Add the special gcc flags
  CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
  LDFLAGS="$LDFLAGS -lgcov"
fi

dnl ****************************************************
dnl *** Warnings to show if using GCC                ***
dnl *** (do this last so -Werror won't mess up tests ***
dnl ****************************************************

AC_ARG_ENABLE(more-warnings,
	      AS_HELP_STRING([--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 -Werror=missing-prototypes \
		-Werror=implicit-function-declaration \
		-Werror=pointer-arith -Werror=init-self -Werror=format=2 \
		-Werror=missing-include-dirs \
		-Werror=declaration-after-statement"
fi

dnl *****************************
dnl *** done                  ***
dnl *****************************
AC_CONFIG_FILES([Makefile
                 po/Makefile.in po/Makefile
                 proxy/libproxy/Makefile
                 proxy/gnome/Makefile
                 proxy/tests/Makefile
                 tls/gnutls/Makefile
                 tls/pkcs11/Makefile
                 tls/tests/Makefile
                ])
AC_OUTPUT

echo ""
echo     "  Proxy support:     ${proxy_support:-no}"
echo     "  TLS support:       ${tls_support:-no}"
if test "$tls_support" != "no"; then
    echo "  PKCS#11 Support:   $pkcs11_support"
    echo "  TLS CA file:       ${with_ca_certificates:-(none)}"
    if test "x$with_ca_certificates" != xno -a -n "$with_ca_certificates"; then
	if ! test -f "$with_ca_certificates"; then
	    AC_MSG_WARN([Specified certificate authority file '$with_ca_certificates' does not exist])
	fi
    fi
fi