From 03bad00517a7af885add1bbc48fecd83df60c8fd Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Fri, 12 Dec 2008 05:46:36 +0000 Subject: [PATCH] LLVM 2.4 --- .cvsignore | 2 +- llvm-2.4-fix-ocaml.patch | 11 +++ llvm.spec | 169 ++++++++++++++++++++++++++------------- sources | 2 +- 4 files changed, 126 insertions(+), 58 deletions(-) create mode 100644 llvm-2.4-fix-ocaml.patch diff --git a/.cvsignore b/.cvsignore index 07c17b1..b0bebc4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -llvm-2.3.tar.gz +llvm-2.4.tar.gz diff --git a/llvm-2.4-fix-ocaml.patch b/llvm-2.4-fix-ocaml.patch new file mode 100644 index 0000000..9c90bff --- /dev/null +++ b/llvm-2.4-fix-ocaml.patch @@ -0,0 +1,11 @@ +--- llvm-2.4/bindings/ocaml/Makefile.ocaml.ocaml-symlinks 2008-03-10 12:15:32.000000000 -0400 ++++ llvm-2.4/bindings/ocaml/Makefile.ocaml 2008-12-02 16:29:01.000000000 -0500 +@@ -160,7 +160,7 @@ + + install-deplibs: + $(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: diff --git a/llvm.spec b/llvm.spec index abb9d25..242e7c1 100644 --- a/llvm.spec +++ b/llvm.spec @@ -10,31 +10,35 @@ # LLVM object files don't contain build IDs. I don't know why yet. # Suppress their generation for now. -%define __debug_install_post echo not building debuginfo -Name: llvm -Version: 2.3 -Release: 2%{?dist} -Summary: The Low Level Virtual Machine -License: NCSA -Group: Development/Languages -URL: http://llvm.org/ -Source0: http://llvm.org/releases/%{version}/llvm-%{version}.tar.gz +%define debug_package %{nil} + +Name: llvm +Version: 2.4 +Release: 2%{?dist} +Summary: The Low Level Virtual Machine + +Group: Development/Languages +License: NCSA +URL: http://llvm.org/ +Source0: http://llvm.org/releases/%{version}/llvm-%{version}.tar.gz %if %{?_with_gcc:1}%{!?_with_gcc:0} -Source1: http://llvm.org/releases/%{version}/llvm-gcc%{lgcc_version}-%{version}.source.tar.gz +Source1: http://llvm.org/releases/%{version}/llvm-gcc%{lgcc_version}-%{version}.source.tar.gz %endif +Patch0: llvm-2.1-fix-sed.patch +Patch1: llvm-2.4-fix-ocaml.patch -Patch0: llvm-2.1-fix-sed.patch +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) -BuildRequires: bison -BuildRequires: chrpath -BuildRequires: flex -BuildRequires: gcc-c++ >= 3.4 -BuildRequires: groff -BuildRequires: libtool-ltdl-devel +BuildRequires: bison +BuildRequires: chrpath +BuildRequires: flex +BuildRequires: gcc-c++ >= 3.4 +BuildRequires: groff +BuildRequires: libtool-ltdl-devel +BuildRequires: ocaml-ocamldoc %if %{?_with_doxygen:1}%{!?_with_doxygen:0} -BuildRequires: doxygen graphviz +BuildRequires: doxygen graphviz %endif %description @@ -51,10 +55,10 @@ ends derived from GCC %{lgcc_version}. %package devel -Summary: Libraries and header files for LLVM -Group: Development/Languages -Requires: %{name} = %{version}-%{release} -Requires: libstdc++-devel >= 3.4 +Summary: Libraries and header files for LLVM +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: libstdc++-devel >= 3.4 %description devel @@ -63,10 +67,9 @@ native programs that use the LLVM infrastructure. %package doc -Summary: Documentation for LLVM -Group: Development/Languages -Requires: %{name} = %{version}-%{release} - +Summary: Documentation for LLVM +Group: Development/Languages +Requires: %{name} = %{version}-%{release} %description doc Documentation for the LLVM compiler infrastructure. @@ -75,10 +78,10 @@ Documentation for the LLVM compiler infrastructure. %if %{?_with_gcc:1}%{!?_with_gcc:0} %package gcc -Summary: C compiler for LLVM -License: GPL+ -Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Summary: C compiler for LLVM +License: GPL+ +Group: Development/Languages +Requires: %{name} = %{version}-%{release} %description gcc @@ -86,10 +89,10 @@ C compiler for LLVM. %package gcc-c++ -Summary: C++ compiler for LLVM -License: GPL+ -Group: Development/Languages -Requires: %{name}-gcc = %{version}-%{release} +Summary: C++ compiler for LLVM +License: GPL+ +Group: Development/Languages +Requires: %{name}-gcc = %{version}-%{release} %description gcc-c++ @@ -100,9 +103,9 @@ C++ compiler for LLVM. %if %{?_with_doxygen:1}%{!?_with_doxygen:0} %package apidoc -Summary: API documentation for LLVM -Group: Development/Languages -Requires: %{name}-docs = %{version}-%{release} +Summary: API documentation for LLVM +Group: Development/Languages +Requires: %{name}-docs = %{version}-%{release} %description apidoc @@ -110,16 +113,34 @@ API documentation for the LLVM compiler infrastructure. %endif +%package ocaml +Summary: OCaml binding for LLVM +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: ocaml-runtime + +%description ocaml +OCaml binding for LLVM. + + +%package ocaml-devel +Summary: Development files for %{name}-ocaml +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-ocaml = %{version}-%{release} + +%description ocaml-devel +The %{name}-ocaml-devel package contains libraries and signature files +for developing applications that use %{name}-ocaml. + + %prep %setup -q -n llvm-%{version} %{?_with_gcc:-a1} %patch0 -p1 -b .fix-sed +%patch1 -p1 -b .fix-ocaml %build -# We're not building a debuginfo package yet, because some generated -# files don't include build IDs. -cat /dev/null > debugfiles.list - %configure \ --libdir=%{_libdir}/%{name} \ --datadir=%{_datadir}/%{name}-%{version} \ @@ -129,10 +150,12 @@ cat /dev/null > debugfiles.list --enable-jit \ --enable-optimized \ --enable-shared \ - --enable-targets=host-only \ --with-pic -make %{_smp_mflags} tools-only VERBOSE=1 OmitFramePointer='' REQUIRES_EH=1 \ - OPTIMIZE_OPTION='%{optflags}' +# --enable-targets=host-only \ + +make %{_smp_mflags} OPTIMIZE_OPTION='%{optflags}' +# tools-only VERBOSE=1 OmitFramePointer='' REQUIRES_EH=1 \ +# OPTIMIZE_OPTION='%{optflags}' %if %{?_with_gcc:1}%{!?_with_gcc:0} # Build llvm-gcc. @@ -163,22 +186,37 @@ make %{_smp_mflags} LLVM_VERSION_INFO=%{version} %install rm -rf %{buildroot} chmod -x examples/Makefile -make install \ - PROJ_prefix=%{buildroot}/%{_prefix} \ - PROJ_bindir=%{buildroot}/%{_bindir} \ - PROJ_libdir=%{buildroot}/%{_libdir}/%{name} \ - PROJ_datadir=%{buildroot}/%{_datadir} \ - PROJ_docsdir=%{buildroot}/%{_docdir}/%{name}-%{version} \ - PROJ_etcdir=%{buildroot}/%{_datadir}/%{name}-%{version} \ - PROJ_includedir=%{buildroot}/%{_includedir} \ - PROJ_infodir=%{buildroot}/%{_infodir} \ - PROJ_mandir=%{buildroot}/%{_mandir} +# OVERRIDE_libdir used by our patched Makefile.ocaml: +# see http://llvm.org/bugs/show_bug.cgi?id=3153 +make install DESTDIR=%{buildroot} \ + PROJ_libdir=%{buildroot}/%{_libdir}/%{name} \ + OVERRIDE_libdir=%{_libdir}/%{name}/%{name} \ + PROJ_docsdir=`pwd`/moredocs + +#make install \ +# PROJ_prefix=%{buildroot}/%{_prefix} \ +# PROJ_bindir=%{buildroot}/%{_bindir} \ +# PROJ_libdir=%{buildroot}/%{_libdir}/%{name} \ +# PROJ_datadir=%{buildroot}/%{_datadir} \ +# PROJ_docsdir=%{buildroot}/%{_docdir}/%{name}-%{version} \ +# PROJ_etcdir=%{buildroot}/%{_datadir}/%{name}-%{version} \ +# PROJ_includedir=%{buildroot}/%{_includedir} \ +# PROJ_infodir=%{buildroot}/%{_infodir} \ +# PROJ_mandir=%{buildroot}/%{_mandir} find %{buildroot} -name .dir -print0 | xargs -0r rm -f file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d # Get rid of erroneously installed example files. rm %{buildroot}%{_libdir}/%{name}/LLVMHello.* +# And OCaml .o files +rm %{buildroot}%{_libdir}/ocaml/*.o + +# Use relative links for ocaml's libLLVM*.a +#(cd %{buildroot}%{_libdir}/ocaml && for i in libLLVM*.a; do +# ln -sf %{_libdir}/llvm/$i $i; +# done) + # Remove deprecated tools. rm %{buildroot}%{_bindir}/gcc{as,ld} @@ -204,6 +242,7 @@ rm -r libexec/gcc/%{_target_platform}/%{lgcc_version}/install-tools rm -r %{_lib}/gcc/%{_target_platform}/%{lgcc_version}/install-tools %endif + %clean rm -rf %{buildroot} @@ -241,9 +280,20 @@ rm -rf %{buildroot} %{_libdir}/%{name} +%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 + %files doc %defattr(-,root,root,-) -%doc docs/*.{html,css} docs/img examples +%doc docs/*.{html,css} docs/img examples moredocs/* %if %{?_with_doxygen:1}%{!?_with_doxygen:0} @@ -287,6 +337,13 @@ rm -rf %{buildroot} %changelog +* Tue Dec 2 2008 Michel Salim - 2.4-2 +- Patched build process for the OCaml binding + +* Tue Dec 2 2008 Michel Salim - 2.4-1 +- Update to 2.4 +- Package Ocaml binding + * Wed Jun 18 2008 Bryan O'Sullivan - 2.3-2 - Add dependency on groff diff --git a/sources b/sources index dee8eca..43aa49f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -17254d72863b7fa005f3fb327aea3439 llvm-2.3.tar.gz +bf43eee98c364fd79c7d2b72e645a15e llvm-2.4.tar.gz