fix install dir 60/147960/1
authorCHUNSEOK LEE <chunseok.lee@samsung.com>
Mon, 4 Sep 2017 09:01:01 +0000 (18:01 +0900)
committerCHUNSEOK LEE <chunseok.lee@samsung.com>
Wed, 6 Sep 2017 06:25:18 +0000 (15:25 +0900)
Change-Id: Ie0dbd5698efbe8f79274bdab110f82b11ed17e6c

packaging/llvm.spec

index c8a5b3e..09ed1a3 100644 (file)
@@ -17,7 +17,7 @@ BuildRequires: python-devel
 #BuildRequires: swig
 Requires: libllvm = %{version}-%{release}
 
-%define install_prefix /usr/local
+%define install_prefix /usr
 %define sdk_install_prefix /home/owner/share/tmp/sdk_tools/lldb
 %define sdk_bin_dir %{sdk_install_prefix}/bin
 
@@ -32,6 +32,26 @@ Requires: libllvm = %{version}-%{release}
 %endif
 
 
+%ifarch armv7l
+%define ARCH armv7l
+%define ABI eabi
+%endif
+%ifarch armv7hl
+%define ARCH armv7hl
+%define ABI eabihf
+%endif
+%ifarch %ix86
+%define ARCH i586
+%endif
+%ifarch x86_64
+%define ARCH x86_64
+%endif
+%ifarch aarch64
+%define ARCH aarch64
+%endif
+%define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
+
+
 %description
 LLVM is a compiler infrastructure designed for compile-time, link-time, runtime,
 and idle-time optimization of programs from arbitrary programming languages.
@@ -123,7 +143,6 @@ cd ..
 
 mkdir build
 cd build
-%ifnarch aarch64
 cmake \
     -DCMAKE_C_COMPILER=/usr/bin/gcc \
     -DCMAKE_CXX_COMPILER=/usr/bin/g++ \
@@ -134,37 +153,26 @@ cmake \
     -DLLVM_BUILD_LLVM_DYLIB=1 \
     -DLLDB_DISABLE_LIBEDIT=1 \
     -DLLDB_DISABLE_PYTHON=1 \
-%ifarch x86_64
+    -DLLVM_TARGET_ARCH=%{ARCH} \
+    -DLLVM_HOST_TRIPLE=%{host_arch} \
+    -DLLDB_DISABLE_CURSES=1 \
+%ifarch x86_64 aarch64
     -DLLVM_LIBDIR_SUFFIX=64 \
 %endif
 %ifarch %ix86
-     -DCMAKE_LIBRARY_ARCHITECTURE=i386-linux-gnu \
-     -DLLVM_TARGET_ARCH=X86 \
-     -DLLVM_HOST_TRIPLE=i386-linux-gnu \
-     -DCMAKE_C_FLAGS="-m32" \
-     -DCMAKE_CXX_FLAGS="-m32" \
+    -DCMAKE_C_FLAGS="-m32" \
+    -DCMAKE_CXX_FLAGS="-m32" \
 %endif
-    -DLLDB_DISABLE_CURSES=1 \
     ..
-%else
-cmake \
-    -DCMAKE_C_COMPILER=/usr/bin/gcc \
-    -DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=%{install_prefix} \
-    -DLLVM_ENABLE_ASSERTIONS=No \
-    -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64' \
-    -DLLVM_BUILD_LLVM_DYLIB=1 \
-    -DLLVM_LIBDIR_SUFFIX=64 \
-    ..
-%endif
 
 make %{?jobs:-j%jobs}
 
 %install
 cd build
 %make_install
+ln -sf %{install_prefix}/bin/clang++ %{buildroot}%{install_prefix}/bin/clang++-3.8
 
+mkdir -p %{buildroot}%{bindir}
 # copy lldb for sdk
 mkdir -p %{buildroot}%{sdk_bin_dir}
 mkdir -p %{buildroot}%{sdk_lib_dir}
@@ -277,6 +285,7 @@ echo Cleaning %{buildroot}
 %{install_prefix}/bin/clang
 %{install_prefix}/bin/clang++
 %{install_prefix}/bin/clang-3.8
+%{install_prefix}/bin/clang++-3.8
 %{install_prefix}/bin/clang-check
 %{install_prefix}/bin/clang-cl
 %{install_prefix}/bin/clang-format