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.
This commit is contained in:
Brent Cook
2015-07-15 20:00:21 -05:00
parent 4cffda193b
commit db974c34e9
3 changed files with 27 additions and 12 deletions

View File

@@ -90,18 +90,28 @@ EXTRA_DIST += openssl.cnf
EXTRA_DIST += x509v3.cnf
install-exec-hook:
@mkdir -p "$(DESTDIR)/$(OPENSSLDIR)"
@for i in cert.pem openssl.cnf x509v3.cnf; do \
if [ ! -f "$(DESTDIR)/$(OPENSSLDIR)/$i" ]; then \
$(INSTALL) -m 644 "$(srcdir)/$$i" "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \
@if [ "@OPENSSLDIR@x" != "x" ]; then \
OPENSSLDIR="$(DESTDIR)/@OPENSSLDIR@"; \
else \
OPENSSLDIR="$(DESTDIR)/$(sysconfdir)/ssl"; \
fi; \
mkdir -p "$$OPENSSLDIR/certs"; \
for i in cert.pem openssl.cnf x509v3.cnf; do \
if [ ! -f "$$OPENSSLDIR/$i" ]; then \
$(INSTALL) -m 644 "$(srcdir)/$$i" "$$OPENSSLDIR/$$i"; \
else \
echo " $(DESTDIR)/$(OPENSSLDIR)/$$i already exists, install will not overwrite"; \
echo " $$OPENSSLDIR/$$i already exists, install will not overwrite"; \
fi \
done
uninstall-local:
@for i in cert.pem openssl.cnf x509v3.cnf; do \
if cmp -s "$(DESTDIR)/$(OPENSSLDIR)/$$i" "$(srcdir)/$$i"; then \
rm -f "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \
@if [ "@OPENSSLDIR@x" != "x" ]; then \
OPENSSLDIR="$(DESTDIR)/@OPENSSLDIR@"; \
else \
OPENSSLDIR="$(DESTDIR)/$(sysconfdir)/ssl"; \
fi; \
for i in cert.pem openssl.cnf x509v3.cnf; do \
if cmp -s "$$OPENSSLDIR/$$i" "$(srcdir)/$$i"; then \
rm -f "$$OPENSSLDIR/$$i"; \
fi \
done