Skip to content

Commit

Permalink
* nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY)
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
yugui committed Aug 27, 2012
1 parent 51463ab commit a66b2c6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
@@ -1,3 +1,17 @@
Sun Aug 26 09:22:33 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>

* 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>.

Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>

* insns.def (checkmatch): suppress warnings. [ruby-core:47310]
Expand Down
6 changes: 1 addition & 5 deletions configure.in
Expand Up @@ -111,11 +111,7 @@ AC_DEFUN([RUBY_NACL],
AC_MSG_RESULT(${NACL_TOOLCHAIN})

AC_MSG_CHECKING([path to SDK])
if echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
AC_MSG_RESULT([set])
else
AC_MSG_RESULT([no])
AC_MSG_WARN([Add "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" to \$PATH])
if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
fi

Expand Down
31 changes: 28 additions & 3 deletions nacl/GNUmakefile.in
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit a66b2c6

Please sign in to comment.