SHA256
1
0
forked from pool/llvm

- Update to use cmake buildsystem

- Remove unmaintained ocaml support

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=27
This commit is contained in:
Ismail Dönmez
2011-05-29 16:36:18 +00:00
committed by Git OBS Bridge
parent d3c1db314d
commit 8eb4986690
6 changed files with 65 additions and 2374 deletions

11
clang-cmake-lib.patch Normal file
View File

@@ -0,0 +1,11 @@
--- tools/clang/tools/libclang/CMakeLists.txt (revision 132071)
+++ tools/clang/tools/libclang/CMakeLists.txt (working copy)
@@ -33,7 +33,7 @@
set_target_properties(libclang
PROPERTIES
- OUTPUT_NAME "libclang"
+ OUTPUT_NAME "clang"
VERSION ${LIBCLANG_LIBRARY_VERSION}
DEFINE_SYMBOL _CINDEX_LIB_)

View File

@@ -1,12 +0,0 @@
diff -Nur llvm-2.7-orig/bindings/ocaml/Makefile.ocaml llvm-2.7/bindings/ocaml/Makefile.ocaml
--- llvm-2.7-orig/bindings/ocaml/Makefile.ocaml 2010-07-25 14:27:11.996652508 +0200
+++ llvm-2.7/bindings/ocaml/Makefile.ocaml 2010-07-25 14:28:31.082402281 +0200
@@ -165,7 +165,7 @@
install-deplibs:
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
- ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
+ ln -sf "${OVERRIDE_libdir}/$$i" "$(PROJ_libocamldir)/$$i"; \
done
uninstall-deplibs:

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun May 29 16:34:46 UTC 2011 - idonmez@novell.com
- Update to use cmake buildsystem
- Remove unmaintained ocaml support
-------------------------------------------------------------------
Thu May 26 11:01:57 UTC 2011 - idonmez@novell.com

160
llvm.spec
View File

