From a25c2cf65c78fd504ec3cbf6f007b4011ba248a1 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 28 Nov 2018 01:24:42 +0000 Subject: Better control of shared library linking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now we weren't explicity writing the full path of the dynamic libraries necessary for linking a program. But now with `-Wl,-rpath=$(ildir)' we ensure that the linker keeps the address of the dynamic libraries necessary for linking at linking time, not running time. Also, `pkg-config' is also built when preparing the basics. Several other minor corrections were made thanks to the great help of Raúl Infante Sainz. --- reproduce/src/make/dependencies-basic.mk | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'reproduce/src/make/dependencies-basic.mk') 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) -- cgit v1.2.1