Index: Makefile.standalone |
diff --git a/Makefile.standalone b/Makefile.standalone |
index 095e8f1dfe728244636b61c777a26ac743d7d32f..695c8640d89c5b6e010f4385f4828932402ef68e 100644 |
--- a/Makefile.standalone |
+++ b/Makefile.standalone |
@@ -2,9 +2,14 @@ |
# and how you built LLVM & Clang. They can be overridden in a command-line |
# invocation of make, like: |
# |
-# make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> ... |
+# make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
+# LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
# |
+# Must setup in environment: |
+# LD_LIBRARY_PATH := $(LIBCXX_INSTALL_PATH)/lib |
+ |
+ |
# LLVM_SRC_PATH is the path to the root of the checked out source code. This |
# directory should contain the configure script, the include/ and lib/ |
# directories of LLVM, Clang in tools/clang/, etc. |
@@ -18,12 +23,20 @@ LLVM_SRC_PATH ?= ../llvm |
LLVM_BIN_PATH ?= $(shell readlink -e \ |
../../out/llvm_i686_linux_work/Release+Asserts/bin) |
+# LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should |
+# contain header files and corresponding libraries |
+LIBCXX_INSTALL_PATH ?= $(shell readlink -e \ |
+ ../../../toolchain/linux_x86/pnacl_newlib/host_x86_32) |
+ |
+# CLANG_PATH is the location of the clang compiler to use. |
+CLANG_PATH ?= ../../../../third_party/llvm-build/Release+Asserts/bin |
Karl
2014/09/15 19:08:06
I also changed this to use $(shell readlink -e ...
|
+ |
HOST_ARCH ?= x86 |
ifeq ($(HOST_ARCH),x86_64) |
- HOST_FLAGS = -m64 |
+ HOST_FLAGS = -m64 -stdlib=libc++ |
else |
ifeq ($(HOST_ARCH),x86) |
- HOST_FLAGS = -m32 |
+ HOST_FLAGS = -m32 -stdlib=libc++ |
endif |
endif |
@@ -39,12 +52,12 @@ LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ |
# It's recommended that CXX matches the compiler you used to build LLVM itself. |
OPTLEVEL := -O0 |
-CXX := g++ |
+CXX := $(CLANG_PATH)/clang++ |
CXXFLAGS := $(LLVM_CXXFLAGS) -Wall -Wextra -Werror -fno-rtti \ |
-fno-exceptions $(OPTLEVEL) -g $(HOST_FLAGS) \ |
- -Wno-error=unused-parameter |
-LDFLAGS := $(HOST_FLAGS) |
+ -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
+LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib |
SRCS= \ |
IceCfg.cpp \ |
@@ -74,7 +87,8 @@ all: llvm2ice |
.PHONY: all |
llvm2ice: $(OBJS) |
- $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl |
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ |
+ -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
# TODO: Be more precise than "*.h" here and elsewhere. |
$(OBJS): build/%.o: src/%.cpp src/*.h src/*.def |