Browse Source

llvm: update to 2.9

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@4656 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 13 years ago
parent
commit
c46dce22ef
1 changed files with 116 additions and 35 deletions
  1. 116 35
      l/llvm/llvm-vl.spec

+ 116 - 35
l/llvm/llvm-vl.spec

@@ -4,7 +4,7 @@
 #   The doxygen docs are HUGE, so they are not built by default.
 
 Name:           llvm
-Version:        2.7
+Version:        2.9
 Release:        1%{?_dist_release}
 Summary:        The Low Level Virtual Machine
 Summary(ja):    LLVM - 低レベルバーチャルマシン
@@ -14,8 +14,15 @@ License:        NCSA
 URL:            http://llvm.org/
 Source0:        http://llvm.org/releases/%{version}/llvm-%{version}.tgz
 Source1:        http://llvm.org/releases/%{version}/clang-%{version}.tgz
+# multilib fixes
+Source2:        llvm-Config-config.h
+Source3:        llvm-Config-llvm-config.h
+
 # Data files should be installed with timestamps preserved
 Patch0:         llvm-2.6-timestamp.patch
+# clang link failure if system GCC version is unknown
+# http://llvm.org/bugs/show_bug.cgi?id=8897
+Patch1:         clang-2.9-add_gcc_vers.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
@@ -24,6 +31,7 @@ BuildRequires:  chrpath
 BuildRequires:  flex
 BuildRequires:  gcc-c++ >= 3.4
 BuildRequires:  groff
+BuildRequires:  libffi-devel
 BuildRequires:  libtool-ltdl-devel
 BuildRequires:  ocaml
 # for DejaGNU test suite
@@ -31,6 +39,7 @@ BuildRequires:  dejagnu tcl python
 %if %{?_with_doxygen:1}%{!?_with_doxygen:0}
 BuildRequires:  doxygen graphviz
 %endif
+Requires:       llvm-libs = %{version}-%{release}
 
 # LLVM is not supported on PPC64
 # http://llvm.org/bugs/show_bug.cgi?id=3729
@@ -50,6 +59,7 @@ Summary(ja):    LLVM のライブラリおよびヘッダファイル
 Group:          Development/Languages
 Requires:       %{name} = %{version}-%{release}
 Requires:       libstdc++-devel
+Requires:       libffi-devel
 Provides:       llvm-static = %{version}-%{release}
 
 
@@ -68,6 +78,15 @@ Requires:       %{name} = %{version}-%{release}
 Documentation for the LLVM compiler infrastructure.
 
 
+%package libs
+Summary:        LLVM shared libraries
+Summary(ja):    LLVM シェアードライブラリ
+Group:          System Environment/Libraries
+
+%description libs
+Shared libraries for the LLVM compiler infrastructure.
+
+
 %package -n clang
 Summary:        A C language family front-end for LLVM
 Summary(ja):    LLVM の C 言語用フロントエンド
@@ -174,30 +193,45 @@ HTML documentation for LLVM's OCaml binding.
 %setup -q -n llvm-%{version} -a1 %{?_with_gcc:-a2}
 mv clang-%{version} tools/clang
 
+# llvm patches
 %patch0 -p1 -b .timestamp
 
+# clang patches
+pushd tools/clang
+%patch1 -p1 -b .add_gcc_ver
+popd
+
 # Encoding fix
-(cd tools/clang/docs && \
-    iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
-    -o BlockImplementation.txt)
+#(cd tools/clang/docs && \
+#    iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
+#    -o BlockImplementation.txt)
 
 
 %build
 # Disabling assertions now, rec. by pure and needed for OpenGTL
 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
-mkdir obj && cd obj
-../configure \
+%configure \
   --prefix=%{_prefix} \
   --libdir=%{_libdir}/%{name} \
+  --datadir=%{_libdir}/%{name} \
   --disable-assertions \
   --enable-jit \
-  --enable-shared
+  --enable-libffi \
+  --enable-shared \
+  --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
+      -maxdepth 0 -type d)/include \
+%if %{__isa_bits} == 64
+  --with-cxx-include-32bit-dir=32 \
+%endif
+  --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
+  --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os}
+  
 
 # FIXME file this
 # configure does not properly specify libdir
 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
 
-make %{_smp_mflags} \
+make %{_smp_mflags} REQUIRES_RTTI=1 \
 %ifarch ppc
   OPTIMIZE_OPTION="%{optflags} -fno-var-tracking-assignments"
 %else
@@ -205,20 +239,19 @@ make %{_smp_mflags} \
 %endif
 
 
-%check
-cd obj
-# no current unexpected failures. Use || true if they recur to force ignore
-make check 2>&1 | tee ../llvm-testlog.txt
-(cd tools/clang && make test 2>&1) | tee ../clang-testlog.txt
-
-
 %install
 rm -rf %{buildroot}
-pushd obj
-chmod -x examples/Makefile
-
 make install DESTDIR=%{buildroot} \
      PROJ_docsdir=/moredocs