@@ -17,9 +17,6 @@
# norootforbuild
%bcond_with doxygen
%bcond_with ocaml
%define _sharedir %{_prefix}/share
%define _revision 132050
@@ -38,9 +35,10 @@ Group: Development/Languages/Other
Url: http://www.llvm.org
Source0: %{name}-%{version}.tar.xz
Source100: %{name}-rpmlintrc
Patch0: llvm-2.4-fix-ocaml.patch
# http://llvm.org/bugs/show_bug.cgi?id=8214
Patch1: llvm-2.8-doxygen.patch
# PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Allow us to set revision
Patch1: set-revision.patch
# PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Use correct lib prefix
Patch2: clang-cmake-lib.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf automake bison cmake flex gcc gcc-c++
@@ -48,12 +46,6 @@ BuildRequires: chrpath groff libtool python-devel
BuildRequires: dejagnu tcl-devel tk-devel
BuildRequires: fdupes
BuildRequires: xz
%if %{with doxygen}
BuildRequires: cairo doxygen freefont gd graphviz graphviz-gd zip
%endif
%if %{with ocaml}
BuildRequires: ocaml ocaml-facile ocaml-ocamldoc
%endif
# Code10 does not have libffi
%if 0%{?suse_version} > 1100
@@ -92,16 +84,6 @@ AutoReqProv: on
%description doc
Documentation for the LLVM compiler infrastructure.
%if %{with doxygen}
%package apidoc
Summary: API documentation for LLVM
Group: Documentation/HTML
%description apidoc
API documentation for the LLVM compiler infrastructure.
%endif
%package clang
Summary: CLANG frontend for LLVM
Group: Development/Languages/Other
@@ -123,28 +105,6 @@ AutoReqProv: on
This package contains the clang (C language) frontend for LLVM.
(development files)
%if %{with ocaml}
%package ocaml
Summary: OCaml Binding for LLVM
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: ocaml
AutoReqProv: on
%description ocaml
This package contains the OCaml binding for LLVM.
%package ocaml-devel
Summary: Development Files for llvm-ocaml
Group: Development/Libraries/Other
Requires: %{name}-devel = %{version}-%{release}
Requires: %{name}-ocaml = %{version}-%{release}
%description ocaml-devel
The llvm-ocaml-devel package contains libraries and signature files
for developing applications that use llvm-ocaml.
%endif
%package vim-plugins
Summary: Vim plugins for LLVM
Group: Productivity/Text/Editors
@@ -156,72 +116,58 @@ This package contains vim plugins for LLVM like syntax highlighting.
%prep
%setup -q
sed -i s,'$(SVN_REVISION)',%{_revision}, tools/clang/lib/Basic/Makefile
%patch0 -p1
pushd docs
%patch1 -p0
popd
%patch1
%patch2
sed -i s,SVN_REVISION,\"%{_revision}\",g tools/clang/lib/Basic/Version.cpp
%build
# Enable rtti
# http://llvm.org/docs/Packaging.html
export REQUIRES_RTTI=1
TOPLEVEL=$PWD
mkdir stage1 stage2
cd stage1
../configure --enable-assertions \
--enable-optimized
make %{_smp_mflags} clang-only
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_ENABLE_ASSERTIONS=TRUE \
..
make %{?_smp_mflags}
cd ../stage2
export CC=$TOPLEVEL/stage1/Release+Asserts/bin/clang
export CXX=$TOPLEVEL/stage1/Release+Asserts/bin/clang++
# Needed to make clang resource dir working inside build tree
ln -s lib lib64
../configure --prefix=%{_prefix} \
--libdir=%{_libdir}/%{name} \
--datadir=%{_datadir}/%{name} \
--enable-assertions \
--enable-jit \
--enable-optimized \
--enable-pic \
--enable-timestamps=no \
--with-c-include-dirs=/usr/include:\
%{_libdir}/gcc/%{_target_cpu}-suse-linux/%{_gcc_ver}/include:\
%{_libdir}/gcc/%{_target_cpu}-suse-linux/%{_gcc_ver}/include-fixed
export CC=$TOPLEVEL/stage1/bin/clang
export CXX=$TOPLEVEL/stage1/bin/clang++
%if %{with doxygen}
--enable-doxygen \
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_ENABLE_ASSERTIONS=TRUE \
-DLLVM_ENABLE_PIC=TRUE \
-DLLVM_ENABLE_TIMESTAMPS=FALSE \
-DCLANG_VENDOR="SUSE Linux" \
%ifarch x86_64
-DLLVM_LIBDIR_SUFFIX=64 \
%endif
make %{?_smp_mflags} KEEP_SYMBOLS=1
-DCLANG_RESOURCE_DIR="../%{_lib}/clang/%{_release_version}" \
-DC_INCLUDE_DIRS="/usr/include:\
%{_libdir}/gcc/%{_target_cpu}-suse-linux/%{_gcc_ver}/include:\
%{_libdir}/gcc/%{_target_cpu}-suse-linux/%{_gcc_ver}/include-fixed" \
..
make %{?_smp_mflags}
%check
cd stage2
make check
cd tools/clang
make test
make clang-test
%install
cd stage2
%makeinstall DESTDIR=%{buildroot} \
PROJ_etcdir=%{_sysconfdir}/%{name} \
PROJ_libdir=%{_libdir}/%{name} \
PROJ_docsdir=%{_docdir}/%{name}-doc \
OVERRIDE_libdir=%{_libdir}/%{name} \
KEEP_SYMBOLS=1
%makeinstall
cd ..
# cleanup
file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
file %{buildroot}/%{_libdir}/%{name}/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
# And OCaml .o files
# %%__rm %%{buildroot}%%{_libdir}/ocaml/*.o
find %{buildroot}%{_includedir}/clang -name '*.tmp' -exec rm {} +
# Adjust library path
@@ -233,24 +179,12 @@ for file in `find examples -type f`; do
install -m 644 $file %{buildroot}%{_docdir}/%{name}-doc/$file
done
%if %{with doxygen}
# Move api-doc so fdupes can filter the duplicates
%__install -dm 755 %{buildroot}%{_docdir}/%{name}-apidoc
%__mv %{buildroot}%{_docdir}/%{name}-doc/html/doxygen \
%{buildroot}%{_docdir}/%{name}-apidoc
%endif
find %{buildroot}%{_docdir}/%{name}-doc/ -name '*.tar.gz' -exec rm {} \;
chmod -x %{buildroot}%{_libdir}/%{name}/*.[oa]
%if %{with ocaml}
chmod -x %{buildroot}%{_libdir}/ocaml/libllvm*a
%endif
install -d %{buildroot}%{py_sitedir}
#mv %%{buildroot}%%{_bindir}/ccclib %%{buildroot}%%{py_sitedir}
# install scan-build et al
install -d %{buildroot}%{_sharedir}/clang
install -d %{buildroot}%{py_sitedir}
pushd tools/clang/tools
for file in scan-build/ccc-analyzer scan-build/scan-build \
scan-view/scan-view; do
@@ -296,9 +230,6 @@ mv utils/vim/README utils/vim/README.vim
%fdupes -s %{buildroot}%{_docdir}/%{name}
%fdupes -s %{buildroot}%{_docdir}/%{name}-doc
%if %{with doxygen}
%fdupes -s %{buildroot}%{_docdir}/%{name}-apidoc
%endif
%post -p /sbin/ldconfig
@@ -325,6 +256,7 @@ mv utils/vim/README utils/vim/README.vim
%files clang
%defattr(-,root,root)
%{_bindir}/clang
%{_bindir}/clang-*
%{_bindir}/clang++
%{_bindir}/tblgen
%{_bindir}/ccc-analyzer
@@ -338,11 +270,6 @@ mv utils/vim/README utils/vim/README.vim
%{_sharedir}/clang
%{_mandir}/man1/clang.1.gz
%{_mandir}/man1/tblgen.1.gz
# rpmlint complains that these files should go
# into a -devel package. They are integral part
# of clang, so I don't think this is right.
# Similarly, for gcc they are not part of a gcc-devel
# package either. What's the right way to proceed?
%dir %{_prefix}/lib/clang
%dir %{_prefix}/lib/clang/*
%dir %{_prefix}/lib/clang/*/include
@@ -387,29 +314,10 @@ mv utils/vim/README utils/vim/README.vim
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*
%if %{with ocaml}
%files ocaml
%defattr(-,root,root,-)
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/*.cmi
%files ocaml-devel
%defattr(-,root,root,-)
%{_libdir}/ocaml/*.a
%{_libdir}/ocaml/*.cmx*
%{_libdir}/ocaml/*.mli
%endif
%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}-doc
%if %{with doxygen}
%files apidoc
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-apidoc
%endif
%files vim-plugins
%defattr(-,root,root,-)
%doc utils/vim/README.vim

14
set-revision.patch Normal file
View File

@@ -0,0 +1,14 @@
--- tools/clang/lib/Basic/Version.cpp (revision 131788)
+++ tools/clang/lib/Basic/Version.cpp (working copy)
@@ -50,11 +50,7 @@
}
std::string getClangRevision() {
-#ifdef SVN_REVISION
return SVN_REVISION;
-#else
- return "";
-#endif
}
std::string getClangFullRepositoryVersion() {