From 63dd3b9936c22270c7f21da8965a01445ade4973 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 19 Nov 2018 17:41:41 +0000 Subject: Removed GNU Binutils, CMake's built with its own bootstrap When the C compiler is not GNU GCC, linking with GNU Binutils is going to cause problems. So until the time that we can include GCC into this pipeline, its best to avoid Binutils also. Also, for building CMake, we were relying on an installed CMake, but now, we are using its own `./bootstrap' script, so it can be built even if the host system doesn't have CMake. Also, for TeX Live, we are now setting a custom file as main target to avoid complications with symbolic links as targets in Make. Finally, when the user says they don't want to re-write an existing configuration file, no extra notices will be printed and the configure script will immediately start building programs. --- configure | 14 +- paper.tex | 10 +- reproduce/config/pipeline/dependency-versions.mk | 1 - reproduce/src/make/dependencies-basic.mk | 53 ++----- reproduce/src/make/dependencies-build-rules.mk | 4 +- reproduce/src/make/dependencies.mk | 172 ++++++++++++++--------- reproduce/src/make/initialize.mk | 1 - 7 files changed, 132 insertions(+), 123 deletions(-) diff --git a/configure b/configure index 5403a77..34323a5 100755 --- a/configure +++ b/configure @@ -134,6 +134,7 @@ EOF # `LOCAL.mk' is the top-most local configuration for the pipeline. If it # already exists when this script is run, we'll make a copy of it as backup # (for example the user might have ran `./configure' by mistake). +printnotice=yes rewritepconfig=yes rewritegconfig=yes if [ -f $pconf ] || [ -f $glconf ]; then @@ -149,6 +150,7 @@ if [ -f $pconf ] || [ -f $glconf ]; then # Set `rewriteconfig'. if [ $userread = "n" ]; then + printnotice=no if [ -f $pconf ]; then rewritepconfig=no; fi if [ -f $glconf ]; then rewritegconfig=no; fi fi @@ -420,7 +422,7 @@ else export static_build="no" fi rm -f $oprog $cprog -if [ $static_build = "no" ]; then +if [ $printnotice = yes ] && [ $static_build = "no" ]; then cat < $@ + + +$(ilidir)/libgit2: $(tdir)/libgit2-$(libgit2-version).tar.gz \ + $(ibdir)/cmake \ + $(ibdir)/curl | $(ilidir) + $(call cbuild, $<, libgit2-$(libgit2-version), static, \ + -DUSE_SSH=OFF -DUSE_OPENSSL=OFF -DBUILD_CLAR=OFF \ + -DTHREADSAFE=ON) \ + && echo "Libgit2 is built" > $@ + +$(ilidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz \ + $(ibdir)/ls | $(ilidir) + $(call gbuild, $<, gsl-$(gsl-version), static) \ + && echo "GNU Scientific Library is built" > $@ + +$(ilidir)/libjpeg: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz | $(ilidir) + $(call gbuild, $<, jpeg-9b, static) && echo "Libjpeg is built" > $@ + +$(ilidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \ + $(ibdir)/ls | $(ilidir) + $(call gbuild, $<, tiff-$(libtiff-version), static) \ + && echo "Libtiff is built" > $@ + +$(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ + $(ilidir)/cfitsio | $(ilidir) # Unfortunately WCSLIB forces the building of shared libraries. So # we'll allow it to finish, then remove the shared libraries # afterwards. - $(call gbuild,$(subst $(tdir)/,,$<), wcslib-$(wcslib-version), , \ - LIBS="-pthread -lcurl -lm" --without-pgplot \ - --disable-fortran) - rm -f $(ildir)/libwcs.so* + $(call gbuild, $<, wcslib-$(wcslib-version), , \ + LIBS="-pthread -lcurl -lm" --without-pgplot \ + --disable-fortran) \ + && echo "WCSLIB is built" > $@ + +# Zlib: its `./configure' doesn't use Autoconf's configure script, it just +# accepts a direct `--static' option. +$(ilidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz | $(ilidir) +ifeq ($(static_build),yes) + $(call gbuild, $<, zlib-$(zlib-version), , --static) \ + && echo "Zlib is built" > $@ +else + $(call gbuild, $<, zlib-$(zlib-version)) && echo "Zlib is built" > $@ +endif @@ -192,58 +220,69 @@ $(ildir)/libwcs.a: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ # Programs # -------- +# +# CMake can be built with its custom `./bootstrap' script. $(ibdir)/cmake: $(tdir)/cmake-$(cmake-version).tar.gz \ $(ibdir)/ls - $(call cbuild,$(subst $(tdir)/,,$<), cmake-$(cmake-version)) + cd $(ddir) && rm -rf cmake-$(cmake-version) && \ + tar xf $< && cd cmake-$(cmake-version) && \ + ./bootstrap --prefix=$(idir) && make && make install && \ + cd ..&& rm -rf cmake-$(cmake-version) $(ibdir)/curl: $(tdir)/curl-$(curl-version).tar.gz \ - $(ildir)/libz.a \ + $(ilidir)/zlib \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), curl-$(curl-version), static, \ - --without-brotli) + $(call gbuild, $<, curl-$(curl-version), static, --without-brotli) $(ibdir)/ls: $(tdir)/coreutils-$(coreutils-version).tar.xz - $(call gbuild,$(subst $(tdir)/,,$<), coreutils-$(coreutils-version), \ - static) + $(call gbuild, $<, coreutils-$(coreutils-version), static) $(ibdir)/gawk: $(tdir)/gawk-$(gawk-version).tar.lz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), gawk-$(gawk-version), static) + $(call gbuild, $<, gawk-$(gawk-version), static) $(ibdir)/sed: $(tdir)/sed-$(sed-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), sed-$(sed-version), static) + $(call gbuild, $<, sed-$(sed-version), static) $(ibdir)/grep: $(tdir)/grep-$(grep-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), grep-$(grep-version), static) + $(call gbuild, $<, grep-$(grep-version), static) $(ibdir)/libtool: $(tdir)/libtool-$(libtool-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), libtool-$(libtool-version), static) + $(call gbuild, $<, libtool-$(libtool-version), static) $(ibdir)/gs: $(tdir)/ghostscript-$(ghostscript-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), ghostscript-$(ghostscript-version)) + $(call gbuild, $<, ghostscript-$(ghostscript-version)) $(ibdir)/git: $(tdir)/git-$(git-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir)/,,$<), git-$(git-version), static) + $(call gbuild, $<, git-$(git-version), static) $(ibdir)/astnoisechisel: $(tdir)/gnuastro-$(gnuastro-version).tar.lz \ - $(ildir)/libgsl.a \ - $(ildir)/libcfitsio.a \ - $(ildir)/libwcs.a \ $(ibdir)/gs \ - $(ildir)/libjpeg.a \ - $(ildir)/libtiff.a \ - $(ildir)/libgit2.a \ - - $(call gbuild,$(subst $(tdir)/,,$<), gnuastro-$(gnuastro-version), \ - static, --enable-static=yes --enable-shared=no, -j8, \ - make check -j8) - -$(ibdir)/latex: reproduce/config/pipeline/dependency-texlive.mk + $(ilidir)/gsl \ + $(ilidir)/wcslib \ + $(ilidir)/libjpeg \ + $(ilidir)/libtiff \ + $(ilidir)/libgit2 +ifeq ($(static_build),yes) + $(call gbuild, $<, gnuastro-$(gnuastro-version), static, \ + --enable-static=yes --enable-shared=no, -j8, \ + make check -j8) +else + $(call gbuild, $<, gnuastro-$(gnuastro-version), , , -j8, \ + make check -j8) +endif + +# Since we want to avoid complicating the PATH, we are putting a symbolic +# link of all the TeX Live executables in $(ibdir). Therefore, since the +# symbolic link is hard to track for Make (as a target), we'll make a +# simple ASCII file called `texlive-ready' when it is complete and use that +# as a target. +$(ibdir)/texlive-ready: reproduce/config/pipeline/dependency-texlive.mk # We'll need the current directory later down. topdir=$$(pwd) @@ -273,10 +312,6 @@ $(ibdir)/latex: reproduce/config/pipeline/dependency-texlive.mk # `ibdir'. For `latex' do a copy, because it is the target of # this rule and it won't cause problems. ln -fs $(idir)/texlive/20*/bin/*/* $(ibdir)/ - rm $@ - cp $(idir)/texlive/20*/bin/*/latex $@ - else - echo "Not able to download TeX Live installer" > $@ fi fi @@ -314,3 +349,8 @@ $(ibdir)/latex: reproduce/config/pipeline/dependency-texlive.mk printf("\\newcommand{\\tex%sversion}{%s}\n",\ name, version)}' >> $$tv fi + + # Write the target if TeX live was actually installed. + if [ -f $(idir)/texlive/20*/bin/*/latex ]; then + echo "TeX Live is installed." > $@ + fi; diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index 2cc393c..694aca0 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -191,7 +191,6 @@ $(mtexdir)/initialize.tex: | $(mtexdir) # Versions of programs (same order as 'dependency-versions.mk'). $(call pvcheck, bash, $(bash-version), GNU Bash, bashversion) - $(call pvcheck, nm, $(binutils-version), GNU Binutils, binutilsversion) $(call pvcheck, cmake, $(cmake-version), CMake, cmakeversion) $(call pvcheck, curl, $(curl-version), cURL, curlversion) $(call pvcheck, ls, $(coreutils-version), GNU Coreutils, \ -- cgit v1.2.1