From 1f4f072346e388d7b6b6cf79b111952069c4e95c Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 14 Jan 2014 10:00:36 +0100 Subject: Build in srcdir != builddir fashion by default Naturally this doesn't apply to tarballs --- .gitignore | 7 +++++++ Makefile.am | 4 ++-- autogen.sh | 3 ++- automaint.sh | 6 +++--- build/Makefile.am | 9 --------- build/certs/Makefile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ build/certs/Makefile.am | 51 ------------------------------------------------- configure.ac | 2 -- doc/manual/Makefile.am | 3 ++- 9 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 build/Makefile.am create mode 100644 build/certs/Makefile delete mode 100644 build/certs/Makefile.am diff --git a/.gitignore b/.gitignore index cd5978e..5c18615 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ config.sub configure configure.tmp depcomp +makefile install-sh INSTALL libtool @@ -61,8 +62,14 @@ x86_64-w64-mingw32 /x86_64_w64-mingw32/ /build/m4/*.m4 +/build/common /build/coverage /build/coverage.info +/build/doc/ +/build/p11-kit/ +/build/p11-kit-[0123456789]*/ +/build/po/ +/build/trust/ /local /common/tests/hash-test diff --git a/Makefile.am b/Makefile.am index 03fc5dc..7170058 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,6 @@ TRUST_DIR = endif SUBDIRS = \ - build \ common \ p11-kit \ $(TRUST_DIR) \ @@ -64,7 +63,8 @@ upload-release: $(DIST_ARCHIVES) scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig $(WEBHOST):$(WEBBASE)/releases/ EXTRA_DIST = \ - config.rpath \ + build/Makefile.tests \ + build/Makefile.decl \ HACKING transifex: diff --git a/autogen.sh b/autogen.sh index 696f490..96cb604 100755 --- a/autogen.sh +++ b/autogen.sh @@ -27,6 +27,7 @@ test -f configure.ac~ && mv configure.ac~ configure.ac autoreconf --force --install --verbose if test x"$NOCONFIGURE" = x; then - exec ./configure "$@" + cd build/ + exec ../configure "$@" fi diff --git a/automaint.sh b/automaint.sh index 487bf50..8859dcc 100755 --- a/automaint.sh +++ b/automaint.sh @@ -23,7 +23,7 @@ configure() # Configure the local build. To control which arguments are used create a # CONFIG_SITE script as directed in the autoconf documentation: # http://www.gnu.org/software/autoconf/manual/autoconf.html#Site-Defaults -configure ./local --prefix=/usr --enable-doc --enable-coverage $ARGS "$@" +configure ./build --prefix=/usr --enable-doc --enable-coverage $ARGS "$@" # Configure the cross builds for cross in $CROSS; do @@ -37,7 +37,7 @@ done for target in all check clean distclean; do echo "$target:" - echo ' $(MAKE) -C ./local' $target + echo ' $(MAKE) -C ./build' $target echo ' @for dir in $(CROSS); do \' echo ' $(MAKE) -C ./$$dir' $target '; \' echo ' done' @@ -46,7 +46,7 @@ done for target in distcheck memcheck leakcheck hellcheck install upload-coverage \ coverage upload-doc upload-release transifex; do echo "$target:" - echo ' $(MAKE) -C ./local' $target + echo ' $(MAKE) -C ./build' $target done ) > ./makefile diff --git a/build/Makefile.am b/build/Makefile.am deleted file mode 100644 index 11337b1..0000000 --- a/build/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -SUBDIRS = certs - -EXTRA_DIST = \ - Makefile.tests - -memcheck: - -leakcheck: diff --git a/build/certs/Makefile b/build/certs/Makefile new file mode 100644 index 0000000..4e61b14 --- /dev/null +++ b/build/certs/Makefile @@ -0,0 +1,51 @@ + +# Note that nothing here is distributed. It just lives in the git repository +# We copy everything into its final location, and those test files are +# distributed in the tarballs + +TRUST = ../../trust/tests + +prepare-certs: + cp -v cacert3.der $(TRUST)/input/anchors + cp -v cacert3.der $(TRUST)/files + cp -v cacert3.der $(TRUST)/files + openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem + openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem + cat $(TRUST)/files/cacert3.pem $(TRUST)/files/cacert3.pem > $(TRUST)/files/cacert3-twice.pem + openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted.pem \ + -addtrust serverAuth -addreject emailProtection \ + -setalias "Custom Label" + cp $(TRUST)/files/cacert3-trusted.pem $(TRUST)/files/cacert3-trusted-server-alias.pem + openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted-alias.pem \ + -setalias "Custom Label" + openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-distrust-all.pem \ + -addreject serverAuth -addreject clientAuth -addreject codeSigning \ + -addreject emailProtection -addreject ipsecEndSystem -addreject ipsecTunnel \ + -addreject ipsecUser -addreject timeStamping + openssl x509 -in verisign-v1.der -inform DER -out $(TRUST)/files/verisign-v1.pem \ + -setalias "Custom Label" + cat $(TRUST)/files/cacert3-trusted-server-alias.pem \ + $(TRUST)/files/verisign-v1.pem > $(TRUST)/files/multiple.pem + cp -v cacert-ca.der $(TRUST)/input + cp -v cacert-ca.der $(TRUST)/files + openssl x509 -in redhat-newca.der -inform DER -out $(TRUST)/files/distrusted.pem \ + -addreject clientAuth -setalias "Red Hat Is the CA" + cp -v $(TRUST)/files/distrusted.pem $(TRUST)/input + cp -v self-server.der $(TRUST)/input/blacklist + cp -v self-signed-with-eku.der $(TRUST)/files + cp -v self-signed-with-ku.der $(TRUST)/files + cp -v testing-ca.der $(TRUST)/input/anchors + cp -v testing-server.der $(TRUST)/files + +# Rebuild the self-signed certificates. This is almost never necessary and +# will require other changes in the code, mostly here as documentation +build-self-signed: + openssl req -new -x509 -outform DER -out self-signed-with-eku.der \ + -newkey rsa -keyout /dev/null -nodes -subj /CN=self-signed-with-eku.example.com \ + -config with-eku.conf -set_serial 888 -extensions v3_ca + openssl req -new -x509 -outform DER -out self-signed-with-ku.der \ + -newkey rsa -keyout /dev/null -nodes -subj /CN=self-signed-with-ku.example.com \ + -config with-ku.conf -set_serial 888 -extensions v3_ca + openssl req -new -x509 -outform DER -out distant-end-date.der \ + -newkey rsa:512 -keyout /dev/null -nodes -subj /CN=far-in-the-future.example.com \ + -config with-ku.conf -set_serial 999 -extensions v3_ca -days 20000 diff --git a/build/certs/Makefile.am b/build/certs/Makefile.am deleted file mode 100644 index 031cba0..0000000 --- a/build/certs/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ - -# Note that nothing here is distributed. It just lives in the git repository -# We copy everything into its final location, and those test files are -# distributed in the tarballs - -TRUST = $(top_srcdir)/trust/tests - -prepare-certs: - cp -v cacert3.der $(TRUST)/input/anchors - cp -v cacert3.der $(TRUST)/files - cp -v cacert3.der $(TRUST)/files - openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem - openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem - cat $(TRUST)/files/cacert3.pem $(TRUST)/files/cacert3.pem > $(TRUST)/files/cacert3-twice.pem - openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted.pem \ - -addtrust serverAuth -addreject emailProtection \ - -setalias "Custom Label" - cp $(TRUST)/files/cacert3-trusted.pem $(TRUST)/files/cacert3-trusted-server-alias.pem - openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted-alias.pem \ - -setalias "Custom Label" - openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-distrust-all.pem \ - -addreject serverAuth -addreject clientAuth -addreject codeSigning \ - -addreject emailProtection -addreject ipsecEndSystem -addreject ipsecTunnel \ - -addreject ipsecUser -addreject timeStamping - openssl x509 -in verisign-v1.der -inform DER -out $(TRUST)/files/verisign-v1.pem \ - -setalias "Custom Label" - cat $(TRUST)/files/cacert3-trusted-server-alias.pem \ - $(TRUST)/files/verisign-v1.pem > $(TRUST)/files/multiple.pem - cp -v cacert-ca.der $(TRUST)/input - cp -v cacert-ca.der $(TRUST)/files - openssl x509 -in redhat-newca.der -inform DER -out $(TRUST)/files/distrusted.pem \ - -addreject clientAuth -setalias "Red Hat Is the CA" - cp -v $(TRUST)/files/distrusted.pem $(TRUST)/input - cp -v self-server.der $(TRUST)/input/blacklist - cp -v self-signed-with-eku.der $(TRUST)/files - cp -v self-signed-with-ku.der $(TRUST)/files - cp -v testing-ca.der $(TRUST)/input/anchors - cp -v testing-server.der $(TRUST)/files - -# Rebuild the self-signed certificates. This is almost never necessary and -# will require other changes in the code, mostly here as documentation -build-self-signed: - openssl req -new -x509 -outform DER -out self-signed-with-eku.der \ - -newkey rsa -keyout /dev/null -nodes -subj /CN=self-signed-with-eku.example.com \ - -config with-eku.conf -set_serial 888 -extensions v3_ca - openssl req -new -x509 -outform DER -out self-signed-with-ku.der \ - -newkey rsa -keyout /dev/null -nodes -subj /CN=self-signed-with-ku.example.com \ - -config with-ku.conf -set_serial 888 -extensions v3_ca - openssl req -new -x509 -outform DER -out distant-end-date.der \ - -newkey rsa:512 -keyout /dev/null -nodes -subj /CN=far-in-the-future.example.com \ - -config with-ku.conf -set_serial 999 -extensions v3_ca -days 20000 diff --git a/configure.ac b/configure.ac index b9b538a..4538079 100644 --- a/configure.ac +++ b/configure.ac @@ -500,8 +500,6 @@ privatedir='${libdir}/p11-kit' AC_SUBST(privatedir) AC_CONFIG_FILES([Makefile - build/Makefile - build/certs/Makefile common/Makefile common/tests/Makefile doc/Makefile diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am index ce32df3..c9ff264 100644 --- a/doc/manual/Makefile.am +++ b/doc/manual/Makefile.am @@ -130,7 +130,8 @@ XSLTPROC_FLAGS = \ --stringparam man.copyright.section.enabled 0 XSLTPROC_MAN = \ - $(XSLTPROC) $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl + $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(builddir) \ + http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl trust.1: trust.xml $(generate_files) $(AM_V_GEN) $(XSLTPROC_MAN) $< -- cgit v1.1