%{?mingw_package_header} %global mingw_build_win64 0 # As of 06-May-2012, LLVM 3.0 doesn't seem to build for win64. It gets # a lot of undefined symbols in the "Linking Release Shared Library # LLVM-3.0.dll" phase. I'll need help from upstream to deal with that, # so for now, only build for win32. #global prerel rcX %global downloadurl http://llvm.org/%{?prerel:pre-}releases/%{version}%{?prerel:/%{prerel}} Name: mingw-llvm Version: 3.0 Release: 3%{?dist} Summary: MinGW LLVM (Low Level Virtual Machine) Group: Development/Libraries License: NCSA URL: http://llvm.org/ Source0: %{downloadurl}/llvm-%{version}%{?prerel:%{prerel}.src}.tar.gz # Data files should be installed with timestamps preserved. Patch0: llvm-2.6-timestamp.patch # Fedora MinGW-specific patch to undef environment variables # set by mingw_configure macro. The env vars simplify making # most packages build for MinGW. The LLVM build system is # already MinGW-aware, so the evn vars not only don't help, # they actually break the build by preventing some necessary # build-host tools from building correctly. Patch100: llvm-3.0-mingw-undef.patch # Fedora MinGW-specific patch to remove llvm-config logic that # tries to figure out where llvm-config is running from. We # *ALWAYS* use the configured PREFIX. Patch101: llvm-3.0-mingw-config-dir.patch BuildArch: noarch BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-gcc-c++ BuildRequires: mingw32-binutils BuildRequires: mingw32-libffi %description LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, and idle-time optimization of programs from arbitrary programming languages. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. %package -n mingw32-llvm Summary: %{summary} Group: Development/Libraries %description -n mingw32-llvm MingGW shared libraries for the LLVM compiler infrastructure. %package -n mingw32-llvm-static Summary: %{summary} static libraries Group: Development/Libraries %description -n mingw32-llvm-static MingGW static libraries for the LLVM compiler infrastructure. %{?mingw_debug_package} %prep %setup -q -n llvm-%{version}%{?prerel}.src rm -rf tools/clang # llvm patches %patch0 -p1 -b .timestamp %patch100 -p1 -b .mingw-undef %patch101 -p1 -b .mingw-config-dir %build %mingw_configure \ --enable-debug-runtime \ --enable-jit \ --enable-libffi \ --enable-shared \ --enable-bindings=none \ --enable-docs=no # NOTE: docs are available in native llvm and llvm-doc packages. %mingw_make %{?_smp_mflags} \ OPTIMIZE_OPTION="%{mingw32_cflags}" \ KEEP_SYMBOLS=1 %install %mingw_make_install "DESTDIR=%{buildroot}" # Libraries shouldn't have execute permission! chmod a-x %{buildroot}%{mingw32_libdir}/*.a # Move and rename the llvm-config script, because it runs on # the build host, not on Windows. mkdir -p %{buildroot}%{_bindir} mv %{buildroot}%{mingw32_bindir}/llvm-config \ %{buildroot}%{_bindir}/%{mingw32_host}-llvm-config %files -n mingw32-llvm %doc CREDITS.TXT LICENSE.TXT README.txt %{mingw32_bindir}/bugpoint.exe %{mingw32_bindir}/llc.exe %{mingw32_bindir}/lli.exe %{mingw32_bindir}/llvm*.exe %{mingw32_bindir}/macho-dump.exe %{mingw32_bindir}/opt.exe %{mingw32_bindir}/LLVM-3.0.dll %{mingw32_bindir}/BugpointPasses.dll %{mingw32_bindir}/LTO.dll %{mingw32_includedir}/llvm/ %{mingw32_includedir}/llvm-c/ %{_bindir}/%{mingw32_host}-llvm-config %files -n mingw32-llvm-static %{mingw32_libdir}/*.a %changelog * Thu May 10 2012 Eric Smith - 3.0-3 - Add patch to force llvm-config to always use PREFIX, rather than trying to figure out whether it has been installed. * Mon May 07 2012 Eric Smith - 3.0-2 - Add OPTIMIZE_OPTION and KEEP_SYMBOLS to make command line to prevent symbols from being stripped, in order to get usable debuginfo package. * Sun May 06 2012 Eric Smith - 3.0-1 - Initial version