From 22d915e020643797eab6f3f3017752cb1f6b0178 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 6 May 2020 00:45:22 +0100 Subject: Software are rebuilt automatically with change of version Until now, when you changed the version of a software in an already-built system, its tarball would be downloaded, but it wouldn't actually build. The only way would be to force the build by deleting the main target of that file (under `.local/version-info/TYPE/PROGRAM'). This was because the tarballs were an order-only prerequisite which was implemented some time ago based on some theoretical argument that if the tarball dates changes, the software should not be rebuilt (because we check the checksum). However, the problems this causes are more than those it solves: Users may forget to delete the main target of the program and mistakenly think that they are using the new version. The fact that all the numbers going into the paper also contain this number further hides this. With this commit, tarballs are no longer order-only and any time a version of a software is updated, it will be automatically built and not cause confusion and manual intervention by the users. As a result of this change, I also had to correct the way we find the tarball from the list of prerequisites. --- reproduce/software/make/basic.mk | 189 ++++++++++++++++++++------------------- 1 file changed, 96 insertions(+), 93 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 0bec163..1709082 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -344,7 +344,7 @@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) # The first set of programs to be built are those that we need to unpack # the source code tarballs of each program. First, we'll build the # necessary programs, then we'll build GNU Tar. -$(ibidir)/gzip: | $(tdir)/gzip-$(gzip-version).tar.gz +$(ibidir)/gzip: $(tdir)/gzip-$(gzip-version).tar.gz $(call gbuild, gzip-$(gzip-version), static, , V=1) \ && echo "GNU Gzip $(gzip-version)" > $@ @@ -355,15 +355,15 @@ lzipconf="LDFLAGS=-static" else lzipconf= endif -$(ibidir)/lzip: | $(tdir)/lzip-$(lzip-version).tar.gz +$(ibidir)/lzip: $(tdir)/lzip-$(lzip-version).tar.gz $(call gbuild, lzip-$(lzip-version), , $(lzipconf)) \ && echo "Lzip $(lzip-version)" > $@ -$(ibidir)/xz: | $(tdir)/xz-$(xz-version).tar.gz +$(ibidir)/xz: $(tdir)/xz-$(xz-version).tar.gz $(call gbuild, xz-$(xz-version), static) \ && echo "XZ Utils $(xz-version)" > $@ -$(ibidir)/bzip2: | $(tdir)/bzip2-$(bzip2-version).tar.gz +$(ibidir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz # Bzip2 doesn't have a `./configure' script, and its Makefile # doesn't build a shared library. So we can't use the `gbuild' # function here and we need to take some extra steps (inspired @@ -386,7 +386,7 @@ $(ibidir)/bzip2: | $(tdir)/bzip2-$(bzip2-version).tar.gz fi; \ fi; \ cd $(ddir) && rm -rf $$tdir \ - && tar xf $(word 1,$(filter $(tdir)/%,$|)) \ + && tar xf $(word 1,$(filter $(tdir)/%,$^)) \ && cd $$tdir \ && sed -e 's@\(ln -s -f \)$$(PREFIX)/bin/@\1@' Makefile \ > Makefile.sed \ @@ -402,7 +402,7 @@ $(ibidir)/bzip2: | $(tdir)/bzip2-$(bzip2-version).tar.gz && ln -fs libbz2.so.1.0 libbz2.so \ && echo "Bzip2 $(bzip2-version)" > $@ -$(ibidir)/unzip: | $(tdir)/unzip-$(unzip-version).tar.gz +$(ibidir)/unzip: $(tdir)/unzip-$(unzip-version).tar.gz v=$$(echo $(unzip-version) | sed -e's/\.//'); \ $(call gbuild, unzip$$v, static,, \ -f unix/Makefile generic_gcc \ @@ -411,7 +411,7 @@ $(ibidir)/unzip: | $(tdir)/unzip-$(unzip-version).tar.gz BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 ) \ && echo "Unzip $(unzip-version)" > $@ -$(ibidir)/zip: | $(tdir)/zip-$(zip-version).tar.gz +$(ibidir)/zip: $(tdir)/zip-$(zip-version).tar.gz v=$$(echo $(zip-version) | sed -e's/\.//'); \ $(call gbuild, zip$$v, static,, \ -f unix/Makefile generic_gcc \ @@ -425,7 +425,7 @@ $(ibidir)/zip: | $(tdir)/zip-$(zip-version).tar.gz # # Note for a static-only build: Zlib's `./configure' doesn't use Autoconf's # configure script, it just accepts a direct `--static' option. -$(ibidir)/zlib: | $(tdir)/zlib-$(zlib-version).tar.gz +$(ibidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz $(call gbuild, zlib-$(zlib-version)) \ && echo "Zlib $(zlib-version)" > $@ @@ -435,13 +435,13 @@ $(ibidir)/zlib: | $(tdir)/zlib-$(zlib-version).tar.gz # Tar to be the last compression-related software (the first-set of # software to be built). $(ibidir)/tar: $(ibidir)/xz \ - $(ibidir)/zip \ + $(ibidir)/zip \ $(ibidir)/gzip \ $(ibidir)/lzip \ $(ibidir)/zlib \ $(ibidir)/bzip2 \ - $(ibidir)/unzip \ - | $(tdir)/tar-$(tar-version).tar.gz + $(ibidir)/unzip \ + $(tdir)/tar-$(tar-version).tar.gz # Since all later programs depend on Tar, the configuration will be # stuck here, only making Tar. So its more efficient to built it on # multiple threads (when the user's Make doesn't pass down the @@ -469,14 +469,14 @@ $(ibidir)/tar: $(ibidir)/xz \ # function (for tilde expansion). The first can be disabled with # `--disable-load', but unfortunately I don't know any way to fix the # second. So, we'll have to build it dynamically for now. -$(ibidir)/make: | $(ibidir)/tar \ - $(tdir)/make-$(make-version).tar.gz +$(ibidir)/make: $(ibidir)/tar \ + $(tdir)/make-$(make-version).tar.gz # See Tar's comments for the `-j' option. $(call gbuild, make-$(make-version), , , -j$(numthreads)) \ && echo "GNU Make $(make-version)" > $@ -$(ibidir)/ncurses: | $(ibidir)/make \ - $(tdir)/ncurses-$(ncurses-version).tar.gz +$(ibidir)/ncurses: $(ibidir)/make \ + $(tdir)/ncurses-$(ncurses-version).tar.gz # Delete the library that will be installed (so we can make sure # the build process completed afterwards and reset the links). @@ -562,14 +562,14 @@ $(ibidir)/ncurses: | $(ibidir)/make \ fi $(ibidir)/readline: $(ibidir)/ncurses \ - | $(tdir)/readline-$(readline-version).tar.gz + $(tdir)/readline-$(readline-version).tar.gz $(call gbuild, readline-$(readline-version), static, \ --with-curses --disable-install-examples, \ SHLIB_LIBS="-lncursesw" -j$(numthreads)) \ && echo "GNU Readline $(readline-version)" > $@ -$(ibidir)/patchelf: | $(ibidir)/make \ - $(tdir)/patchelf-$(patchelf-version).tar.gz +$(ibidir)/patchelf: $(ibidir)/make \ + $(tdir)/patchelf-$(patchelf-version).tar.gz $(call gbuild, patchelf-$(patchelf-version)) \ && echo "PatchELF $(patchelf-version)" > $@ @@ -609,9 +609,9 @@ needpatchelf = else needpatchelf = $(ibidir)/patchelf endif -$(ibidir)/bash: $(ibidir)/readline \ - | $(needpatchelf) \ - $(tdir)/bash-$(bash-version).tar.lz +$(ibidir)/bash: $(needpatchelf) \ + $(ibidir)/readline \ + $(tdir)/bash-$(bash-version).tar.lz # Delete the (possibly) existing Bash executable. rm -f $(ibdir)/bash @@ -676,8 +676,8 @@ perl-conflddlflags = else perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" endif -$(ibidir)/perl: | $(ibidir)/bash \ - $(tdir)/perl-$(perl-version).tar.gz +$(ibidir)/perl: $(ibidir)/bash \ + $(tdir)/perl-$(perl-version).tar.gz major_version=$$(echo $(perl-version) \ | sed -e's/\./ /g' \ | awk '{printf("%d", $$1)}'); \ @@ -686,7 +686,7 @@ $(ibidir)/perl: | $(ibidir)/bash \ | awk '{printf("%d.%d", $$1, $$2)}'); \ cd $(ddir) \ && rm -rf perl-$(perl-version) \ - && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ + && if ! tar xf $(word 1,$(filter $(tdir)/%,$^)); then \ echo; echo "Tar error"; exit 1; \ fi \ && cd perl-$(perl-version) \ @@ -747,12 +747,12 @@ $(ibidir)/perl: | $(ibidir)/bash \ # an error). # # Coreutils uses Perl to create man pages! -$(ibidir)/coreutils: $(ibidir)/openssl \ - | $(ibidir)/perl \ - $(tdir)/coreutils-$(coreutils-version).tar.xz +$(ibidir)/coreutils: $(ibidir)/perl \ + $(ibidir)/openssl \ + $(tdir)/coreutils-$(coreutils-version).tar.xz cd $(ddir) \ && rm -rf coreutils-$(coreutils-version) \ - && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ + && if ! tar xf $(word 1,$(filter $(tdir)/%,$^)); then \ echo; echo "Tar error"; exit 1; \ fi \ && cd coreutils-$(coreutils-version) \ @@ -794,10 +794,13 @@ $(ibidir)/coreutils: $(ibidir)/openssl \ #openssl-static = no-dso no-dynamic-engine no-shared #endif $(idir)/etc:; mkdir $@ -$(ibidir)/openssl: $(tdir)/cert.pem \ - | $(idir)/etc \ - $(ibidir)/make \ - $(tdir)/openssl-$(openssl-version).tar.gz +# Note: cert.pm has to be AFTER the tarball, otherwise the build script +# will try to unpack cert.pm and crash (it unpacks the first dependency +# under `tdir'). +$(ibidir)/openssl: $(ibidir)/make \ + $(tdir)/openssl-$(openssl-version).tar.gz \ + $(tdir)/cert.pem \ + | $(idir)/etc # According to OpenSSL's Wiki (link bellow), it can't automatically # detect Mac OS's structure. It will need some help. So we'll use # the `on_mac_os' Make variable that we defined in the configure @@ -853,8 +856,8 @@ $(ibidir)/openssl: $(tdir)/cert.pem \ # them. Note that if it does link with them, the configuration will crash # when the library is updated/changed by the host, and the whole purpose of # this project is avoid dependency on the host as much as possible. -$(ibidir)/curl: | $(ibidir)/coreutils \ - $(tdir)/curl-$(curl-version).tar.gz +$(ibidir)/curl: $(ibidir)/coreutils \ + $(tdir)/curl-$(curl-version).tar.gz $(call gbuild, curl-$(curl-version), , \ LIBS="-pthread" \ --with-zlib=$(ildir) \ @@ -892,8 +895,8 @@ $(ibidir)/curl: | $(ibidir)/coreutils \ # host system (especially a crash when these libraries are updated on the # host), they are disabled here. $(ibidir)/wget: $(ibidir)/libiconv \ - | $(ibidir)/coreutils \ - $(tdir)/wget-$(wget-version).tar.lz + $(ibidir)/coreutils \ + $(tdir)/wget-$(wget-version).tar.lz # We need to explicitly disable `libiconv', because of the # `pkg-config' and `libiconv' problem. libs="-pthread"; \ @@ -926,25 +929,25 @@ $(ibidir)/wget: $(ibidir)/libiconv \ # process of the higher-level programs and libraries. Note that during the # building of those higher-level programs (after this Makefile finishes), # there is no access to the system's PATH. -$(ibidir)/diffutils: | $(ibidir)/coreutils \ - $(tdir)/diffutils-$(diffutils-version).tar.xz +$(ibidir)/diffutils: $(ibidir)/coreutils \ + $(tdir)/diffutils-$(diffutils-version).tar.xz $(call gbuild, diffutils-$(diffutils-version), static,,V=1) \ && echo "GNU Diffutils $(diffutils-version)" > $@ -$(ibidir)/file: | $(ibidir)/coreutils \ - $(tdir)/file-$(file-version).tar.gz +$(ibidir)/file: $(ibidir)/coreutils \ + $(tdir)/file-$(file-version).tar.gz $(call gbuild, file-$(file-version), static,,V=1) \ && echo "File $(file-version)" > $@ -$(ibidir)/findutils: | $(ibidir)/coreutils \ - $(tdir)/findutils-$(findutils-version).tar.xz +$(ibidir)/findutils: $(ibidir)/coreutils \ + $(tdir)/findutils-$(findutils-version).tar.xz $(call gbuild, findutils-$(findutils-version), static,,V=1) \ && echo "GNU Findutils $(findutils-version)" > $@ $(ibidir)/gawk: $(ibidir)/gmp \ $(ibidir)/mpfr \ - | $(ibidir)/coreutils \ - $(tdir)/gawk-$(gawk-version).tar.lz + $(ibidir)/coreutils \ + $(tdir)/gawk-$(gawk-version).tar.lz # AWK doesn't include RPATH by default, so we'll have to manually # include it using the `patchelf' program (which was a dependency # of Bash). Just note that AWK produces two executables (for @@ -963,14 +966,14 @@ $(ibidir)/gawk: $(ibidir)/gmp \ fi \ && echo "GNU AWK $(gawk-version)" > $@ -$(ibidir)/libiconv: | $(ibidir)/pkg-config \ - $(tdir)/libiconv-$(libiconv-version).tar.gz +$(ibidir)/libiconv: $(ibidir)/pkg-config \ + $(tdir)/libiconv-$(libiconv-version).tar.gz $(call gbuild, libiconv-$(libiconv-version), static) \ && echo "GNU libiconv $(libiconv-version)" > $@ $(ibidir)/git: $(ibidir)/curl \ $(ibidir)/libiconv \ - | $(tdir)/git-$(git-version).tar.xz + $(tdir)/git-$(git-version).tar.xz if [ x$(on_mac_os) = xyes ]; then \ export LDFLAGS="$$LDFLAGS -lcharset"; \ fi; \ @@ -979,29 +982,29 @@ $(ibidir)/git: $(ibidir)/curl \ --with-iconv=$(idir), V=1) \ && echo "Git $(git-version)" > $@ -$(ibidir)/gmp: | $(ibidir)/m4 \ - $(ibidir)/coreutils \ - $(tdir)/gmp-$(gmp-version).tar.lz +$(ibidir)/gmp: $(ibidir)/m4 \ + $(ibidir)/coreutils \ + $(tdir)/gmp-$(gmp-version).tar.lz $(call gbuild, gmp-$(gmp-version), static, \ --enable-cxx --enable-fat, ,make check) \ && echo "GNU Multiple Precision Arithmetic Library $(gmp-version)" > $@ # On Mac OS, libtool does different things, so to avoid confusion, we'll # prefix GNU's libtool executables with `glibtool'. -$(ibidir)/glibtool: | $(ibidir)/m4 \ - $(tdir)/libtool-$(libtool-version).tar.xz +$(ibidir)/glibtool: $(ibidir)/m4 \ + $(tdir)/libtool-$(libtool-version).tar.xz $(call gbuild, libtool-$(libtool-version), static, \ --program-prefix=g, V=1) \ && ln -s $(ibdir)/glibtoolize $(ibdir)/libtoolize \ && echo "GNU Libtool $(libtool-version)" > $@ -$(ibidir)/grep: | $(ibidir)/coreutils \ - $(tdir)/grep-$(grep-version).tar.xz +$(ibidir)/grep: $(ibidir)/coreutils \ + $(tdir)/grep-$(grep-version).tar.xz $(call gbuild, grep-$(grep-version), static,,V=1) \ && echo "GNU Grep $(grep-version)" > $@ -$(ibidir)/libbsd: | $(ibidir)/coreutils \ - $(tdir)/libbsd-$(libbsd-version).tar.xz +$(ibidir)/libbsd: $(ibidir)/coreutils \ + $(tdir)/libbsd-$(libbsd-version).tar.xz $(call gbuild, libbsd-$(libbsd-version), static,,V=1) \ && echo "Libbsd $(libbsd-version)" > $@ @@ -1010,14 +1013,14 @@ $(ibidir)/libbsd: | $(ibidir)/coreutils \ # # [1] https://raw.githubusercontent.com/macports/macports-ports/edf0ee1e2cf/devel/m4/files/secure_snprintf.patch # [2] https://github.com/Homebrew/homebrew-core/blob/master/Formula/m4.rb -$(ibidir)/m4: | $(ibidir)/sed \ - $(ibidir)/texinfo \ - $(ibidir)/coreutils \ - $(tdir)/m4-$(m4-version).tar.gz +$(ibidir)/m4: $(ibidir)/sed \ + $(ibidir)/texinfo \ + $(ibidir)/coreutils \ + $(tdir)/m4-$(m4-version).tar.gz cd $(ddir); \ unpackdir=m4-$(m4-version); \ rm -rf $$unpackdir \ - && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ + && if ! tar xf $(word 1,$(filter $(tdir)/%,$^)); then \ echo; echo "Tar error"; exit 1; \ fi \ && cd $$unpackdir \ @@ -1058,11 +1061,11 @@ else needlibbsd = $(ibidir)/libbsd endif $(ibidir)/metastore: $(needlibbsd) \ - | $(ibidir)/sed \ - $(ibidir)/git \ - $(ibidir)/gawk \ - $(ibidir)/coreutils \ - $(tdir)/metastore-$(metastore-version).tar.gz + $(ibidir)/sed \ + $(ibidir)/git \ + $(ibidir)/gawk \ + $(ibidir)/coreutils \ + $(tdir)/metastore-$(metastore-version).tar.gz # Metastore doesn't have any `./configure' script. So we'll just # call `pwd' as a place-holder for the `./configure' command. @@ -1121,12 +1124,12 @@ $(ibidir)/metastore: $(needlibbsd) \ $(ibidir)/mpfr: $(ibidir)/gmp \ - | $(tdir)/mpfr-$(mpfr-version).tar.xz + $(tdir)/mpfr-$(mpfr-version).tar.xz $(call gbuild, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ -$(ibidir)/pkg-config: | $(ibidir)/coreutils \ - $(tdir)/pkg-config-$(pkgconfig-version).tar.gz +$(ibidir)/pkg-config: $(ibidir)/coreutils \ + $(tdir)/pkg-config-$(pkgconfig-version).tar.gz # An existing `libiconv' can cause a conflict with `pkg-config', # this is why `libiconv' depends on `pkg-config'. On a clean build, # `pkg-config' is built first. But when we don't have a clean build @@ -1147,13 +1150,13 @@ $(ibidir)/pkg-config: | $(ibidir)/coreutils \ --with-pc-path=$(ildir)/pkgconfig, V=1) \ && echo "pkg-config $(pkgconfig-version)" > $@ -$(ibidir)/sed: | $(ibidir)/coreutils \ - $(tdir)/sed-$(sed-version).tar.xz +$(ibidir)/sed: $(ibidir)/coreutils \ + $(tdir)/sed-$(sed-version).tar.xz $(call gbuild, sed-$(sed-version), static,,V=1) \ && echo "GNU Sed $(sed-version)" > $@ -$(ibidir)/texinfo: | $(ibidir)/perl \ - $(tdir)/texinfo-$(texinfo-version).tar.xz +$(ibidir)/texinfo: $(ibidir)/perl \ + $(tdir)/texinfo-$(texinfo-version).tar.xz $(call gbuild, texinfo-$(texinfo-version), static) \ && if [ "x$(needpatchelf)" != x ]; then \ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/info; \ @@ -1161,8 +1164,8 @@ $(ibidir)/texinfo: | $(ibidir)/perl \ fi \ && echo "GNU Texinfo $(texinfo-version)" > $@ -$(ibidir)/which: | $(ibidir)/coreutils \ - $(tdir)/which-$(which-version).tar.gz +$(ibidir)/which: $(ibidir)/coreutils \ + $(tdir)/which-$(which-version).tar.gz $(call gbuild, which-$(which-version), static) \ && echo "GNU Which $(which-version)" > $@ @@ -1179,12 +1182,12 @@ $(ibidir)/which: | $(ibidir)/coreutils \ # ------------------------- $(ibidir)/isl: $(ibidir)/gmp \ - | $(tdir)/isl-$(isl-version).tar.bz2 + $(tdir)/isl-$(isl-version).tar.bz2 $(call gbuild, isl-$(isl-version), static, , V=1) \ && echo "GNU Integer Set Library $(isl-version)" > $@ $(ibidir)/mpc: $(ibidir)/mpfr \ - | $(tdir)/mpc-$(mpc-version).tar.gz + $(tdir)/mpc-$(mpc-version).tar.gz $(call gbuild, mpc-$(mpc-version), static, , , make check) \ && echo "GNU Multiple Precision Complex library" > $@ @@ -1218,19 +1221,19 @@ endif # these necessary files in our local build directory. IMPORTANT NOTE: # later, when we build the GNU C Library in the project, we should remove # this step. -$(ibidir)/binutils: | $(ibidir)/sed \ - $(ibidir)/wget \ - $(ibidir)/grep \ - $(ibidir)/file \ - $(ibidir)/gawk \ - $(ibidir)/which \ - $(ibidir)/glibtool \ - $(binutils-tarball) \ - $(ibidir)/metastore \ - $(ibidir)/findutils \ - $(ibidir)/diffutils \ - $(ibidir)/coreutils \ - $(gcc-prerequisites) +$(ibidir)/binutils: $(ibidir)/sed \ + $(ibidir)/wget \ + $(ibidir)/grep \ + $(ibidir)/file \ + $(ibidir)/gawk \ + $(ibidir)/which \ + $(ibidir)/glibtool \ + $(binutils-tarball) \ + $(ibidir)/metastore \ + $(ibidir)/findutils \ + $(ibidir)/diffutils \ + $(ibidir)/coreutils \ + $(gcc-prerequisites) if [ x$(on_mac_os) = xyes ]; then \ $(call makelink,as); \ @@ -1271,8 +1274,8 @@ gcc-tarball = else gcc-tarball = $(tdir)/gcc-$(gcc-version).tar.xz endif -$(ibidir)/gcc: | $(ibidir)/binutils \ - $(gcc-tarball) +$(ibidir)/gcc: $(gcc-tarball) \ + $(ibidir)/binutils # GCC builds is own libraries in '$(idir)/lib64'. But all other # libraries are in '$(idir)/lib'. Since this project is only for a @@ -1305,7 +1308,7 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ fi; \ cd $$odir; \ rm -rf gcc-$(gcc-version); \ - tar xf $(word 1,$(filter $(tdir)/%,$|)); \ + tar xf $(word 1,$(filter $(tdir)/%,$^)); \ if [ $$odir != $(ddir) ]; then \ ln -s $$odir/gcc-$(gcc-version) $(ddir)/gcc-$(gcc-version); \ fi; \ -- cgit v1.2.1 From b1e1522a5a5b6d0800ea207f2d93a4f36bffa68d Mon Sep 17 00:00:00 2001 From: Raul Infante-Sainz Date: Fri, 1 May 2020 12:09:18 +0100 Subject: GNU Gettext built as a dependency of Bash Until now Maneage used the host's GNU Gettext if it was present. Gettext is a relatively low-level software that enables programs to print messages in different languages based on the host environment. Even though it has not direct effect on the running of the software for Maneage and the lanugage environment in Maneage is pre-determined, it is necessary to have it because if the basic programs see it in the host they will link with it and will have problems if/when the host's Gettext is updated. With this commit (which is actually a squashed rebase of 9 commits by Raul and Mohammad), Gettext and its two extra dependencies (libxml2 and libunistring) are now installed within Maneage as a basic software and built before GNU Bash. As a result, all programs built afterwards will successfully link with our own internal version of Gettext and libraries. To get this working, some of the basic software dependencies had to updated and re-ordered and it has been tested in both GNU/Linux and macoS. Some other minor issues that are fixed with this commit - Until this commit, when TeX was not installed, the warning message saying how to run the configure step in order to re-configure the project was not showing the option `-e'. However, the use of this option is more convenient than entering the top-build directory and etc every time. So with this commit, the warning message has been changed in order use the option `-e' in the re-configure of the project. - Until now, on macOS systems, Bash was not linking with our internally built `libncurses'. With this commit, this has been fixed by setting `--withcurses=yes' for Bash's configure script. --- reproduce/software/make/basic.mk | 98 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 40 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 1709082..3c03fdc 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -124,6 +124,7 @@ tarballs = $(foreach t, bash-$(bash-version).tar.lz \ findutils-$(findutils-version).tar.xz \ gawk-$(gawk-version).tar.lz \ gcc-$(gcc-version).tar.xz \ + gettext-$(gettext-version).tar.xz \ git-$(git-version).tar.xz \ gmp-$(gmp-version).tar.lz \ grep-$(grep-version).tar.xz \ @@ -132,6 +133,8 @@ tarballs = $(foreach t, bash-$(bash-version).tar.lz \ libbsd-$(libbsd-version).tar.xz \ libiconv-$(libiconv-version).tar.gz \ libtool-$(libtool-version).tar.xz \ + libunistring-$(libunistring-version).tar.xz \ + libxml2-$(libxml2-version).tar.gz \ lzip-$(lzip-version).tar.gz \ m4-$(m4-version).tar.gz \ make-$(make-version).tar.gz \ @@ -176,6 +179,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) elif [ $$n = findutils ]; then c=$(findutils-checksum); w=http://ftp.gnu.org/gnu/findutils; \ elif [ $$n = gawk ]; then c=$(gawk-checksum); w=http://ftp.gnu.org/gnu/gawk; \ elif [ $$n = gcc ]; then c=$(gcc-checksum); w=http://ftp.gnu.org/gnu/gcc/gcc-$(gcc-version); \ + elif [ $$n = gettext ]; then c=$(gettext-checksum); w=https://ftp.gnu.org/gnu/gettext; \ elif [ $$n = git ]; then c=$(git-checksum); w=http://mirrors.edge.kernel.org/pub/software/scm/git; \ elif [ $$n = gmp ]; then c=$(gmp-checksum); w=https://gmplib.org/download/gmp; \ elif [ $$n = grep ]; then c=$(grep-checksum); w=http://ftp.gnu.org/gnu/grep; \ @@ -184,6 +188,8 @@ $(tarballs): $(tdir)/%: | $(lockdir) elif [ $$n = libbsd ]; then c=$(libbsd-checksum); w=http://libbsd.freedesktop.org/releases; \ elif [ $$n = libiconv ]; then c=$(libiconv-checksum); w=https://ftp.gnu.org/pub/gnu/libiconv; \ elif [ $$n = libtool ]; then c=$(libtool-checksum); w=http://ftp.gnu.org/gnu/libtool; \ + elif [ $$n = libunistring ]; then c=$(libunistring-checksum); w=http://ftp.gnu.org/gnu/libunistring; \ + elif [ $$n = libxml2 ]; then c=$(libxml2-checksum); w=ftp://xmlsoft.org/libxml2; \ elif [ $$n = lzip ]; then c=$(lzip-checksum); w=http://download.savannah.gnu.org/releases/lzip; \ elif [ $$n = m4 ]; then \ mergenames=0; \ @@ -312,9 +318,6 @@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) # executable name `glibtool'. $(call makelink,libtool) - # GNU Gettext (translate messages) - $(call makelink,msgfmt) - # Necessary libraries: # Libdl (for dynamic loading libraries at runtime) # POSIX Threads library for multi-threaded programs. @@ -610,24 +613,14 @@ else needpatchelf = $(ibidir)/patchelf endif $(ibidir)/bash: $(needpatchelf) \ + $(ibidir)/gettext \ $(ibidir)/readline \ $(tdir)/bash-$(bash-version).tar.lz - # Delete the (possibly) existing Bash executable. + # Delete the (possibly) existing Bash executable in the project, + # let it use the default shell of the host. rm -f $(ibdir)/bash - # Build Bash. Note that we aren't building Bash with - # `--with-installed-readline'. This is because (as described above) - # Bash needs the `LD_LIBRARY_PATH' set properly before it is - # run. Within a recipe, things are fine (we do set - # `LD_LIBRARY_PATH'). However, Make will also call the shell - # outside of the recipe (for example in the `foreach' Make - # function!). In such cases, our new `LD_LIBRARY_PATH' is not set. - # This will cause a crash in the shell and thus the Makefile, - # complaining that it can't find `libreadline'. Therefore, even - # though we build readline below, we won't link Bash with an - # external readline. - # # Bash has many `--enable' features which are already enabled by # default. As described in the manual, they are mainly useful when # you disable them all with `--enable-minimal-config' and enable a @@ -635,9 +628,14 @@ $(ibidir)/bash: $(needpatchelf) \ if [ "x$(static_build)" = xyes ]; then stopt="--enable-static-link";\ else stopt=""; \ fi; \ - $(call gbuild, bash-$(bash-version),, \ - --with-installed-readline=$(ildir) $$stopt, \ - -j$(numthreads)) + export CFLAGS="$$CFLAGS \ + -DDEFAULT_PATH_VALUE='\"$(ibdir)\"' \ + -DSTANDARD_UTILS_PATH='\"$(ibdir)\"' \ + -DSYS_BASHRC='\"$(BASH_ENV)\"' "; \ + $(call gbuild, bash-$(bash-version),, $$stopt \ + --with-installed-readline=$(ildir) \ + --with-curses=yes, \ + -j$(numthreads)) # Atleast on GNU/Linux systems, Bash doesn't include RPATH by # default. So, we have to manually include it, currently we are @@ -676,7 +674,7 @@ perl-conflddlflags = else perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" endif -$(ibidir)/perl: $(ibidir)/bash \ +$(ibidir)/perl: $(ibidir)/make \ $(tdir)/perl-$(perl-version).tar.gz major_version=$$(echo $(perl-version) \ | sed -e's/\./ /g' \ @@ -690,11 +688,6 @@ $(ibidir)/perl: $(ibidir)/bash \ echo; echo "Tar error"; exit 1; \ fi \ && cd perl-$(perl-version) \ - && sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ - -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ - Configure > Configure-tmp \ - && mv -f Configure-tmp Configure \ - && chmod +x Configure \ && ./Configure -des \ -Dusethreads \ -Duseshrplib \ @@ -715,8 +708,8 @@ $(ibidir)/perl: $(ibidir)/bash \ -Dcccdlflags='-fPIC' \ $(perl-conflddlflags) \ -Dldflags="$$LDFLAGS" \ - && make SHELL=$(ibdir)/bash -j$(numthreads) \ - && make SHELL=$(ibdir)/bash install \ + && make -j$(numthreads) \ + && make install \ && cd .. \ && rm -rf perl-$(perl-version) \ && cd $$topdir \ @@ -747,7 +740,8 @@ $(ibidir)/perl: $(ibidir)/bash \ # an error). # # Coreutils uses Perl to create man pages! -$(ibidir)/coreutils: $(ibidir)/perl \ +$(ibidir)/coreutils: $(ibidir)/bash \ + $(ibidir)/perl \ $(ibidir)/openssl \ $(tdir)/coreutils-$(coreutils-version).tar.xz cd $(ddir) \ @@ -971,7 +965,34 @@ $(ibidir)/libiconv: $(ibidir)/pkg-config \ $(call gbuild, libiconv-$(libiconv-version), static) \ && echo "GNU libiconv $(libiconv-version)" > $@ +$(ibidir)/libunistring: $(ibidir)/make \ + $(tdir)/libunistring-$(libunistring-version).tar.xz + $(call gbuild, libunistring-$(libunistring-version), static,, \ + -j$(numthreads)) \ + && echo "GNU libunistring $(libunistring-version)" > $@ + +$(ibidir)/libxml2: $(ibidir)/make \ + $(tdir)/libxml2-$(libxml2-version).tar.gz + # The libxml2 tarball also contains Python bindings which are built + # and installed to a system directory by default. If you don't need + # the Python bindings, the easiest solution is to compile without + # Python support: `./configure --without-python'. If you really need + # the Python bindings, use `--with-python-install-dir=DIR' instead. + $(call gbuild, libxml2-$(libxml2-version), static, \ + --without-python) \ + && echo "Libxml2 $(libxml2-version)" > $@ + +$(ibidir)/gettext: $(ibidir)/m4 \ + $(ibidir)/libxml2 \ + $(ibidir)/ncurses \ + $(ibidir)/libiconv \ + $(ibidir)/libunistring \ + $(tdir)/gettext-$(gettext-version).tar.xz + $(call gbuild, gettext-$(gettext-version), static, V=1) \ + && echo "GNU gettext $(gettext-version)" > $@ + $(ibidir)/git: $(ibidir)/curl \ + $(ibidir)/gettext \ $(ibidir)/libiconv \ $(tdir)/git-$(git-version).tar.xz if [ x$(on_mac_os) = xyes ]; then \ @@ -1013,9 +1034,7 @@ $(ibidir)/libbsd: $(ibidir)/coreutils \ # # [1] https://raw.githubusercontent.com/macports/macports-ports/edf0ee1e2cf/devel/m4/files/secure_snprintf.patch # [2] https://github.com/Homebrew/homebrew-core/blob/master/Formula/m4.rb -$(ibidir)/m4: $(ibidir)/sed \ - $(ibidir)/texinfo \ - $(ibidir)/coreutils \ +$(ibidir)/m4: $(ibidir)/texinfo \ $(tdir)/m4-$(m4-version).tar.gz cd $(ddir); \ unpackdir=m4-$(m4-version); \ @@ -1025,15 +1044,14 @@ $(ibidir)/m4: $(ibidir)/sed \ fi \ && cd $$unpackdir \ && if [ x$(on_mac_os) = xyes ]; then \ - sed -i -e's|if !(((__GLIBC__ > 2|if !defined(__APPLE__) \&\& !(((__GLIBC__ > 2|' lib/vasnprintf.c; \ + sed 's|if !(((__GLIBC__ > 2|if !defined(__APPLE__) \&\& !(((__GLIBC__ > 2|' \ + lib/vasnprintf.c > lib/vasnprintf_edited.c; \ + mv lib/vasnprintf_edited.c lib/vasnprintf.c; \ fi \ - && sed -i -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ - -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ - configure \ - && ./configure --prefix=$(idir) SHELL=$(ibdir)/bash \ - LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - && make SHELL=$(ibdir)/bash V=1 -j$(numthreads) \ - && make SHELL=$(ibdir)/bash V=1 install \ + && ./configure --prefix=$(idir) LDFLAGS="$(LDFLAGS)" \ + CPPFLAGS="$(CPPFLAGS)" \ + && make V=1 -j$(numthreads) \ + && make V=1 install \ && cd .. \ && rm -rf $$unpackdir \ && echo "GNU M4 $(m4-version)" > $@ @@ -1128,7 +1146,7 @@ $(ibidir)/mpfr: $(ibidir)/gmp \ $(call gbuild, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ -$(ibidir)/pkg-config: $(ibidir)/coreutils \ +$(ibidir)/pkg-config: $(ibidir)/make \ $(tdir)/pkg-config-$(pkgconfig-version).tar.gz # An existing `libiconv' can cause a conflict with `pkg-config', # this is why `libiconv' depends on `pkg-config'. On a clean build, -- cgit v1.2.1 From c0a512e0631a024f18bec847125a9a03e6aa23a1 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 22 May 2020 23:35:21 +0100 Subject: Corrected copyright notices to fit GPL suggested format In time, some of the copyright license description had been mistakenly shortened to two paragraphs instead of the original three that is recommended in the GPL. With this commit, they are corrected to be exactly in the same three paragraph format suggested by GPL. The following files also didn't have a copyright notice, so one was added for them: reproduce/software/make/README.md reproduce/software/bibtex/healpix.tex reproduce/analysis/config/delete-me-num.conf reproduce/analysis/config/verify-outputs.conf --- reproduce/software/make/basic.mk | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 3c03fdc..9119930 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -18,15 +18,18 @@ # Copyright (C) 2018-2020 Mohammad Akhlaghi # Copyright (C) 2019-2020 Raul Infante-Sainz # -# This Makefile is part of Maneage. Maneage is free software: you can -# redistribute it and/or modify it under the terms of the GNU General -# Public License as published by the Free Software Foundation, either -# version 3 of the License, or (at your option) any later version. +# This Makefile is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# Maneage is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. See . +# This Makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this Makefile. If not, see . # Top level environment -- cgit v1.2.1 From 4493acc390a92ba53c7d76766024e7d64c7b31ce Mon Sep 17 00:00:00 2001 From: Boud Roukema Date: Fri, 15 May 2020 04:42:58 +0200 Subject: New software: Valgrind and Patch With this commit, Maneage now includes instructions to build the memory tracing tool Valgrind and the program 'patch' (to apply corrections/patches in text files and in particular the sources of programs). For this version of Valgrind, some patches were necessary for an interface with OpenMPI 2.x (which is the case now). Also note that this version of Valgrind's checks can fail with GCC 10.1.x (when using '--host-cc'), and the failures aren't due to internal problems but due to how the tests are designed (https://bugs.gentoo.org/707598). So currently if any of Valgrind's checks fail, Maneage still assumes that Valgrind was built and installed successfully. While testing on macOS, we noticed that it needs the macOS-specific 'mig' program which we can't build in Maneage. DESCRIPTION: The mig command invokes the Mach Interface Generator to generate Remote Procedure Call (RPC) code for client-server style Mach IPC from specification files. So a symbolic link to the system's 'mig' is now added to the project's programs on macOS systems. This commit's build of Patch and Valgrind has been tested on two GNU/Linux distributions (Debian and ArchLinux) as well as macOS. Work on this commit started by Boud Roukema, but also involved tests and corrections by Mohammad Akhlaghi and Raul Infante-Sainz. --- reproduce/software/make/basic.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 9119930..8b216fe 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -311,6 +311,7 @@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) $(call makelink,clang++) # Mac OS specific + $(call makelink,mig) $(call makelink,sysctl) $(call makelink,sw_vers) $(call makelink,dsymutil) -- cgit v1.2.1 From 0043ba8d9032048d62b36f42f143e88ad330af27 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 25 May 2020 21:00:10 +0100 Subject: Unified reference to GNU/Linux and free software One of the main reasons to building Maneage is to properly acknowledge/attribute the authors of software in research. So we have adopted a standard of never referring to the GNU-based operating systems running the Linux kernel simply as "Linux", we avoid terms like "Open Sourse" and use Free Software instead (in the same spirit). With this commit, a few instances of the cases above have been corrected, they had slipped through our fingers when we initially imported them into the project. In the special case of the "Journal for Open Source Software", we simply replaced it with its abbreviation (JOSS). This was done because in effect we were generally using journal name abbreviations in almost all the citations already. To avoid any inconsistancies, the names of the three other journals that weren't abbreviated are also abbreviated. --- reproduce/software/make/basic.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 8b216fe..e0da312 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -374,7 +374,7 @@ $(ibidir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz # Bzip2 doesn't have a `./configure' script, and its Makefile # doesn't build a shared library. So we can't use the `gbuild' # function here and we need to take some extra steps (inspired - # from the "Linux from Scratch" guide for Bzip2): + # from the GNU/Linux from Scratch (LFS) guide for Bzip2): # 1) The `sed' call is for relative installed symbolic links. # 2) The special Makefile-libbz2_so builds shared libraries. # @@ -514,7 +514,7 @@ $(ibidir)/ncurses: $(ibidir)/make \ # explicitly mentioning its name correctly (as a value to `-l' at # link time in their configure scripts). # - # This part is taken from the Arch Linux build script[1], then + # This part is taken from the Arch GNU/Linux build script[1], then # extended to Mac thanks to Homebrew's script [2]. # # [1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/ncurses -- cgit v1.2.1 From 3d8aa5953c4e0b79278ab2e27ec4e1051310d04f Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 1 Jun 2020 03:05:37 +0100 Subject: Core software build before using Make to build other software Until now, Maneage would only build Flock before building everything else using Make (calling 'basic.mk') in parallel. Flock was necessary to avoid parallel downloads during the building of software (which could cause network problems). But after recently trying Maneage on FreeBSD (which is not yet complete, see bug #58465), we noticed that the BSD implemenation of Make couldn't parse 'basic.mk' (in particular, complaining with the 'ifeq' parts) and its shell also had some peculiarities. It was thus decided to also install our own minimalist shell, Make and compressor program before calling 'basic.mk'. In this way, 'basic.mk' can now assume the same GNU Make features that high-level.mk and python.mk assume. The pre-make building of software is now organized in 'reproduce/software/shell/pre-make-build.sh'. Another nice feature of this commit is for macOS users: until now the default macOS Make had problems for parallel building of software, so 'basic.mk' was built in one thread. But now that we can build the core tools with GNU Make on macOS too, it uses all threads. Furthermore, since we now run 'basic.mk' with GNU Make, we can use '.ONESHELL' and don't have to finish every line of a long rule with a backslash to keep variables and such. Generally, the pre-make software are now organized like this: first we build Lzip before anything else: it is downloaded as a simple '.tar' file that is not compressed (only ~400kb). Once Lzip is built, the pre-make phase continues with building GNU Make, Dash (a minimalist shell) and Flock. All of their tarballs are in '.tar.lz'. Maneage then enters 'basic.mk' and the first program it builds is GNU Gzip (itself packaged as '.tar.lz'). Once Gzip is built, we build all the other compression software (all downloaded as '.tar.gz'). Afterwards, any compression standard for other software is fine because we have it. In the process, a bug related to using backup servers was found in 'reproduce/analysis/bash/download-multi-try' for calling outside of 'basic.mk' and removed Bash-specific features. As a result of that bug-fix, because we now have multiple servers for software tarballs, the backup servers now have their own configuration file in 'reproduce/software/config/servers-backup.conf'. This makes it much easier to maintain the backup server list across the multiple places that we need it. Some other minor fixes: - In building Bzip2, we need to specify 'CC' so it doesn't use 'gcc'. - In building Zip, the 'generic_gcc' Make option caused a crash on FreeBSD (which doesn't have GCC). - We are now using 'uname -s' to specify if we are on a Linux kernel or not, if not, we are still using the old 'on_mac_os' variable. - While I was trying to build on FreeBSD, I noticed some further corrections that could help. For example the 'makelink' Make-function now takes a third argument which can be a different name compared to the actual program (used for examle to make a link to '/usr/bin/cc' from 'gcc'. - Until now we didn't know if the host's Make implementation supports placing a '@' at the start of the recipe (to avoid printing the actual commands to standard output). Especially in the tarball download phase, there are many lines that are printed for each download which was really annoying. We already used '@' in 'high-level.mk' and 'python.mk' before, but now that we also know that 'basic.mk' is called with our custom GNU Make, we can use it at the start for a cleaner stdout. - Until now, WCSLIB assumed a Fortran compiler, but when the user is on a system where we can't install GCC (or has activated the '--host-cc' option), it may not be present and the project shouldn't break because of this. So with this commit, when a Fortran compiler isn't present, WCSLIB will be built with the '--disable-fortran' configuration option. This commit (task #15667) was completed with help/checks by Raul Infante-Sainz and Boud Roukema. --- reproduce/software/make/basic.mk | 466 ++++++++++++++++++++------------------- 1 file changed, 238 insertions(+), 228 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index e0da312..b4745e2 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -52,6 +52,7 @@ syspath := $(PATH) # As we build more programs, we want to use this project's built programs # and libraries, not the host's. +.ONESHELL: export CCACHE_DISABLE := 1 export PATH := $(ibdir):$(PATH) export PKG_CONFIG_PATH := $(ildir)/pkgconfig @@ -59,6 +60,17 @@ export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS) +# Note that we build GNU Bash here in 'basic.mk'. So we can't assume Bash +# in this Makefile and use the DASH shell that was before calling this +# Makefile: http://gondor.apana.org.au/~herbert/dash. Dash is a minimalist +# POSIX shell, so it doesn't have startup options like '--noprofile +# --norc'. But from its manual, to load startup files, Dash actually +# requires that it be called with a '-' before it (for example '-dash'), so +# it shouldn't be loading any startup files if it was interpretted +# properly. +.SHELLFLAGS := -e -c +export SHELL := $(ibdir)/dash + # This is the "basic" tools where we are relying on the host operating # system, but are slowly populating our basic software envirnoment. To run # (system or template) programs, `LD_LIBRARY_PATH' is necessary, so here, @@ -85,7 +97,10 @@ all: $(foreach p, $(top-level-programs), $(ibidir)/$(p)) # Servers to use as backup, later this should go in a file that is not # under version control (the actual server that the tarbal comes from is # irrelevant). -backupservers = http://akhlaghi.org/maneage-software +backupservers := $(shell awk '!/^#/{printf "%s ", $$1}' \ + reproduce/software/config/servers-backup.conf) + + @@ -131,16 +146,14 @@ tarballs = $(foreach t, bash-$(bash-version).tar.lz \ git-$(git-version).tar.xz \ gmp-$(gmp-version).tar.lz \ grep-$(grep-version).tar.xz \ - gzip-$(gzip-version).tar.gz \ + gzip-$(gzip-version).tar.lz \ isl-$(isl-version).tar.bz2 \ libbsd-$(libbsd-version).tar.xz \ libiconv-$(libiconv-version).tar.gz \ libtool-$(libtool-version).tar.xz \ libunistring-$(libunistring-version).tar.xz \ libxml2-$(libxml2-version).tar.gz \ - lzip-$(lzip-version).tar.gz \ m4-$(m4-version).tar.gz \ - make-$(make-version).tar.gz \ metastore-$(metastore-version).tar.gz \ mpfr-$(mpfr-version).tar.xz \ mpc-$(mpc-version).tar.gz \ @@ -167,105 +180,108 @@ $(tarballs): $(tdir)/%: | $(lockdir) # the first character of the version to be a digit: packages such # as `foo' and `foo-3' will not be distinguished, but `foo' and # `foo2' will be distinguished. - n=$$(echo $* | sed -e's/-[0-9]/ /' -e's/\./ /g' \ - | awk '{print $$1}' ); \ - \ + @n=$$(echo $* | sed -e's/-[0-9]/ /' -e's/\./ /g' \ + | awk '{print $$1}' ) + mergenames=1; \ - if [ $$n = bash ]; then c=$(bash-checksum); w=http://akhlaghi.org/maneage-software; \ - elif [ $$n = binutils ]; then c=$(binutils-checksum); w=http://ftp.gnu.org/gnu/binutils; \ - elif [ $$n = bzip2 ]; then c=$(bzip2-checksum); w=http://akhlaghi.org/maneage-software; \ - elif [ $$n = cert ]; then c=$(cert-checksum); w=http://akhlaghi.org/maneage-software; \ - elif [ $$n = coreutils ]; then c=$(coreutils-checksum); w=http://ftp.gnu.org/gnu/coreutils;\ - elif [ $$n = curl ]; then c=$(curl-checksum); w=https://curl.haxx.se/download; \ - elif [ $$n = diffutils ]; then c=$(diffutils-checksum); w=http://ftp.gnu.org/gnu/diffutils;\ - elif [ $$n = file ]; then c=$(file-checksum); w=ftp://ftp.astron.com/pub/file; \ - elif [ $$n = findutils ]; then c=$(findutils-checksum); w=http://ftp.gnu.org/gnu/findutils; \ - elif [ $$n = gawk ]; then c=$(gawk-checksum); w=http://ftp.gnu.org/gnu/gawk; \ - elif [ $$n = gcc ]; then c=$(gcc-checksum); w=http://ftp.gnu.org/gnu/gcc/gcc-$(gcc-version); \ - elif [ $$n = gettext ]; then c=$(gettext-checksum); w=https://ftp.gnu.org/gnu/gettext; \ - elif [ $$n = git ]; then c=$(git-checksum); w=http://mirrors.edge.kernel.org/pub/software/scm/git; \ - elif [ $$n = gmp ]; then c=$(gmp-checksum); w=https://gmplib.org/download/gmp; \ - elif [ $$n = grep ]; then c=$(grep-checksum); w=http://ftp.gnu.org/gnu/grep; \ - elif [ $$n = gzip ]; then c=$(gzip-checksum); w=http://ftp.gnu.org/gnu/gzip; \ - elif [ $$n = isl ]; then c=$(isl-checksum); w=ftp://gcc.gnu.org/pub/gcc/infrastructure; \ - elif [ $$n = libbsd ]; then c=$(libbsd-checksum); w=http://libbsd.freedesktop.org/releases; \ - elif [ $$n = libiconv ]; then c=$(libiconv-checksum); w=https://ftp.gnu.org/pub/gnu/libiconv; \ - elif [ $$n = libtool ]; then c=$(libtool-checksum); w=http://ftp.gnu.org/gnu/libtool; \ - elif [ $$n = libunistring ]; then c=$(libunistring-checksum); w=http://ftp.gnu.org/gnu/libunistring; \ - elif [ $$n = libxml2 ]; then c=$(libxml2-checksum); w=ftp://xmlsoft.org/libxml2; \ - elif [ $$n = lzip ]; then c=$(lzip-checksum); w=http://download.savannah.gnu.org/releases/lzip; \ - elif [ $$n = m4 ]; then \ - mergenames=0; \ - c=$(m4-checksum); \ - w=http://akhlaghi.org/maneage-software/m4-1.4.18-patched.tar.gz; \ - elif [ $$n = make ]; then c=$(make-checksum); w=https://ftp.gnu.org/gnu/make; \ - elif [ $$n = metastore ]; then c=$(metastore-checksum); w=http://akhlaghi.org/maneage-software; \ - elif [ $$n = mpc ]; then c=$(mpc-checksum); w=http://ftp.gnu.org/gnu/mpc; \ - elif [ $$n = mpfr ]; then c=$(mpfr-checksum); w=http://www.mpfr.org/mpfr-current;\ - elif [ $$n = ncurses ]; then c=$(ncurses-checksum); w=http://ftp.gnu.org/gnu/ncurses; \ - elif [ $$n = openssl ]; then c=$(openssl-checksum); w=http://www.openssl.org/source; \ - elif [ $$n = patchelf ]; then c=$(patchelf-checksum); w=http://nixos.org/releases/patchelf/patchelf-$(patchelf-version); \ - elif [ $$n = perl ]; then \ - c=$(perl-checksum); \ - v=$$(echo $(perl-version) | sed -e's/\./ /g' | awk '{printf("%d.0", $$1)}'); \ - w=https://www.cpan.org/src/$$v; \ - elif [ $$n = pkg-config ]; then c=$(pkgconfig-checksum); w=http://pkg-config.freedesktop.org/releases; \ - elif [ $$n = readline ]; then c=$(readline-checksum); w=http://ftp.gnu.org/gnu/readline; \ - elif [ $$n = sed ]; then c=$(sed-checksum); w=http://ftp.gnu.org/gnu/sed; \ - elif [ $$n = tar ]; then c=$(tar-checksum); w=http://ftp.gnu.org/gnu/tar; \ - elif [ $$n = texinfo ]; then c=$(texinfo-checksum); w=http://ftp.gnu.org/gnu/texinfo; \ - elif [ $$n = unzip ]; then \ - c=$(unzip-checksum); \ - mergenames=0; v=$$(echo $(unzip-version) | sed -e's/\.//'); \ - w=ftp://ftp.info-zip.org/pub/infozip/src/unzip$$v.tgz; \ - elif [ $$n = wget ]; then c=$(wget-checksum); w=http://ftp.gnu.org/gnu/wget; \ - elif [ $$n = which ]; then c=$(which-checksum); w=http://ftp.gnu.org/gnu/which; \ - elif [ $$n = xz ]; then c=$(xz-checksum); w=http://tukaani.org/xz; \ - elif [ $$n = zip ]; then \ - c=$(zip-checksum); \ - mergenames=0; v=$$(echo $(zip-version) | sed -e's/\.//'); \ - w=ftp://ftp.info-zip.org/pub/infozip/src/zip$$v.tgz; \ - elif [ $$n = zlib ]; then c=$(zlib-checksum); w=http://www.zlib.net; \ - else \ - echo; echo; echo; \ - echo "'$$n' not recognized as a software tarball name to download."; \ - echo; echo; echo; \ - exit 1; \ - fi; \ - \ - \ - if [ -f $(DEPENDENCIES-DIR)/$* ]; then \ - cp $(DEPENDENCIES-DIR)/$* "$@.unchecked"; \ - else \ - if [ $$mergenames = 1 ]; then tarballurl=$$w/"$*"; \ - else tarballurl=$$w; \ - fi; \ - \ - echo "Downloading $$tarballurl"; \ - if [ -f $(ibdir)/wget ]; then \ - downloader="wget --no-use-server-timestamps -O"; \ - else \ - downloader="$(DOWNLOADER)"; \ - fi; \ - \ - touch $(lockdir)/download; \ + if [ $$n = bash ]; then c=$(bash-checksum); w=http://akhlaghi.org/maneage-software + elif [ $$n = binutils ]; then c=$(binutils-checksum); w=http://ftp.gnu.org/gnu/binutils + elif [ $$n = bzip2 ]; then c=$(bzip2-checksum); w=http://akhlaghi.org/maneage-software + elif [ $$n = cert ]; then c=$(cert-checksum); w=http://akhlaghi.org/maneage-software + elif [ $$n = coreutils ]; then c=$(coreutils-checksum); w=http://ftp.gnu.org/gnu/coreutils + elif [ $$n = curl ]; then c=$(curl-checksum); w=https://curl.haxx.se/download + elif [ $$n = diffutils ]; then c=$(diffutils-checksum); w=http://ftp.gnu.org/gnu/diffutils + elif [ $$n = file ]; then c=$(file-checksum); w=ftp://ftp.astron.com/pub/file + elif [ $$n = findutils ]; then c=$(findutils-checksum); w=http://ftp.gnu.org/gnu/findutils + elif [ $$n = gawk ]; then c=$(gawk-checksum); w=http://ftp.gnu.org/gnu/gawk + elif [ $$n = gcc ]; then c=$(gcc-checksum); w=http://ftp.gnu.org/gnu/gcc/gcc-$(gcc-version) + elif [ $$n = gettext ]; then c=$(gettext-checksum); w=https://ftp.gnu.org/gnu/gettext + elif [ $$n = git ]; then c=$(git-checksum); w=http://mirrors.edge.kernel.org/pub/software/scm/git + elif [ $$n = gmp ]; then c=$(gmp-checksum); w=https://gmplib.org/download/gmp + elif [ $$n = grep ]; then c=$(grep-checksum); w=http://ftp.gnu.org/gnu/grep + elif [ $$n = gzip ]; then c=$(gzip-checksum); w=http://akhlaghi.org/src + elif [ $$n = isl ]; then c=$(isl-checksum); w=ftp://gcc.gnu.org/pub/gcc/infrastructure + elif [ $$n = libbsd ]; then c=$(libbsd-checksum); w=http://libbsd.freedesktop.org/releases + elif [ $$n = libiconv ]; then c=$(libiconv-checksum); w=https://ftp.gnu.org/pub/gnu/libiconv + elif [ $$n = libtool ]; then c=$(libtool-checksum); w=http://ftp.gnu.org/gnu/libtool + elif [ $$n = libunistring ]; then c=$(libunistring-checksum); w=http://ftp.gnu.org/gnu/libunistring + elif [ $$n = libxml2 ]; then c=$(libxml2-checksum); w=ftp://xmlsoft.org/libxml2 + elif [ $$n = m4 ]; then + mergenames=0 + c=$(m4-checksum) + w=http://akhlaghi.org/maneage-software/m4-1.4.18-patched.tar.gz + elif [ $$n = metastore ]; then c=$(metastore-checksum); w=http://akhlaghi.org/maneage-software + elif [ $$n = mpc ]; then c=$(mpc-checksum); w=http://ftp.gnu.org/gnu/mpc + elif [ $$n = mpfr ]; then c=$(mpfr-checksum); w=http://www.mpfr.org/mpfr-current + elif [ $$n = ncurses ]; then c=$(ncurses-checksum); w=http://ftp.gnu.org/gnu/ncurses + elif [ $$n = openssl ]; then c=$(openssl-checksum); w=http://www.openssl.org/source + elif [ $$n = patchelf ]; then c=$(patchelf-checksum); w=http://nixos.org/releases/patchelf/patchelf-$(patchelf-version) + elif [ $$n = perl ]; then + c=$(perl-checksum) + v=$$(echo $(perl-version) | sed -e's/\./ /g' | awk '{printf("%d.0", $$1)}') + w=https://www.cpan.org/src/$$v + elif [ $$n = pkg-config ]; then c=$(pkgconfig-checksum); w=http://pkg-config.freedesktop.org/releases + elif [ $$n = readline ]; then c=$(readline-checksum); w=http://ftp.gnu.org/gnu/readline + elif [ $$n = sed ]; then c=$(sed-checksum); w=http://ftp.gnu.org/gnu/sed + elif [ $$n = tar ]; then c=$(tar-checksum); w=http://ftp.gnu.org/gnu/tar + elif [ $$n = texinfo ]; then c=$(texinfo-checksum); w=http://ftp.gnu.org/gnu/texinfo + elif [ $$n = unzip ]; then + c=$(unzip-checksum) + mergenames=0; v=$$(echo $(unzip-version) | sed -e's/\.//') + w=ftp://ftp.info-zip.org/pub/infozip/src/unzip$$v.tgz + elif [ $$n = wget ]; then c=$(wget-checksum); w=http://ftp.gnu.org/gnu/wget + elif [ $$n = which ]; then c=$(which-checksum); w=http://ftp.gnu.org/gnu/which + elif [ $$n = xz ]; then c=$(xz-checksum); w=http://tukaani.org/xz + elif [ $$n = zip ]; then + c=$(zip-checksum) + mergenames=0; v=$$(echo $(zip-version) | sed -e's/\.//') + w=ftp://ftp.info-zip.org/pub/infozip/src/zip$$v.tgz + elif [ $$n = zlib ]; then c=$(zlib-checksum); w=http://www.zlib.net + else + echo; echo; echo + echo "'$$n' not recognized as a software tarball name to download." + echo; echo; echo + exit 1 + fi + + # Download the raw tarball, using an '.unchecked' suffix to specify + # that it is not yet fully checked and usable. But first, since the + # download may be interrupted in a previous build and an incomplete + # '.unchecked' file may remain, we'll remove any possibly existing + # uncheked file. + rm -f "$@.unchecked" + if [ -f $(DEPENDENCIES-DIR)/$* ]; then + cp $(DEPENDENCIES-DIR)/$* "$@.unchecked" + else + if [ $$mergenames = 1 ]; then tarballurl=$$w/"$*" + else tarballurl=$$w + fi + + echo "Downloading $$tarballurl" + if [ -f $(ibdir)/wget ]; then + downloader="wget --no-use-server-timestamps -O" + else + downloader="$(DOWNLOADER)" + fi + + touch $(lockdir)/download $(downloadwrapper) "$$downloader" $(lockdir)/download \ - $$tarballurl "$@.unchecked" "$(backupservers)"; \ - fi; \ - \ - \ - if type sha512sum > /dev/null 2>/dev/null; then \ - checksum=$$(sha512sum "$@.unchecked" | awk '{print $$1}'); \ - if [ x"$$checksum" = x"$$c" ]; then \ - mv "$@.unchecked" "$@"; \ - else \ - echo "ERROR: Non-matching checksum for '$*'."; \ - echo "Checksum should be: $$c"; \ - echo "Checksum is: $$checksum"; \ - exit 1; \ - fi; \ - else mv "$@.unchecked" "$@"; \ - fi; + $$tarballurl "$@.unchecked" "$(backupservers)" + fi + + # Make sure the file's Checksum is correct. + if type sha512sum > /dev/null 2>/dev/null; then + checksum=$$(sha512sum "$@.unchecked" | awk '{print $$1}') + if [ x"$$checksum" = x"$$c" ]; then + mv "$@.unchecked" "$@" + else + echo "ERROR: Non-matching checksum for '$*'." + echo "Checksum should be: $$c" + echo "Checksum is: $$checksum" + exit 1 + fi + else mv "$@.unchecked" "$@" + fi @@ -274,36 +290,39 @@ $(tarballs): $(tdir)/%: | $(lockdir) # Low-level (not built) programs # ------------------------------ # -# For the time being, we aren't building a local C compiler, but we'll use -# any C compiler that the system already has and just make a symbolic link -# to it. +# For the time being, some components of the project on some systems, so we +# are simply making a symbolic link to the system's files here. We'll do +# this after building GNU Coreutils to have trustable elements. # -# ccache: ccache acts like a wrapper over the C compiler and is made to -# avoid/speed-up compiling of identical files in a system (it is commonly -# used on large servers). It actually makes `gcc' or `g++' a symbolic link -# to itself so it can control them internally. So, for our purpose here, it -# is very annoying and can cause many complications. We thus remove any -# part of PATH of that has `ccache' in it before making symbolic links to -# the programs we are not building ourselves. +# About ccache: ccache acts like a wrapper over the C compiler and is made +# to avoid/speed-up compiling of identical files in a system (it is +# commonly used on large servers). It actually makes `gcc' or `g++' a +# symbolic link to itself so it can control them internally. So, for our +# purpose here, it is very annoying and can cause many complications. We +# thus remove any part of PATH of that has `ccache' in it before making +# symbolic links to the programs we are not building ourselves. makelink = origpath="$$PATH"; \ - export PATH=$$(echo $(syspath) \ - | tr : '\n' \ - | grep -v ccache \ - | tr '\n' :); \ - a=$$(which $(1) 2> /dev/null); \ - if [ -e $(ibdir)/$(1) ]; then rm $(ibdir)/$(1); fi; \ - if [ x$$a = x ]; then \ - if [ "x$(strip $(2))" = xmandatory ]; then \ - echo "'$(1)' is necessary for higher-level tools."; \ - echo "Please install it for the configuration to continue."; \ - exit 1; \ - fi; \ - else \ - ln -s $$a $(ibdir)/$(1); \ - fi; \ - export PATH="$$origpath" + export PATH=$$(echo $(syspath) \ + | tr : '\n' \ + | grep -v ccache \ + | tr '\n' :); \ + if type $(1) > /dev/null 2> /dev/null; then \ + if [ x$(3) = x ]; then \ + ln -sf $$(which $(1)) $(ibdir)/$(1); \ + else \ + ln -sf $$(which $(1)) $(ibdir)/$(3); \ + fi; \ + else \ + if [ "x$(strip $(2))" = xmandatory ]; then \ + echo "'$(1)' is necessary for higher-level tools."; \ + echo "Please install it for the configuration to continue."; \ + exit 1; \ + fi; \ + fi; \ + export PATH="$$origpath" + $(ibdir) $(ildir):; mkdir $@ -$(ibidir)/low-level-links: | $(ibdir) $(ildir) +$(ibidir)/low-level-links: $(ibidir)/coreutils | $(ibdir) $(ildir) # Not-installed (but necessary in some cases) compilers. # Clang is necessary for CMake. @@ -325,11 +344,11 @@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) # Necessary libraries: # Libdl (for dynamic loading libraries at runtime) # POSIX Threads library for multi-threaded programs. - for l in dl pthread; do \ - rm -f $(ildir)/lib$$l*; \ - if [ -f /usr/lib/lib$$l.a ]; then \ - ln -s /usr/lib/lib$$l.* $(ildir)/; \ - fi; \ + for l in dl pthread; do + rm -f $(ildir)/lib$$l*; + if [ -f /usr/lib/lib$$l.a ]; then + ln -s /usr/lib/lib$$l.* $(ildir)/ + fi done # We want this to be empty (so it doesn't interefere with the other @@ -349,28 +368,23 @@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) # ------------------------------------------ # # The first set of programs to be built are those that we need to unpack -# the source code tarballs of each program. First, we'll build the -# necessary programs, then we'll build GNU Tar. -$(ibidir)/gzip: $(tdir)/gzip-$(gzip-version).tar.gz +# the source code tarballs of each program. We have already installed Lzip +# before calling 'basic.mk', so it is present and working. Hence we first +# build the Lzipped tarball of Gzip, then use our own Gzip to unpack the +# tarballs of the other compression programs. Once all the compression +# programs/libraries are complete, we build our own GNU Tar and continue +# with other software. +$(ibidir)/gzip: $(tdir)/gzip-$(gzip-version).tar.lz $(call gbuild, gzip-$(gzip-version), static, , V=1) \ && echo "GNU Gzip $(gzip-version)" > $@ -# GNU Lzip: For a static build, the `-static' flag should be given to -# LDFLAGS on the command-line (not from the environment). -ifeq ($(static_build),yes) -lzipconf="LDFLAGS=-static" -else -lzipconf= -endif -$(ibidir)/lzip: $(tdir)/lzip-$(lzip-version).tar.gz - $(call gbuild, lzip-$(lzip-version), , $(lzipconf)) \ - && echo "Lzip $(lzip-version)" > $@ - -$(ibidir)/xz: $(tdir)/xz-$(xz-version).tar.gz +$(ibidir)/xz: $(ibidir)/gzip \ + $(tdir)/xz-$(xz-version).tar.gz $(call gbuild, xz-$(xz-version), static) \ && echo "XZ Utils $(xz-version)" > $@ -$(ibidir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz +$(ibidir)/bzip2: $(ibidir)/gzip \ + $(tdir)/bzip2-$(bzip2-version).tar.gz # Bzip2 doesn't have a `./configure' script, and its Makefile # doesn't build a shared library. So we can't use the `gbuild' # function here and we need to take some extra steps (inspired @@ -380,28 +394,28 @@ $(ibidir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz # # NOTE: the major version number appears in the final symbolic # link. - tdir=bzip2-$(bzip2-version); \ - if [ $(static_build) = yes ]; then \ - makecommand="make LDFLAGS=-static"; \ - makeshared="echo no-shared"; \ - else \ - makecommand="make"; \ - if [ x$(on_mac_os) = xyes ]; then \ - makeshared="echo no-shared"; \ - else \ - makeshared="make -f Makefile-libbz2_so"; \ - fi; \ - fi; \ + tdir=bzip2-$(bzip2-version) + if [ $(static_build) = yes ]; then + makecommand="make LDFLAGS=-static" + makeshared="echo no-shared" + else + makecommand="make" + if [ x$(on_mac_os) = xyes ]; then + makeshared="echo no-shared" + else + makeshared="make -f Makefile-libbz2_so" + fi + fi cd $(ddir) && rm -rf $$tdir \ && tar xf $(word 1,$(filter $(tdir)/%,$^)) \ && cd $$tdir \ && sed -e 's@\(ln -s -f \)$$(PREFIX)/bin/@\1@' Makefile \ > Makefile.sed \ && mv Makefile.sed Makefile \ - && $$makeshared \ + && $$makeshared CC=cc \ && cp -a libbz2* $(ildir)/ \ && make clean \ - && $$makecommand \ + && $$makecommand CC=cc \ && make install PREFIX=$(idir) \ && cd .. \ && rm -rf $$tdir \ @@ -409,21 +423,23 @@ $(ibidir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz && ln -fs libbz2.so.1.0 libbz2.so \ && echo "Bzip2 $(bzip2-version)" > $@ -$(ibidir)/unzip: $(tdir)/unzip-$(unzip-version).tar.gz - v=$$(echo $(unzip-version) | sed -e's/\.//'); \ +$(ibidir)/unzip: $(ibidir)/gzip \ + $(tdir)/unzip-$(unzip-version).tar.gz + v=$$(echo $(unzip-version) | sed -e's/\.//') $(call gbuild, unzip$$v, static,, \ - -f unix/Makefile generic_gcc \ + -f unix/Makefile generic \ CFLAGS="-DBIG_MEM -DMMAP",,pwd, \ - -f unix/Makefile \ + -f unix/Makefile generic \ BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 ) \ && echo "Unzip $(unzip-version)" > $@ -$(ibidir)/zip: $(tdir)/zip-$(zip-version).tar.gz - v=$$(echo $(zip-version) | sed -e's/\.//'); \ +$(ibidir)/zip: $(ibidir)/gzip \ + $(tdir)/zip-$(zip-version).tar.gz + v=$$(echo $(zip-version) | sed -e's/\.//') $(call gbuild, zip$$v, static,, \ - -f unix/Makefile generic_gcc \ + -f unix/Makefile generic \ CFLAGS="-DBIG_MEM -DMMAP",,pwd, \ - -f unix/Makefile \ + -f unix/Makefile generic \ BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 ) \ && echo "Zip $(zip-version)" > $@ @@ -432,7 +448,8 @@ $(ibidir)/zip: $(tdir)/zip-$(zip-version).tar.gz # # Note for a static-only build: Zlib's `./configure' doesn't use Autoconf's # configure script, it just accepts a direct `--static' option. -$(ibidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz +$(ibidir)/zlib: $(ibidir)/gzip \ + $(tdir)/zlib-$(zlib-version).tar.gz $(call gbuild, zlib-$(zlib-version)) \ && echo "Zlib $(zlib-version)" > $@ @@ -443,8 +460,7 @@ $(ibidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz # software to be built). $(ibidir)/tar: $(ibidir)/xz \ $(ibidir)/zip \ - $(ibidir)/gzip \ - $(ibidir)/lzip \ + $(ibidir)/gzip \ $(ibidir)/zlib \ $(ibidir)/bzip2 \ $(ibidir)/unzip \ @@ -476,13 +492,7 @@ $(ibidir)/tar: $(ibidir)/xz \ # function (for tilde expansion). The first can be disabled with # `--disable-load', but unfortunately I don't know any way to fix the # second. So, we'll have to build it dynamically for now. -$(ibidir)/make: $(ibidir)/tar \ - $(tdir)/make-$(make-version).tar.gz - # See Tar's comments for the `-j' option. - $(call gbuild, make-$(make-version), , , -j$(numthreads)) \ - && echo "GNU Make $(make-version)" > $@ - -$(ibidir)/ncurses: $(ibidir)/make \ +$(ibidir)/ncurses: $(ibidir)/tar \ $(tdir)/ncurses-$(ncurses-version).tar.gz # Delete the library that will be installed (so we can make sure @@ -540,32 +550,32 @@ $(ibidir)/ncurses: $(ibidir)/make \ # # 5. A link is made to also be able to include files from the # `ncurses' headers. - if [ x$(on_mac_os) = xyes ]; then so="dylib"; else so="so"; fi; \ - if [ -f $(ildir)/libncursesw.$$so ]; then \ - \ + if [ x$(on_mac_os) = xyes ]; then so="dylib"; else so="so"; fi + if [ -f $(ildir)/libncursesw.$$so ]; then + sov=$$(ls -l $(ildir)/libncursesw* \ | awk '/^-/{print $$NF}' \ - | sed -e's|'$(ildir)/libncursesw.'||'); \ - \ - cd "$(ildir)"; \ - for lib in ncurses ncurses++ form panel menu; do \ - ln -fs lib$$lib"w".$$sov lib$$lib.$$so; \ - ln -fs $(ildir)/pkgconfig/"$$lib"w.pc pkgconfig/$$lib.pc; \ - done; \ - for lib in tic tinfo; do \ - ln -fs libncursesw.$$sov lib$$lib.$$so; \ - ln -fs libncursesw.$$sov lib$$lib.$$sov; \ - ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/$$lib.pc; \ - done; \ - ln -fs libncursesw.$$sov libcurses.$$so; \ - ln -fs libncursesw.$$sov libcursesw.$$sov; \ - ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/curses.pc; \ - ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/cursesw.pc; \ - \ - ln -fs $(idir)/include/ncursesw $(idir)/include/ncurses; \ - echo "GNU NCURSES $(ncurses-version)" > $@; \ - else \ - exit 1; \ + | sed -e's|'$(ildir)/libncursesw.'||') + + cd "$(ildir)" + for lib in ncurses ncurses++ form panel menu; do + ln -fs lib$$lib"w".$$sov lib$$lib.$$so + ln -fs $(ildir)/pkgconfig/"$$lib"w.pc pkgconfig/$$lib.pc + done + for lib in tic tinfo; do + ln -fs libncursesw.$$sov lib$$lib.$$so + ln -fs libncursesw.$$sov lib$$lib.$$sov + ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/$$lib.pc + done + ln -fs libncursesw.$$sov libcurses.$$so + ln -fs libncursesw.$$sov libcursesw.$$sov + ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/curses.pc + ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/cursesw.pc + + ln -fs $(idir)/include/ncursesw $(idir)/include/ncurses + echo "GNU NCURSES $(ncurses-version)" > $@ + else + exit 1 fi $(ibidir)/readline: $(ibidir)/ncurses \ @@ -575,7 +585,7 @@ $(ibidir)/readline: $(ibidir)/ncurses \ SHLIB_LIBS="-lncursesw" -j$(numthreads)) \ && echo "GNU Readline $(readline-version)" > $@ -$(ibidir)/patchelf: $(ibidir)/make \ +$(ibidir)/patchelf: $(ibidir)/tar \ $(tdir)/patchelf-$(patchelf-version).tar.gz $(call gbuild, patchelf-$(patchelf-version)) \ && echo "PatchELF $(patchelf-version)" > $@ @@ -629,13 +639,13 @@ $(ibidir)/bash: $(needpatchelf) \ # default. As described in the manual, they are mainly useful when # you disable them all with `--enable-minimal-config' and enable a # subset using the `--enable' options. - if [ "x$(static_build)" = xyes ]; then stopt="--enable-static-link";\ - else stopt=""; \ - fi; \ + if [ "x$(static_build)" = xyes ]; then stopt="--enable-static-link" + else stopt="" + fi; export CFLAGS="$$CFLAGS \ -DDEFAULT_PATH_VALUE='\"$(ibdir)\"' \ -DSTANDARD_UTILS_PATH='\"$(ibdir)\"' \ - -DSYS_BASHRC='\"$(BASH_ENV)\"' "; \ + -DSYS_BASHRC='\"$(BASH_ENV)\"' " $(call gbuild, bash-$(bash-version),, $$stopt \ --with-installed-readline=$(ildir) \ --with-curses=yes, \ @@ -645,9 +655,9 @@ $(ibidir)/bash: $(needpatchelf) \ # default. So, we have to manually include it, currently we are # only doing this on GNU/Linux systems (using the `patchelf' # program). - if [ "x$(needpatchelf)" != x ]; then \ - if [ -f $(ibdir)/bash ]; then \ - $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/bash; fi \ + if [ "x$(needpatchelf)" != x ]; then + if [ -f $(ibdir)/bash ]; then + $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/bash; fi fi # To be generic, some systems use the `sh' command to call the @@ -658,10 +668,10 @@ $(ibidir)/bash: $(needpatchelf) \ # Just to be sure that the installation step above went well, # before making the link, we'll see if the file actually exists # there. - if [ -f $(ibdir)/bash ]; then \ - ln -fs $(ibdir)/bash $(ibdir)/sh; \ - echo "GNU Bash $(bash-version)" > $@; \ - else \ + if [ -f $(ibdir)/bash ]; then + ln -fs $(ibdir)/bash $(ibdir)/sh + echo "GNU Bash $(bash-version)" > $@ + else echo "GNU Bash not built!"; exit 1; fi @@ -678,14 +688,14 @@ perl-conflddlflags = else perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" endif -$(ibidir)/perl: $(ibidir)/make \ +$(ibidir)/perl: $(ibidir)/tar \ $(tdir)/perl-$(perl-version).tar.gz major_version=$$(echo $(perl-version) \ | sed -e's/\./ /g' \ - | awk '{printf("%d", $$1)}'); \ + | awk '{printf("%d", $$1)}') base_version=$$(echo $(perl-version) \ | sed -e's/\./ /g' \ - | awk '{printf("%d.%d", $$1, $$2)}'); \ + | awk '{printf("%d.%d", $$1, $$2)}') cd $(ddir) \ && rm -rf perl-$(perl-version) \ && if ! tar xf $(word 1,$(filter $(tdir)/%,$^)); then \ @@ -795,7 +805,7 @@ $(idir)/etc:; mkdir $@ # Note: cert.pm has to be AFTER the tarball, otherwise the build script # will try to unpack cert.pm and crash (it unpacks the first dependency # under `tdir'). -$(ibidir)/openssl: $(ibidir)/make \ +$(ibidir)/openssl: $(ibidir)/tar \ $(tdir)/openssl-$(openssl-version).tar.gz \ $(tdir)/cert.pem \ | $(idir)/etc @@ -969,13 +979,13 @@ $(ibidir)/libiconv: $(ibidir)/pkg-config \ $(call gbuild, libiconv-$(libiconv-version), static) \ && echo "GNU libiconv $(libiconv-version)" > $@ -$(ibidir)/libunistring: $(ibidir)/make \ +$(ibidir)/libunistring: $(ibidir)/libiconv \ $(tdir)/libunistring-$(libunistring-version).tar.xz $(call gbuild, libunistring-$(libunistring-version), static,, \ -j$(numthreads)) \ && echo "GNU libunistring $(libunistring-version)" > $@ -$(ibidir)/libxml2: $(ibidir)/make \ +$(ibidir)/libxml2: $(ibidir)/tar \ $(tdir)/libxml2-$(libxml2-version).tar.gz # The libxml2 tarball also contains Python bindings which are built # and installed to a system directory by default. If you don't need @@ -1150,7 +1160,7 @@ $(ibidir)/mpfr: $(ibidir)/gmp \ $(call gbuild, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ -$(ibidir)/pkg-config: $(ibidir)/make \ +$(ibidir)/pkg-config: $(ibidir)/tar \ $(tdir)/pkg-config-$(pkgconfig-version).tar.gz # An existing `libiconv' can cause a conflict with `pkg-config', # this is why `libiconv' depends on `pkg-config'. On a clean build, @@ -1305,11 +1315,11 @@ $(ibidir)/gcc: $(gcc-tarball) \ # in '$(idir)/lib' by defining the '$(idir)/lib64' as a symbolic # link to '$(idir)/lib'. if [ $(host_cc) = 1 ]; then \ - $(call makelink,gcc); \ - $(call makelink,g++,mandatory); \ - $(call makelink,gfortran,mandatory); \ + $(call makelink,cc); \ + $(call makelink,cc,,gcc); \ + $(call makelink,c++,,g++); \ + $(call makelink,gfortran); \ $(call makelink,strip,mandatory); \ - ln -sf $$(which gcc) $(ibdir)/cc; \ ccinfo=$$(gcc --version | awk 'NR==1'); \ echo "C compiler (""$$ccinfo"")" > $@; \ else \ -- cgit v1.2.1