Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Fix PNaCl configure/link errors.
Browse files Browse the repository at this point in the history
* configure.in (nacl_cv_cpu_nick): fix typo in PNaCl.
  (XCFLAGS) Add -isystem flag to pnacl and nacl-newlib
  (CXX): added

* nacl/GNUmakefile.in (CXX): Added
  (PPROGRAM): Use clang++ instead of clang because libnacl_io
  depends on c++ std lib.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yugui committed Oct 22, 2014
1 parent a49be8a commit f65e512
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
Wed Oct 22 21:09:51 2014 Yuki Yugui Sonoda <yugui@yugui.jp>

* configure.in (nacl_cv_cpu_nick): fix typo in PNaCl.
(XCFLAGS) Add -isystem flag to pnacl and nacl-newlib
(CXX): added

* nacl/GNUmakefile.in (CXX): Added
(PPROGRAM): Use clang++ instead of clang because libnacl_io
depends on c++ std lib.

Wed Oct 22 21:07:32 2014 Yuki Yugui Sonoda <yugui@yugui.jp>

* common.mk (build-ext): avoid trying to build dynamic libraries
Expand Down
11 changes: 9 additions & 2 deletions configure.in
Expand Up @@ -101,7 +101,7 @@ AC_DEFUN([RUBY_NACL],
[i?86], [nacl_cv_cpu_nick=x86
nacl_cv_cpu_nick2=x86_32],
[le32], [nacl_cv_cpu_nick=pnacl
nacl_cv_cpu_nick2=pnacl,
nacl_cv_cpu_nick2=pnacl
ac_cv_exeext=.pexe],
[nacl_cv_cpu_nick=$target_cpu])
AS_CASE(["$build_os"],
Expand Down Expand Up @@ -153,13 +153,19 @@ AC_DEFUN([RUBY_NACL],
AC_MSG_RESULT(${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin)

RUBY_APPEND_OPTIONS(XCFLAGS, '-I$(NACL_SDK_ROOT)/include')
if test x"${nacl_cv_cpu_nick}" = xpnacl; then
RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/pnacl')
elif test x"${nacl_cv_build_variant}" = xnewlib; then
RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/newlib')
fi

AC_MSG_CHECKING([nacl library path])
if test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"; then
nacl_cv_libpath="${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}"
elif test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"; then
nacl_cv_libpath="${nacl_cv_cpu_nick2}"
else
AC_MSG_ERROR("not found")
AC_MSG_ERROR([not found])
fi
AC_MSG_RESULT([${nacl_cv_libpath}])
RUBY_APPEND_OPTIONS(XLDFLAGS, '-L$(NACL_SDK_ROOT)/'"lib/${nacl_cv_libpath}/Release")
Expand All @@ -169,6 +175,7 @@ AC_DEFUN([RUBY_NACL],
AC_SUBST(NACL_SDK_VARIANT, "${nacl_cv_build_variant}")
AC_SUBST(NACL_LIB_PATH, "${nacl_cv_libpath}")
AC_CHECK_TOOLS(CC, [clang gcc])
AC_CHECK_TOOLS(CXX, [clang++ g++])
])])

AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
Expand Down
6 changes: 5 additions & 1 deletion nacl/GNUmakefile.in
Expand Up @@ -7,12 +7,16 @@ include Makefile
NACL_SDK_ROOT=@NACL_SDK_ROOT@
NACL_TOOLCHAIN=@NACL_TOOLCHAIN@
NACL_TOOLCHAIN_DIR=$(NACL_SDK_ROOT)/toolchain/$(NACL_TOOLCHAIN)
CXX=@CXX@

# Don't override CC/LD/etc if they are already set to absolute
# paths (this is the case when building in the naclports tree).
ifeq ($(dir $(CC)),./)
CC:=$(NACL_TOOLCHAIN_DIR)/bin/$(CC)
endif
ifeq ($(dir $(CXX)),./)
CXX:=$(NACL_TOOLCHAIN_DIR)/bin/$(CXX)
endif
ifeq ($(dir $(LD)),./)
LD:=$(NACL_TOOLCHAIN_DIR)/bin/$(LD)
endif
Expand Down Expand Up @@ -43,7 +47,7 @@ PPROGRAM_NMF=$(PPROGRAM:$(EXEEXT)=.nmf)

GNUmakefile: $(srcdir)/nacl/GNUmakefile.in
$(PPROGRAM): $(PROGRAM) pepper_main.$(OBJEXT)
$(Q)$(MAKE) $(MFLAGS) PROGRAM=$(PPROGRAM) MAINOBJ="pepper_main.$(OBJEXT)" LIBS="$(LIBS) $(PEPPER_LIBS)" program
$(Q)$(MAKE) $(MFLAGS) PROGRAM=$(PPROGRAM) MAINOBJ="pepper_main.$(OBJEXT)" LIBS="$(LIBS) $(PEPPER_LIBS)" CC="$(CXX)" program
$(PROGRAM_NMF) $(PPROGRAM_NMF): $(@:.nmf=$(EXEEXT)) nacl/create_nmf.rb

.PHONY: pprogram package show_naclflags
Expand Down

0 comments on commit f65e512

Please sign in to comment.