+
+# multilib fixes
+mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
+
+pushd %{buildroot}%{_includedir}/llvm/Config
+mv config.h config-%{__isa_bits}.h
+cp -p %{SOURCE2} config.h
+mv llvm-config.h llvm-config-%{__isa_bits}.h
+cp -p %{SOURCE3} llvm-config.h
 popd
 
 # Create ld.so.conf.d entry
@@ -242,8 +275,14 @@ done
 # Move documentation back to build directory
 # 
 mv %{buildroot}/moredocs .
-rm moredocs/*.tar.gz
-rm moredocs/ocamldoc/html/*.tar.gz
+rm -f moredocs/*.tar.gz
+rm -f moredocs/ocamldoc/html/*.tar.gz
+
+# and separate the apidoc
+%if 0%{?_with_doxygen}
+mv moredocs/html/doxygen apidoc
+mv tools/clang/docs/doxygen/html clang-apidoc
+%endif
 
 # And prepare Clang documentation
 #
@@ -254,17 +293,17 @@ done
 rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
 
 
-#find %{buildroot} -name .dir -print0 | xargs -0r rm -f
+#find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
 file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
 file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
-#chrpath -d %{buildroot}/%{_libexecdir}/clang-cc
+#chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
 
 # Get rid of erroneously installed example files.
 rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
 
 # FIXME file this bug
 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
-  %{buildroot}%{_bindir}/llvm-config
+  %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
 
 chmod -x %{buildroot}%{_libdir}/%{name}/*.a
 
@@ -273,43 +312,77 @@ chmod -x %{buildroot}%{_libdir}/%{name}/*.a
 find examples -name 'Makefile' | xargs -0r rm -f
 
 
+%check
+make check 2>&1 | tee ../llvm-testlog.txt
+make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
+
+
 %clean
 rm -rf %{buildroot}
 
 
-%post -p /sbin/ldconfig
+%post libs -p /sbin/ldconfig
+%post -n clang -p /sbin/ldconfig
 
 
-%postun -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+%postun -n clang -p /sbin/ldconfig
+
+
+%posttrans devel
+# link llvm-config to the platform-specific file;
+# use ISA bits as priority so that 64-bit is preferred
+# over 32-bit if both are installed
+alternatives \
+  --install \
+  %{_bindir}/llvm-config \
+  llvm-config \
+  %{_bindir}/llvm-config-%{__isa_bits} \
+  %{__isa_bits}
+
+%postun devel
+if [ $1 -eq 0 ]; then
+  alternatives --remove llvm-config \
+    %{_bindir}/llvm-config-%{__isa_bits}
+fi
+exit 0
 
 
 %files
 %defattr(-,root,root,-)
-%doc CREDITS.TXT LICENSE.TXT README.txt llvm-testlog.txt
+%doc CREDITS.TXT LICENSE.TXT README.txt
 %{_bindir}/bugpoint
 %{_bindir}/llc
 %{_bindir}/lli
-%exclude %{_bindir}/llvm-config
+%exclude %{_bindir}/llvm-config-%{__isa_bits}
 %{_bindir}/llvm*
+%{_bindir}/macho-dump
 %{_bindir}/opt
-%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
-%dir %{_libdir}/llvm
-%{_libdir}/llvm/*.so
 %exclude %{_mandir}/man1/clang.1.*
+%exclude %{_mandir}/man1/llvmg??.1.*
 %doc %{_mandir}/man1/*.1.*
 
 %files devel
 %defattr(-,root,root,-)
-%{_bindir}/llvm-config
+%{_bindir}/llvm-config-%{__isa_bits}
 %{_includedir}/%{name}
 %{_includedir}/%{name}-c
 %{_libdir}/%{name}/*.a
 
+%files libs
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
+%dir %{_libdir}/%{name}
+%exclude %{_libdir}/%{name}/libclang.so
+%{_libdir}/%{name}/*.so
+
 %files -n clang
 %defattr(-,root,root,-)
-%doc clang-docs/* clang-testlog.txt
+%doc clang-docs/*
 %{_bindir}/clang*
+#%{_bindir}/c-index-test
 %{_bindir}/tblgen
+%{_libdir}/%{name}/libclang.so
 %{_prefix}/lib/clang
 %doc %{_mandir}/man1/clang.1.*
 
@@ -347,15 +420,23 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %doc moredocs/ocamldoc/html/*
 
-%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
+%if 0%{?_with_doxygen}
 %files apidoc
 %defattr(-,root,root,-)
-%doc docs/doxygen
-%endif
+%doc apidoc/*
 
+%files -n clang-apidoc
+%defattr(-,root,root,-)
+%doc clang-apidoc/*
+%endif
 
 
 %changelog
+* Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
+- new upstream release
+- add BR: libffi-devel
+- add R: libffi-devel to -devel
+
 * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
 - initial build for Vine Linux