diff options
author | Rob Bradford <rob@linux.intel.com> | 2011-11-10 16:23:16 +0000 |
---|---|---|
committer | Rob Bradford <rob@linux.intel.com> | 2011-11-10 16:23:16 +0000 |
commit | 9229ec62b17660536d1bb1e9af6abab2c1ea6dac (patch) | |
tree | 1a143a0ba53efb46231784b1e7e91e5a4eed7894 | |
parent | 8baf1e6bfd54d132ffde98c5a56052cdc1f8db72 (diff) |
build: Detect CA file location
It will autodetect and also allow the setting of the CA file by a configure
option.
This code was stolen from glib-networking's configure.ac
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=663783
-rw-r--r-- | configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 7b6d515..37a2e0f 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,30 @@ AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"]) AC_SUBST([GCOV_CFLAGS]) AC_SUBST([GCOV_LDFLAGS]) +dnl Stolen from glib-networking - those guys rock +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; 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(REST_SYSTEM_CA_FILE, ["$with_ca_certificates"], [The system TLS CA list]) +fi + AC_OUTPUT([ Makefile rest/Makefile |