diff options
-rwxr-xr-x | configure | 26 | ||||
-rw-r--r-- | reproduce/src/make/dependencies-build-rules.mk | 7 | ||||
-rw-r--r-- | reproduce/src/make/dependencies.mk | 10 |
3 files changed, 34 insertions, 9 deletions
@@ -535,6 +535,28 @@ fi +# See if the linker accepts -Wl,-rpath-link +# ----------------------------------------- +# +# `-rpath-link' is used to write the information of the linked shared +# library into the shared object (library or program). But some versions of +# LLVM's linker don't accept it an can cause problems. +oprog=$depdir/rpath-test +cprog=$depdir/rpath-test.c +echo "#include <stdio.h>" > $cprog +echo "int main(void) {return 0;}" >> $cprog +if [ x$CC = x ]; then CC=gcc; fi; +if $CC $cprog -o$oprog -Wl,-rpath-link &> /dev/null; then + export rpath_command="-Wl,-rpath-link=$instdir/lib" +else + export rpath_command="" +fi +rm -f $oprog $cprog + + + + + # Inform the user that the build process is starting # ------------------------------------------------- if [ $printnotice = yes ]; then @@ -588,7 +610,9 @@ make -f reproduce/src/make/dependencies-basic.mk \ # to build them in this script. But after this, we can rely on Makefiles. numthreads=$($instdir/bin/nproc) ./.local/bin/make -f reproduce/src/make/dependencies.mk \ - static_build=$static_build -j$numthreads + static_build=$static_build \ + rpath_command=$rpath_command \ + -j$numthreads diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk index b7d6c1a..479b008 100644 --- a/reproduce/src/make/dependencies-build-rules.mk +++ b/reproduce/src/make/dependencies-build-rules.mk @@ -98,9 +98,8 @@ cbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \ cd $(ddir) && rm -rf $(2) && tar xf $(1) && cd $(2) && \ rm -rf pipeline-build && mkdir pipeline-build && \ cd pipeline-build && \ - cmake .. $$opts $(4) && \ - cmake --build . && \ - cmake .. -DCMAKE_INSTALL_PREFIX=$(idir) && \ - cmake --build . --target install && \ + cmake .. -DCMAKE_LIBRARY_PATH=$(ildir) \ + -DCMAKE_INSTALL_PREFIX=$(idir) $$opts $(4) && \ + make && make install && \ cd ../.. && \ rm -rf $(2) diff --git a/reproduce/src/make/dependencies.mk b/reproduce/src/make/dependencies.mk index dc9e053..9f16615 100644 --- a/reproduce/src/make/dependencies.mk +++ b/reproduce/src/make/dependencies.mk @@ -59,7 +59,7 @@ 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-link=$(ildir) -L$(ildir) +export LDFLAGS := $(rpath_command) -L$(ildir) @@ -193,11 +193,13 @@ $(ilidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \ $(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ $(ilidir)/cfitsio | $(ilidir) - # Unfortunately WCSLIB forces the building of shared libraries. + # Unfortunately WCSLIB forces the building of shared libraries. So + # we'll just delete any shared library that is produced afterwards. $(call gbuild, $<, wcslib-$(wcslib-version), , \ LIBS="-pthread -lcurl -lm" --without-pgplot \ - --disable-fortran) \ - && echo "WCSLIB is built" > $@ + --disable-fortran) && \ + rm -f $(ildir)/libwcs.so* $(ildir)/libwcs*.dylib && \ + echo "WCSLIB is built" > $@ # Zlib: its `./configure' doesn't use Autoconf's configure script, it just # accepts a direct `--static' option. |