summaryrefslogtreecommitdiff
path: root/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch
blob: c4d0db2c0743ca05f6c605f8f73d0e77ab017983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From bb016afeba4d9e886e776565a508634a261111a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Wed, 31 Dec 2014 11:26:12 +0100
Subject: [PATCH] gentoo build fixes

---
 Makefile.config.in                      | 6 +++---
 Makefile.rules                          | 2 +-
 tools/llvm-config/BuildVariables.inc.in | 1 +
 tools/llvm-config/Makefile              | 2 ++
 tools/llvm-config/llvm-config.cpp       | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile.config.in b/Makefile.config.in
index d34a2d5..a26cd08 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -99,10 +99,10 @@ PROJ_internal_prefix := $(prefix)
 endif
 
 PROJ_bindir     := $(PROJ_prefix)/bin
-PROJ_libdir     := $(PROJ_prefix)/lib
+PROJ_libdir     := $(PROJ_prefix)/$(GENTOO_LIBDIR)
 PROJ_datadir    := $(PROJ_prefix)/share
-PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
-PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
+PROJ_docsdir    := $(PROJ_prefix)/share/doc/@PF@
+PROJ_etcdir     := @EPREFIX@/etc/llvm
 PROJ_includedir := $(PROJ_prefix)/include
 PROJ_infodir    := $(PROJ_prefix)/info
 PROJ_mandir     := $(PROJ_prefix)/share/man
diff --git a/Makefile.rules b/Makefile.rules
index c8c971f..d1258b1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -283,7 +283,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
   BuildMode := Release
   # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
   ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
-    OmitFramePointer := -fomit-frame-pointer
+    OmitFramePointer :=
   endif
 
   CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
index 3f51f49..513ea89 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
@@ -26,3 +26,4 @@
 #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_LIBDIR "@LLVM_LIBDIR@"
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index 1ff8b6f..5d73c6e 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
 	  >> temp.sed
 	$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
 	  >> temp.sed
+	$(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
+	  >> temp.sed
 	$(Verb) $(SED) -f temp.sed < $< > $@
 	$(Verb) $(RM) temp.sed
 
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 224035a..57180ac 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -265,7 +265,7 @@ int main(int argc, char **argv) {
     ActivePrefix = CurrentExecPrefix;
     ActiveIncludeDir = ActivePrefix + "/include";
     ActiveBinDir = ActivePrefix + "/bin";
-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+    ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
     ActiveIncludeOption = "-I" + ActiveIncludeDir;
   }
 
-- 
2.2.1