components/llvm/patches/023-Makefile.config.in.patch
changeset 5434 9f55c805ce9d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/llvm/patches/023-Makefile.config.in.patch	Wed Feb 10 11:54:12 2016 -0800
@@ -0,0 +1,48 @@
+# ${prefix/libdir must be set correctly for 64-bit builds.
+# We can't have $ORIGIN in RPATH/RUNPATH.
+# Not for upstream. The autoconf-based build system is removed in 3.8.X.
+--- Makefile.config.in	2016-02-02 09:12:17.972038970 -0800
++++ Makefile.config.in	2016-02-02 09:46:11.950055804 -0800
+@@ -13,6 +13,10 @@
+ #===------------------------------------------------------------------------===#
+ 
+ MACH = $(shell uname -p)
++MACH64=sparcv9
++ifeq ($(MACH),i386)
++  MACH64=amd64
++endif
+ 
+ # Define LLVM specific info and directories based on the autoconf variables
+ LLVMPackageName   := @PACKAGE_TARNAME@
+@@ -182,6 +186,10 @@
+ # Path to the nm program
+ NM_PATH = @NM@
+ 
++ifeq ($(findstring -m32,$(CXXFLAGS)),)
++  PROJ_libdir = $(PROJ_prefix)/lib/$(MACH64)
++endif
++
+ # The pathnames of the programs we require to build
+ CMP        := @CMP@
+ CP         := @CP@
+--- Makefile.rules	2016-02-02 09:59:19.111715578 -0800
++++ Makefile.rules	2016-02-02 11:51:02.057248471 -0800
+@@ -604,7 +604,7 @@
+ endif
+ 
+ ifdef SHARED_LIBRARY
+-ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
++ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW SunOS))
+ ifneq ($(HOST_OS),Darwin)
+   LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
+ else
+@@ -665,7 +665,9 @@
+   endif
+   ifneq ($(HOST_OS), Darwin)
+     ifdef TOOLNAME
++      ifneq ($(HOST_OS), $(filter $(HOST_OS), SunOS))
+       LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
++      endif
+       ifeq ($(HOST_OS), $(filter $(HOST_OS), SunOS))
+         LD.Flags += -Wl,-z -Wl,discard-unused=sections
+         LD.Flags += -Wl,-M -Wl,$(PROJ_SRC_ROOT)/mapfiles/map.gnu-sections