aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/src/make')
-rw-r--r--reproduce/src/make/dependencies-basic.mk28
-rw-r--r--reproduce/src/make/dependencies-build-rules.mk1
-rw-r--r--reproduce/src/make/dependencies.mk30
-rw-r--r--reproduce/src/make/initialize.mk23
4 files changed, 52 insertions, 30 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index a3d679e..196d457 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -55,12 +55,14 @@ syspath := $(PATH)
# As we build more programs, we want to use our own pipeline's built
# programs and libraries, not the host's.
-PATH := $(ibdir):$(PATH)
-LDFLAGS := -L$(ildir) $(LDFLAGS)
-CPPFLAGS := -I$(idir)/include $(CPPFLAGS)
-LD_LIBRARY_PATH := $(ildir):$(LD_LIBRARY_PATH)
-
-top-level-programs = bash which ls sed gawk grep diff find
+export PATH := $(ibdir):$(PATH)
+export PKG_CONFIG_PATH := $(ildir)/pkgconfig
+export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
+export LDFLAGS := -L$(ildir) $(LDFLAGS)
+export CPPFLAGS := -I$(idir)/include $(CPPFLAGS)
+export LD_LIBRARY_PATH := $(ildir):$(LD_LIBRARY_PATH)
+
+top-level-programs = bash which ls sed gawk grep diff find pkg-config
all: $(foreach p, $(top-level-programs), $(ibdir)/$(p))
@@ -99,6 +101,7 @@ tarballs = $(foreach t, bash-$(bash-version).tar.gz \
gzip-$(gzip-version).tar.gz \
lzip-$(lzip-version).tar.gz \
make-$(make-version).tar.lz \
+ pkg-config-$(pkgconfig-version).tar.gz \
sed-$(sed-version).tar.xz \
tar-$(tar-version).tar.gz \
which-$(which-version).tar.gz \
@@ -123,6 +126,7 @@ $(tarballs): $(tdir)/%:
elif [ $$n = gzip ]; then w=http://akhlaghi.org/src; \
elif [ $$n = lzip ]; then w=http://download.savannah.gnu.org/releases/lzip; \
elif [ $$n = make ]; then w=http://akhlaghi.org/src; \
+ elif [ $$n = pkg ]; then w=https://pkg-config.freedesktop.org/releases; \
elif [ $$n = sed ]; then w=http://ftp.gnu.org/gnu/sed; \
elif [ $$n = tar ]; then w=http://ftp.gnu.org/gnu/tar; \
elif [ $$n = which ]; then w=http://ftp.gnu.org/gnu/which; \
@@ -171,6 +175,13 @@ $(ibdir)/low-level: | $(ibdir)
# The linker
$(call makelink,ar)
$(call makelink,ld)
+ $(call makelink,nm)
+ $(call makelink,ps)
+
+ # On Mac OS, libtool is different compared to GNU Libtool. The
+ # libtool we'll build in the high-level dependencies has the
+ # executable name `glibtool'.
+ $(call makelink,libtool)
# GNU Gettext (translate messages)
$(call makelink,msgfmt)
@@ -279,6 +290,11 @@ $(ibdir)/ls: $(tdir)/coreutils-$(coreutils-version).tar.xz \
$(ibdir)/make
$(call gbuild, $<, coreutils-$(coreutils-version), static)
+$(ibdir)/pkg-config: $(tdir)/pkg-config-$(pkgconfig-version).tar.gz \
+ $(ibdir)/make
+ $(call gbuild, $<, pkg-config-$(pkgconfig-version), static, \
+ --with-internal-glib)
+
$(ibdir)/sed: $(tdir)/sed-$(sed-version).tar.xz \
$(ibdir)/make
$(call gbuild, $<, sed-$(sed-version), static)
diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk
index 7b3a419..c0561a7 100644
--- a/reproduce/src/make/dependencies-build-rules.mk
+++ b/reproduce/src/make/dependencies-build-rules.mk
@@ -53,7 +53,6 @@ gbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \
fi; \
check="$(6)"; \
if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \
- export SHELL=$(ibdir)/bash; \
cd $(ddir) && rm -rf $(2) && tar xf $(1) && cd $(2) && \
./configure $(4) --prefix=$(idir) && \
make $(5) && \
diff --git a/reproduce/src/make/dependencies.mk b/reproduce/src/make/dependencies.mk
index c795b34..6f4aa78 100644
--- a/reproduce/src/make/dependencies.mk
+++ b/reproduce/src/make/dependencies.mk
@@ -51,12 +51,14 @@ all: $(foreach p, $(top-level-programs), $(ibdir)/$(p))
# compiler and linker. For the library binaries and headers, we are only
# using our internally built libraries.
.ONESHELL:
-.SHELLFLAGS := -ec
-PATH := $(ibdir)
-LD_LIBRARY_PATH := $(ildir)
-LDFLAGS := -L$(ildir)
-SHELL := $(ibdir)/bash
-CPPFLAGS := -I$(idir)/include
+.SHELLFLAGS := -ec
+export PATH := $(ibdir)
+export LD_LIBRARY_PATH := $(ildir)
+export SHELL := $(ibdir)/bash
+export CPPFLAGS := -I$(idir)/include
+export PKG_CONFIG_PATH := $(ildir)/pkgconfig
+export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
+export LDFLAGS := -Wl,-rpath=$(ildir) -L$(ildir)
@@ -183,15 +185,14 @@ $(ilidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz | $(ilidir)
$(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 | $(ilidir)
+$(ilidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \
+ $(ilidir)/libjpeg | $(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.
+ # Unfortunately WCSLIB forces the building of shared libraries.
$(call gbuild, $<, wcslib-$(wcslib-version), , \
LIBS="-pthread -lcurl -lm" --without-pgplot \
--disable-fortran) \
@@ -225,8 +226,11 @@ $(ibdir)/curl: $(tdir)/curl-$(curl-version).tar.gz \
$(ilidir)/zlib
$(call gbuild, $<, curl-$(curl-version), static, --without-brotli)
-$(ibdir)/libtool: $(tdir)/libtool-$(libtool-version).tar.xz
- $(call gbuild, $<, libtool-$(libtool-version), static)
+# On Mac OS, libtool does different things, so to avoid confusion, we'll
+# prefix GNU's libtool executables with `glibtool'.
+$(ibdir)/glibtool: $(tdir)/libtool-$(libtool-version).tar.xz
+ $(call gbuild, $<, libtool-$(libtool-version), static, \
+ --program-prefix=g)
$(ibdir)/gs: $(tdir)/ghostscript-$(ghostscript-version).tar.gz
$(call gbuild, $<, ghostscript-$(ghostscript-version))
@@ -243,7 +247,7 @@ $(ibdir)/astnoisechisel: $(tdir)/gnuastro-$(gnuastro-version).tar.lz \
$(ibdir)/gs \
$(ilidir)/gsl \
$(ilidir)/wcslib \
- $(ibdir)/libtool \
+ $(ibdir)/glibtool \
$(ilidir)/libjpeg \
$(ilidir)/libtiff \
$(ilidir)/libgit2
diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk
index 3453d4e..9141b30 100644
--- a/reproduce/src/make/initialize.mk
+++ b/reproduce/src/make/initialize.mk
@@ -42,6 +42,7 @@ texbdir = $(texdir)/build
tikzdir = $(texbdir)/tikz
mtexdir = $(texdir)/macros
pconfdir = reproduce/config/pipeline
+installdir = $(BDIR)/dependencies/installed
# --------- Delete for no Gnuastro ---------
gconfdir = reproduce/config/gnuastro
# ------------------------------------------
@@ -72,12 +73,12 @@ curdir := $(shell echo $$(pwd))
# environment variables, we are setting it to prefer the software we have
# build here.
.ONESHELL:
-.SHELLFLAGS = -ec
-SHELL := .local/bin/bash
-PATH := $(curdir)/.local/bin
-LD_LIBRARY_PATH := $(curdir)/.local/lib
-LDFLAGS := -L$(curdir)/.local/lib
-CPPFLAGS := -I$(curdir)/.local/include
+.SHELLFLAGS = -ec
+export PATH := $(installdir)/bin
+export LD_LIBRARY_PATH := $(installdir)/lib
+export LDFLAGS := -L$(installdir)/lib
+export SHELL := $(installdir)/bin/bash
+export CPPFLAGS := -I$(installdir)/include
@@ -197,18 +198,20 @@ $(mtexdir)/initialize.tex: | $(mtexdir)
$(call pvcheck, curl, $(curl-version), cURL, curlversion)
$(call pvcheck, diff, $(diffutils-version), GNU Diffutils, \
diffutilsversion)
- $(call pvcheck, find, $(findutils-version), GNU Findutils, \
+ $(call pvcheck, find, $(findutils-version), GNU Findutils, \
findutilsversion)
$(call pvcheck, gs, $(ghostscript-version), GPL Ghostscript, \
- ghostscriptversion)
+ ghostscriptversion)
$(call pvcheck, git, $(git-version), Git, gitversion)
$(call pvcheck, grep, $(grep-version), GNU Grep, grepversion)
- $(call pvcheck, libtool, $(libtool-version), GNU Libtool, \
+ $(call pvcheck, glibtool, $(libtool-version), GNU Libtool, \
libtoolversion)
$(call pvcheck, ls, $(coreutils-version), GNU Coreutils, \
coreutilsversion)
$(call pvcheck, lzip, $(lzip-version), Lzip, lzipversion)
$(call pvcheck, make, $(make-version), GNU Make, makeversion)
+ $(call pvcheck, pkg-config, $(pkgconfig-version), pkg-config, \
+ pkgconfigversion)
$(call pvcheck, sed, $(sed-version), GNU SED, sedversion)
$(call pvcheck, tar, $(tar-version), GNU Tar, tarversion)
$(call pvcheck, which, $(which-version), GNU Which, whichversion)
@@ -216,7 +219,7 @@ $(mtexdir)/initialize.tex: | $(mtexdir)
# --------- Delete for no Gnuastro ---------
$(call pvcheck, astnoisechisel, $(gnuastro-version), Gnuastro, \
- gnuastroversion)
+ gnuastroversion)
# ------------------------------------------
# Bzip2 prints its version in standard error, not standard output!