1
0
forked from rpms/mesa

use llvm's libllvm.so hack instead of our own

This commit is contained in:
Adam Jackson 2011-05-09 15:39:01 -04:00
parent 4f2860a0b4
commit c0d2da0658
2 changed files with 11 additions and 80 deletions

View File

@ -1,51 +1,12 @@
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 4e931a3..fec8e42 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -31,8 +31,8 @@ INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_CFLAGS = @LLVM_CFLAGS@
-LLVM_LDFLAGS = @LLVM_LDFLAGS@
-LLVM_LIBS = @LLVM_LIBS@
+LLVM_LDFLAGS = -L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lllvmcore-$(shell llvm-config --version)
+LLVM_LIBS = -lllvmcore-$(shell llvm-config --version)
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
diff --git a/configs/linux-llvm b/configs/linux-llvm
index 359bee2..0de094d 100644
--- a/configs/linux-llvm
+++ b/configs/linux-llvm
@@ -32,8 +32,8 @@ endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
- LLVM_LDFLAGS = $(shell llvm-config --ldflags)
- LLVM_LIBS = $(shell llvm-config --libs)
+ LLVM_LDFLAGS = -L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lllvmcore-$(shell llvm-config --version)
+ LLVM_LIBS = -lllvmcore-$(shell llvm-config --version)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
diff --git a/configure.ac b/configure.ac
index b510151..e872f2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1404,8 +1404,6 @@ if test "x$enable_gallium" = xyes; then
fi
AC_SUBST([LLVM_CFLAGS])
-AC_SUBST([LLVM_LIBS])
-AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_VERSION])
dnl
@@ -1649,7 +1647,6 @@ if test "x$enable_gallium_llvm" = xyes; then
diff -up mesa-20110412/configure.ac.jx mesa-20110412/configure.ac
--- mesa-20110412/configure.ac.jx 2011-05-09 15:04:19.000000000 -0400
+++ mesa-20110412/configure.ac 2011-05-09 15:05:11.000000000 -0400
@@ -1679,7 +1679,7 @@ if test "x$enable_gallium_llvm" = xyes;
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
- LLVM_LIBS="`$LLVM_CONFIG --libs` -lstdc++"
+ LLVM_LIBS="-lLLVM-`llvm-config --version` -lstdc++"
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"

View File

@ -6,9 +6,6 @@
%define with_hardware 1
%endif
# broken atm, sorry. fix before any f15 merge.
%define with_llvmcore 1
%define _default_patch_fuzz 2
%define manpages gl-manpages-1.0.1
@ -18,7 +15,7 @@
Summary: Mesa graphics libraries
Name: mesa
Version: 7.11
Release: 0.7.%{gitdate}.0%{?dist}
Release: 0.8.%{gitdate}.0%{?dist}
License: MIT
Group: System Environment/Libraries
URL: http://www.mesa3d.org
@ -29,7 +26,6 @@ URL: http://www.mesa3d.org
Source0: %{name}-%{gitdate}.tar.xz
Source2: %{manpages}.tar.bz2
Source3: make-git-snapshot.sh
Source4: llvmcore.mk
Patch1: mesa-nouveau-fix-build.patch
Patch2: mesa-7.1-nukeglthread-debug.patch
@ -111,22 +107,12 @@ Group: User Interface/X Hardware Support
%description dri-filesystem
Mesa DRI driver filesystem
%if %{with_llvmcore}
%package dri-llvmcore
Summary: Mesa common LLVM support
Group: User Interface/X Hardware Support
Requires: mesa-dri-filesystem%{?_isa}
%description dri-llvmcore
Common DSO for LLVM support for gallium-based DRI drivers. This package
exists solely as a disk space hack for Mesa. Do not link against this
library if you are not Mesa. You have been warned.
%endif
%package dri-drivers
Summary: Mesa-based DRI drivers
Group: User Interface/X Hardware Support
Requires: mesa-dri-filesystem%{?_isa}
Obsoletes: mesa-dri-drivers-experimental < 0:7.10-0.24
Obsoletes: mesa-dri-llvmcore <= 7.11-0.8
%description dri-drivers
Mesa-based DRI drivers.
@ -220,13 +206,10 @@ Requires: Xorg %(xserver-sdk-abi-requires ansic) %(xserver-sdk-abi-requires vide
%patch3 -p1 -b .no-mach64
%patch4 -p1 -b .classic
#patch7 -p1 -b .dricore
%patch8 -p1 -b .llvmcore
%patch30 -p1 -b .vblank-warning
#patch31 -p1 -b .swrastg
%if %{with_llvmcore}
%patch8 -p1 -b .llvmcore
%endif
%build
autoreconf --install
@ -251,13 +234,6 @@ make clean
# just to be sure...
[ `find . -name \*.o | wc -l` -eq 0 ] || exit 1
# build llvmcore
%if %{with_llvmcore}
TOP=`pwd` make -f %{SOURCE4} llvmcore
mkdir -p %{_lib}
mv libllvmcore*.so %{_lib}
%endif
# now build the rest of mesa
%configure %{common_flags} \
--disable-glw \
@ -301,9 +277,6 @@ make install DESTDIR=$RPM_BUILD_ROOT DRI_DIRS=
# just the DRI drivers that are sane
install -d $RPM_BUILD_ROOT%{_libdir}/dri
%if %{with_llvmcore}
install -m 0755 -t $RPM_BUILD_ROOT%{_libdir}/dri %{_lib}/libllvmcore-2*.so >& /dev/null
%endif
# use gallium driver iff built
[ -f %{_lib}/gallium/r300_dri.so ] && cp %{_lib}/gallium/r300_dri.so %{_lib}/r300_dri.so
[ -f %{_lib}/gallium/r600_dri.so ] && cp %{_lib}/gallium/r600_dri.so %{_lib}/r600_dri.so
@ -381,12 +354,6 @@ rm -rf $RPM_BUILD_ROOT
%doc docs/COPYING
%dir %{_libdir}/dri
%if %{with_llvmcore}
%files dri-llvmcore
%defattr(-,root,root,-)
%{_libdir}/dri/libllvmcore-2.*.so
%endif
%files dri-drivers
%defattr(-,root,root,-)
%if %{with_hardware}
@ -488,6 +455,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libOSMesa.so
%changelog
* Mon May 09 2011 Adam Jackson <ajax@redhat.com> 7.11-0.8.20110412.0
- Use llvm-libs' shared lib instead of rolling our own.
* Mon Apr 18 2011 Adam Jackson <ajax@redhat.com> 7.11-0.7.20110412.0
- Fix intel driver exclusion to be better arched (#697555)