aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-07-15 20:00:21 -0500
committerBrent Cook <bcook@openbsd.org>2015-07-15 20:02:38 -0500
commitdb974c34e95a24eda7ce575cc14bbc0eebfbdbb4 (patch)
treef884d9c33c5dd2c5e44b42d8b104a4117bbb2ea2
parent4cffda193ba3fd6d0a167e5188ae52517c0c476d (diff)
downloadportable-db974c34e95a24eda7ce575cc14bbc0eebfbdbb4.tar.gz
portable-db974c34e95a24eda7ce575cc14bbc0eebfbdbb4.tar.bz2
portable-db974c34e95a24eda7ce575cc14bbc0eebfbdbb4.zip
fixup how OPENSSLDIR is derived and expanded
As per http://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html we should not try to expand variables like sysconfdir in the configure script, but rather derive the correct value in the Makefiles instead. This fixes missing expansions as the preprocessor define.
-rw-r--r--apps/Makefile.am26
-rw-r--r--configure.ac7
-rw-r--r--crypto/Makefile.am6
3 files changed, 27 insertions, 12 deletions
diff --git a/apps/Makefile.am b/apps/Makefile.am
index d756e10..0547876 100644
--- a/apps/Makefile.am
+++ b/apps/Makefile.am
@@ -90,18 +90,28 @@ EXTRA_DIST += openssl.cnf
90EXTRA_DIST += x509v3.cnf 90EXTRA_DIST += x509v3.cnf
91 91
92install-exec-hook: 92install-exec-hook:
93 @mkdir -p "$(DESTDIR)/$(OPENSSLDIR)" 93 @if [ "@OPENSSLDIR@x" != "x" ]; then \
94 @for i in cert.pem openssl.cnf x509v3.cnf; do \ 94 OPENSSLDIR="$(DESTDIR)/@OPENSSLDIR@"; \
95 if [ ! -f "$(DESTDIR)/$(OPENSSLDIR)/$i" ]; then \ 95 else \
96 $(INSTALL) -m 644 "$(srcdir)/$$i" "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \ 96 OPENSSLDIR="$(DESTDIR)/$(sysconfdir)/ssl"; \
97 fi; \
98 mkdir -p "$$OPENSSLDIR/certs"; \
99 for i in cert.pem openssl.cnf x509v3.cnf; do \
100 if [ ! -f "$$OPENSSLDIR/$i" ]; then \
101 $(INSTALL) -m 644 "$(srcdir)/$$i" "$$OPENSSLDIR/$$i"; \
97 else \ 102 else \
98 echo " $(DESTDIR)/$(OPENSSLDIR)/$$i already exists, install will not overwrite"; \ 103 echo " $$OPENSSLDIR/$$i already exists, install will not overwrite"; \
99 fi \ 104 fi \
100 done 105 done
101 106
102uninstall-local: 107uninstall-local:
103 @for i in cert.pem openssl.cnf x509v3.cnf; do \ 108 @if [ "@OPENSSLDIR@x" != "x" ]; then \
104 if cmp -s "$(DESTDIR)/$(OPENSSLDIR)/$$i" "$(srcdir)/$$i"; then \ 109 OPENSSLDIR="$(DESTDIR)/@OPENSSLDIR@"; \
105 rm -f "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \ 110 else \
111 OPENSSLDIR="$(DESTDIR)/$(sysconfdir)/ssl"; \
112 fi; \
113 for i in cert.pem openssl.cnf x509v3.cnf; do \
114 if cmp -s "$$OPENSSLDIR/$$i" "$(srcdir)/$$i"; then \
115 rm -f "$$OPENSSLDIR/$$i"; \
106 fi \ 116 fi \
107 done 117 done
diff --git a/configure.ac b/configure.ac
index 4f6fb38..43ef0cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,11 +57,10 @@ AC_CHECK_HEADERS([err.h])
57AC_ARG_WITH([openssldir], 57AC_ARG_WITH([openssldir],
58 AS_HELP_STRING([--with-openssldir], 58 AS_HELP_STRING([--with-openssldir],
59 [Set the default openssl directory]), 59 [Set the default openssl directory]),
60 OPENSSLDIR="$withval", 60 OPENSSLDIR="$withval"
61 OPENSSLDIR="$sysconfdir/ssl" 61 AC_SUBST(OPENSSLDIR)
62) 62)
63AC_SUBST(OPENSSLDIR) 63AM_CONDITIONAL([OPENSSLDIR_DEFINED], [test x$with_openssldir != x])
64AC_DEFINE_UNQUOTED(OPENSSLDIR, "$OPENSSLDIR")
65 64
66AC_ARG_ENABLE([extratests], 65AC_ARG_ENABLE([extratests],
67 AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms])) 66 AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms]))
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index 4fba77b..f8c7108 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -20,6 +20,12 @@ libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM
20endif 20endif
21endif 21endif
22 22
23if OPENSSLDIR_DEFINED
24libcrypto_la_CPPFLAGS += -DOPENSSLDIR=\"@OPENSSLDIR@\"
25else
26libcrypto_la_CPPFLAGS += -DOPENSSLDIR=\"$(sysconfdir)/ssl\"
27endif
28
23noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la 29noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la
24 30
25# compatibility functions that need to be built without optimizations 31# compatibility functions that need to be built without optimizations