RHEL customization: disable clang, --enable-targets=host

This commit is contained in:
Adam Jackson 2011-12-05 17:44:54 -05:00
parent 9ff19058fe
commit 194b08ba83

View file

@ -10,12 +10,18 @@
%bcond_without ocaml %bcond_without ocaml
%endif %endif
%if 0%{?rhel} >= 7
%global with_clang 0
%else
%global with_clang 1
%endif
%global prerel rc3 %global prerel rc3
%global downloadurl http://llvm.org/%{?prerel:pre-}releases/%{version}%{?prerel:/%{prerel}} %global downloadurl http://llvm.org/%{?prerel:pre-}releases/%{version}%{?prerel:/%{prerel}}
Name: llvm Name: llvm
Version: 3.0 Version: 3.0
Release: 0.1.%{prerel}%{?dist} Release: 0.2.%{prerel}%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
Group: Development/Languages Group: Development/Languages
@ -99,6 +105,7 @@ Group: System Environment/Libraries
Shared libraries for the LLVM compiler infrastructure. Shared libraries for the LLVM compiler infrastructure.
%if %{with_clang}
%package -n clang %package -n clang
Summary: A C language family front-end for LLVM Summary: A C language family front-end for LLVM
License: NCSA License: NCSA
@ -151,6 +158,7 @@ Requires: %{name} = %{version}-%{release}
%description -n clang-doc %description -n clang-doc
Documentation for the Clang compiler front-end. Documentation for the Clang compiler front-end.
%endif
%if 0%{?_with_doxygen} %if 0%{?_with_doxygen}
@ -165,6 +173,7 @@ Requires: %{name}-doc = %{version}-%{release}
API documentation for the LLVM compiler infrastructure. API documentation for the LLVM compiler infrastructure.
%if %{with_clang}
%package -n clang-apidoc %package -n clang-apidoc
Summary: API documentation for Clang Summary: API documentation for Clang
Group: Development/Languages Group: Development/Languages
@ -175,6 +184,7 @@ Requires: clang-doc = %{version}-%{release}
%description -n clang-apidoc %description -n clang-apidoc
API documentation for the Clang compiler. API documentation for the Clang compiler.
%endif %endif
%endif
%if %{with ocaml} %if %{with ocaml}
@ -212,9 +222,11 @@ HTML documentation for LLVM's OCaml binding.
%prep %prep
%setup -q -n llvm-%{version}%{?prerel:%{prerel}.src} -a1 %{?_with_gcc:-a2} %setup -q -n llvm-%{version}%{?prerel:%{prerel}.src} %{?with_clang:-a1} %{?_with_gcc:-a2}
rm tools/clang rm -r -f tools/clang
%if %{with_clang}
mv clang-%{version}%{?prerel:%{prerel}.src} tools/clang mv clang-%{version}%{?prerel:%{prerel}.src} tools/clang
%endif
# llvm patches # llvm patches
%patch0 -p1 -b .timestamp %patch0 -p1 -b .timestamp
@ -240,6 +252,9 @@ mv clang-%{version}%{?prerel:%{prerel}.src} tools/clang
--datadir=%{_libdir}/%{name} \ --datadir=%{_libdir}/%{name} \
%if 0%{?_with_doxygen} %if 0%{?_with_doxygen}
--enable-doxygen \ --enable-doxygen \
%endif
%if 0%{?rhel} >= 7
--enable-targets=host \
%endif %endif
--disable-assertions \ --disable-assertions \
--enable-debug-runtime \ --enable-debug-runtime \
@ -292,6 +307,7 @@ cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
%{_libdir}/llvm %{_libdir}/llvm
EOF EOF
%if %{with_clang}
# Static analyzer not installed by default: # Static analyzer not installed by default:
# http://clang-analyzer.llvm.org/installation#OtherPlatforms # http://clang-analyzer.llvm.org/installation#OtherPlatforms
mkdir -p %{buildroot}%{_libdir}/clang-analyzer mkdir -p %{buildroot}%{_libdir}/clang-analyzer
@ -302,7 +318,7 @@ done
(cd tools/clang/tools && cp -pr scan-{build,view} \ (cd tools/clang/tools && cp -pr scan-{build,view} \
%{buildroot}%{_libdir}/clang-analyzer/) %{buildroot}%{_libdir}/clang-analyzer/)
%endif
# Move documentation back to build directory # Move documentation back to build directory
# #
@ -318,11 +334,13 @@ mv tools/clang/docs/doxygen/html clang-apidoc
# And prepare Clang documentation # And prepare Clang documentation
# #
%if %{with_clang}
mkdir clang-docs mkdir clang-docs
for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do
ln tools/clang/$f clang-docs/ ln tools/clang/$f clang-docs/
done done
rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools} rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
%endif
#find %%{buildroot} -name .dir -print0 | xargs -0r rm -f #find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
@ -356,6 +374,7 @@ make check LIT_ARGS="-v -j4" \
%{nil} %{nil}
%endif %endif
%if %{with_clang}
# clang test suite failing on PPC and s390(x) # clang test suite failing on PPC and s390(x)
make -C tools/clang/test TESTARGS="-v -j4" \ make -C tools/clang/test TESTARGS="-v -j4" \
%ifarch ppc ppc64 s390 s390x %ifarch ppc ppc64 s390 s390x
@ -363,14 +382,16 @@ make -C tools/clang/test TESTARGS="-v -j4" \
%else %else
%{nil} %{nil}
%endif %endif
%endif
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
%post -n clang -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%if %{with_clang}
%post -n clang -p /sbin/ldconfig
%postun -n clang -p /sbin/ldconfig %postun -n clang -p /sbin/ldconfig
%endif
%posttrans devel %posttrans devel
@ -402,7 +423,9 @@ exit 0
%{_bindir}/llvm* %{_bindir}/llvm*
%{_bindir}/macho-dump %{_bindir}/macho-dump
%{_bindir}/opt %{_bindir}/opt
%if %{with_clang}
%exclude %{_mandir}/man1/clang.1.* %exclude %{_mandir}/man1/clang.1.*
%endif
%doc %{_mandir}/man1/*.1.* %doc %{_mandir}/man1/*.1.*
%files devel %files devel
@ -416,9 +439,12 @@ exit 0
%defattr(-,root,root,-) %defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%if %{with_clang}
%exclude %{_libdir}/%{name}/libclang.so %exclude %{_libdir}/%{name}/libclang.so
%endif
%{_libdir}/%{name}/*.so %{_libdir}/%{name}/*.so
%if %{with_clang}
%files -n clang %files -n clang
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc clang-docs/* %doc clang-docs/*
@ -442,6 +468,7 @@ exit 0
%files -n clang-doc %files -n clang-doc
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc tools/clang/docs/* %doc tools/clang/docs/*
%endif
%files doc %files doc
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -470,13 +497,17 @@ exit 0
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc apidoc/* %doc apidoc/*
%if %{with_clang}
%files -n clang-apidoc %files -n clang-apidoc
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc clang-apidoc/* %doc clang-apidoc/*
%endif %endif
%endif
%changelog %changelog
* Mon Dec 05 2011 Adam Jackson <ajax@redhat.com> 3.0-0.2.rc3
- RHEL customization: disable clang, --enable-targets=host
* Fri Nov 11 2011 Michel Salim <salimma@fedoraproject.org> - 3.0-0.1.rc3 * Fri Nov 11 2011 Michel Salim <salimma@fedoraproject.org> - 3.0-0.1.rc3
- Update to 3.0rc3 - Update to 3.0rc3