From 627cee6910ffd181552d6dca01501154b4d78372 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Tue, 4 Dec 2018 13:26:32 +0000 Subject: Configure script for GNU Build system now an input argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, we were checking the existance of the `configure' file and if it wasn't present, we would check for `config' (for OpenSSL which also has a lower-level "Configure" script that is called by the `config' script). But after two tests on Mac machines by Raul Infante Sainz and Cristina Martínez Lombilla, we found out that Mac Os's file names aren't case sensitive and thus the build wouldn't use `config', but `Configure'. Now, the exact configuration script can be specified as the 7th argument to the `gbuild' script. If it isn't given, the standard `configure' name will be used, but when it is, the given name will be used. --- reproduce/src/make/dependencies-basic.mk | 5 +++-- reproduce/src/make/dependencies-build-rules.mk | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk index ea59566..89584cb 100644 --- a/reproduce/src/make/dependencies-basic.mk +++ b/reproduce/src/make/dependencies-basic.mk @@ -315,7 +315,7 @@ $(idir)/etc:; mkdir $@ $(ilidir): | $(ildir); mkdir $@ $(ilidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz \ $(ibdir)/make | $(ilidir) - $(call gbuild, $<,zlib-$(zlib-version)) && echo "Zlib is built" > $@ + $(call gbuild, $<, zlib-$(zlib-version)) && echo "Zlib is built" > $@ # OpenSSL: Some programs/libraries later need dynamic linking. So we'll # build libssl (and libcrypto) dynamically also. @@ -350,7 +350,8 @@ $(ilidir)/openssl: $(tdir)/openssl-$(openssl-version).tar.gz \ $(rpath_command) \ --openssldir=$(idir)/etc/ssl \ --with-zlib-lib=$(ildir) \ - --with-zlib-include=$(idir)/include ) && \ + --with-zlib-include=$(idir)/include, , , \ + ./config ) && \ cp $(tdir)/cert.pem $(idir)/etc/ssl/cert.pem && \ echo "OpenSSL is built and ready" > $@ diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk index 4de9a4e..25a95af 100644 --- a/reproduce/src/make/dependencies-build-rules.mk +++ b/reproduce/src/make/dependencies-build-rules.mk @@ -48,6 +48,7 @@ # 4: Extra configuration options. # 5: Extra options/arguments to pass to Make. # 6: Step to run between `make' and `make install': usually `make check'. +# 7: The configuration script (`configure' by default). # # NOTE: Unfortunately the configure script of `zlib' doesn't recognize # `SHELL'. So we'll have to remove it from the call to the configure @@ -61,28 +62,28 @@ gbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \ if ! tar xf $(1); then echo; echo "Tar error"; exit 1; fi; \ cd $(2); \ \ - if [ -f configure ]; then confscript=configure; \ - elif [ -f config ]; then confscript=config; \ + if [ x"$(strip $(7))" = x ]; then confscript=./configure; \ + else confscript="$(strip $(7))"; \ fi; \ \ if [ -f $(ibdir)/bash ]; then \ sed $$confscript -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ - > tmp-$$confscript; \ - mv tmp-$$confscript $$confscript; \ + > $$confscript-tmp; \ + mv $$confscript-tmp $$confscript; \ chmod +x $$confscript; \ shellop="SHELL=$(ibdir)/bash"; \ elif [ -f /bin/bash ]; then shellop="SHELL=/bin/bash"; \ else shellop="SHELL=/bin/sh"; \ fi; \ \ - if [ x"$(2)" = x"zlib-$(zlib-version)" ]; then \ + if [ x"$(strip $(2))" = x"zlib-$(zlib-version)" ]; then \ configop="--prefix=$(idir)"; \ else configop="$$shellop --prefix=$(idir)"; \ fi; \ \ echo; echo "Using '$$confscript' to configure..."; echo; \ - ./$$confscript $(4) $$configop && \ + $$confscript $(4) $$configop && \ make "$$shellop" $(5) && \ $$check && \ make "$$shellop" install && \ -- cgit v1.2.1