diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2018-11-28 01:24:42 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2018-11-28 01:30:01 +0000 |
commit | a25c2cf65c78fd504ec3cbf6f007b4011ba248a1 (patch) | |
tree | c24bb315acbb9e555a3c15e1d49dd220d4ca530c /reproduce/src/make/dependencies.mk | |
parent | d4138e68e7160ec1242c08da83c58e2d9097f222 (diff) |
Better control of shared library linking
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.
Diffstat (limited to 'reproduce/src/make/dependencies.mk')
-rw-r--r-- | reproduce/src/make/dependencies.mk | 30 |
1 files changed, 17 insertions, 13 deletions
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 |