aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-03-18 18:59:31 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-03-18 18:59:31 +0000
commit27e0e23ec87cdfed5a2843fa8af35b1e0ac2e615 (patch)
tree37ef695eb3cae323aaa9392ee852d865d5ad159d /reproduce/src
parent8e82dcc513b2e61e981c39987af426e700c607ad (diff)
Reseting path in script to make symbolic links to system programs
Until recently, there was no problem with the `makelink' script of `dependencies-basic.mk' because it was called on separate recipe lines (and thus separate shells). But recently we added a call to it within a single shell (for GCC on Mac OS systems). So a previous call to it would effect the next call. To fix this, in this commit, we are re-setting PATH to its original value after each call finishes.
Diffstat (limited to 'reproduce/src')
-rw-r--r--reproduce/src/make/dependencies-basic.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index c08e6eb..2e6caf4 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -202,11 +202,13 @@ $(tarballs): $(tdir)/%:
# 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 = export PATH=$$(echo $(syspath)| tr : '\n' |grep -v ccache \
- | paste -s -d:); \
- a=$$(which $(1) 2> /dev/null); \
- if [ -f $(ibdir)/$(1) ]; then rm $(ibdir)/$(1); fi; \
- if [ x$$a != x ]; then ln -s $$a $(ibdir)/$(1); fi
+makelink = origpath="$$PATH"; \
+ export PATH=$$(echo $(syspath) | tr : '\n' | grep -v ccache \
+ | paste -s -d:); \
+ a=$$(which $(1) 2> /dev/null); \
+ if [ -f $(ibdir)/$(1) ]; then rm $(ibdir)/$(1); fi; \
+ if [ x$$a != x ]; then ln -s $$a $(ibdir)/$(1); fi; \
+ export PATH="$$origpath"
$(ibdir) $(ildir):; mkdir $@
$(ibdir)/low-level-links: | $(ibdir) $(ildir)
@@ -748,12 +750,12 @@ $(ibdir)/gcc: $(gcc-prerequisites) \
$(ibdir)/which
# On a macOS, we (currently!) won't build GCC because of some
- # errors we are still trying to find. So, we'll just make a
- # symbolic link to the host's executables.
+ # errors we are still trying to fix. So, we'll just make a symbolic
+ # link to the host's executables.
if [ "x$(on_mac_os)" = xyes ]; then \
$(call makelink,gfortran); \
- $(call makelink,gcc); \
$(call makelink,g++); \
+ $(call makelink,gcc); \
else \
\
rm -f $(ibdir)/gcc* $(ibdir)/g++ $(ibdir)/gfortran $(ibdir)/gcov*;\