summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 20:35:45 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 20:35:45 +0000
commit79f3f56b150582e8fd176b090cbe72d9598784a0 (patch)
treefa0bd6bffc8601322948d2ad99a9f46716252380 /native_client_sdk
parentd0f03f0ac25862d07fdf6911a52afe85bb6c2eb7 (diff)
downloadchromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.zip
chromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.tar.gz
chromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.tar.bz2
[NaCl SDK] Remove NACL_ARCH from commom makefiles.
This macro was only used by one example, but was appearing on the compile line for all examples. Also, it can be detected more empirically at compile time using GCC's builtins. R=binji@chromium.org BUG=None Review URL: https://codereview.chromium.org/15974011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc14
-rw-r--r--native_client_sdk/src/tools/host_vc.mk8
-rw-r--r--native_client_sdk/src/tools/nacl_gcc.mk13
3 files changed, 21 insertions, 14 deletions
diff --git a/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc b/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
index 7d13a10..9291464 100644
--- a/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
+++ b/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
@@ -23,9 +23,15 @@
#define CONFIG_NAME "Release"
#endif
-#define XSTRINGIFY(x) STRINGIFY(x)
-#define STRINGIFY(x) #x
-#define NACL_ARCH_STRING XSTRINGIFY(NACL_ARCH)
+#if defined __arm__
+#define NACL_ARCH "arm"
+#elif defined __i686__
+#define NACL_ARCH "x86_32"
+#elif defined __x86_64__
+#define NACL_ARCH "x86_64"
+#else
+#error "Unknown arch"
+#endif
class DlOpenInstance : public pp::Instance {
public:
@@ -66,7 +72,7 @@ class DlOpenInstance : public pp::Instance {
// dlclose, which would close the shared object and unload it from memory.
void LoadLibrary() {
const char reverse_so_path[] =
- "/http/glibc/" CONFIG_NAME "/libreverse_" NACL_ARCH_STRING ".so";
+ "/http/glibc/" CONFIG_NAME "/libreverse_" NACL_ARCH ".so";
const int32_t IMMEDIATELY = 0;
eightball_so_ = dlopen("libeightball.so", RTLD_LAZY);
reverse_so_ = dlopen(reverse_so_path, RTLD_LAZY);
diff --git a/native_client_sdk/src/tools/host_vc.mk b/native_client_sdk/src/tools/host_vc.mk
index 945fee3..d41629b 100644
--- a/native_client_sdk/src/tools/host_vc.mk
+++ b/native_client_sdk/src/tools/host_vc.mk
@@ -27,13 +27,13 @@ $(error Unable to find cl.exe in PATH while building Windows host build)
endif
-ifeq ('Debug','$(CONFIG)')
-WIN_OPT_FLAGS ?= /Od /MTd /Z7 -D NACL_SDK_DEBUG
-else
+ifeq ($(CONFIG),Release)
WIN_OPT_FLAGS ?= /O2 /MT /Z7
+else
+WIN_OPT_FLAGS ?= /Od /MTd /Z7 -DNACL_SDK_DEBUG
endif
-WIN_FLAGS ?= -D WIN32 -D _WIN32 -D PTW32_STATIC_LIB
+WIN_FLAGS ?= -DWIN32 -D_WIN32 -DPTW32_STATIC_LIB
#
diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk
index 1460637..a68d230 100644
--- a/native_client_sdk/src/tools/nacl_gcc.mk
+++ b/native_client_sdk/src/tools/nacl_gcc.mk
@@ -47,13 +47,14 @@ ARM_NM ?= $(TC_PATH)/$(OSNAME)_arm_$(TOOLCHAIN)/bin/arm-nacl-nm
# Architecture-specific flags
-X86_32_CFLAGS ?= -DNACL_ARCH=x86_32
-X86_64_CFLAGS ?= -DNACL_ARCH=x86_64
-ARM_CFLAGS ?= -DNACL_ARCH=arm
+X86_32_CFLAGS ?=
+X86_64_CFLAGS ?=
+ARM_CFLAGS ?=
+
+X86_32_CXXFLAGS ?=
+X86_64_CXXFLAGS ?=
+ARM_CXXFLAGS ?=
-X86_32_CXXFLAGS ?= -DNACL_ARCH=x86_32
-X86_64_CXXFLAGS ?= -DNACL_ARCH=x86_64
-ARM_CXXFLAGS ?= -DNACL_ARCH=arm
#
# Compile Macro