summaryrefslogtreecommitdiff
path: root/nacl
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-27 01:22:53 (GMT)
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-27 01:22:53 (GMT)
commita66b2c6df162f222f0adbbc027818326671fd9a1 (patch)
treeafa39b61f5ea4a6fec20822315c042cf838b20d7 /nacl
parent51463abb6898e772ff360cb0a4497183776d0f89 (diff)
* nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY)
Rewrites these variables instead of PATH. NaCl port uses a toolchain which is specified by NACL_SDK_ROOT environment variable. Originally, NaCl build added the toolchain under the NACL_SDK_ROOT to the PATH. But updating PATH doesn't work on Mac. (RBCONFIG): Replaces configs with the variable updates above. * configure.in: Thus it is no longer necessary to check $PATH. Based on a patch by Takashi Toyoshima <toyoshim AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'nacl')
-rw-r--r--nacl/GNUmakefile.in31
1 files changed, 28 insertions, 3 deletions
diff --git a/nacl/GNUmakefile.in b/nacl/GNUmakefile.in
index ebb3bfb..6c9b092 100644
--- a/nacl/GNUmakefile.in
+++ b/nacl/GNUmakefile.in
@@ -7,7 +7,14 @@ include Makefile
NACL_SDK_ROOT=@NACL_SDK_ROOT@
NACL_TOOLCHAIN=@NACL_TOOLCHAIN@
NACL_TOOLCHAIN_DIR=$(NACL_SDK_ROOT)/toolchain/$(NACL_TOOLCHAIN)
-PATH+=:$(NACL_TOOLCHAIN_DIR)/bin
+CC:=$(NACL_TOOLCHAIN_DIR)/bin/$(CC)
+LD:=$(NACL_TOOLCHAIN_DIR)/bin/$(LD)
+NM:=$(NACL_TOOLCHAIN_DIR)/bin/$(NM)
+AR:=$(NACL_TOOLCHAIN_DIR)/bin/$(AR)
+AS:=$(NACL_TOOLCHAIN_DIR)/bin/$(AS)
+RANLIB:=$(NACL_TOOLCHAIN_DIR)/bin/$(RANLIB)
+OBJDUMP:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJDUMP)
+OBJCOPY:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJCOPY)
PYTHON=@PYTHON@
PPROGRAM=pepper-$(PROGRAM)
@@ -40,6 +47,19 @@ file.$(OBJEXT):
$(Q) $(OBJCOPY) --weaken-symbol=rb_file_load_ok $@.tmp $@
@-$(RM) $@.tmp
+$(RBCONFIG):
+ @sed \
+ -e 's!CONFIG\["CC"\] = .*!CONFIG\["CC"\] = "$(CC)"!' \
+ -e 's!CONFIG\["LD"\] = .*!CONFIG\["LD"\] = "$(LD)"!' \
+ -e 's!CONFIG\["NM"\] = .*!CONFIG\["NM"\] = "$(NM)"!' \
+ -e 's!CONFIG\["AR"\] = .*!CONFIG\["AR"\] = "$(AR)"!' \
+ -e 's!CONFIG\["AS"\] = .*!CONFIG\["AS"\] = "$(AS)"!' \
+ -e 's!CONFIG\["RANLIB"\] = .*!CONFIG\["RANLIB"\] = "$(RANLIB)"!' \
+ -e 's!CONFIG\["OBJDUMP"\] = .*!CONFIG\["OBJDUMP"\] = "$(OBJDUMP)"!' \
+ -e 's!CONFIG\["OBJCOPY"\] = .*!CONFIG\["OBJCOPY"\] = "$(OBJCOPY)"!' \
+ -i.bak rbconfig.rb
+ @touch .rbconfig.time
+
all: pprogram
main: $(PROGRAM_NMF)
pprogram: showflags $(PPROGRAM) $(PPROGRAM_NMF)
@@ -53,8 +73,13 @@ package: pprogram install-lib install-ext-comm install-ext-arch
showflags: show_naclflags
show_naclflags:
- @echo " PATH = $(PATH)"
- @echo " NACL_SDK_ROOT = $(NACL_SDK_ROOT)"
+ @echo " NACL_SDK_ROOT = $(NACL_SDK_ROOT)"
+ @echo " NM = $(NM)"
+ @echo " AR = $(AR)"
+ @echo " AS = $(AS)"
+ @echo " RANLIB = $(RANLIB)"
+ @echo " OBJDUMP = $(OBJDUMP)"
+ @echo " OBJCOPY = $(OBJCOPY)"
clean-local::
-$(RM) $(PPROGRAM) pepper_main.$(OBJEXT) $(PROGRAM_NMF) $(PPRGORAM_NMF)