Check for libdrm_$chipset.pc when needed
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 1 Jan 2010 22:03:33 +0000 (17:03 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 4 Jan 2010 16:47:59 +0000 (11:47 -0500)
This adds missing pkg-config lookup for intel and moves the radeon
lookup into a case...esac so it's only looked up when one or more of
the radeon drivers are enabled.

configs/autoconf.in
configure.ac
src/mesa/drivers/dri/i915/Makefile
src/mesa/drivers/dri/i965/Makefile

index b94d9bce4690023e4afb281240400250c2914a5b..f63618ebea2bcdfe9599a82edb4d3bc488dbf90d 100644 (file)
@@ -22,6 +22,8 @@ LDFLAGS = @LDFLAGS@
 EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
 RADEON_CFLAGS = @RADEON_CFLAGS@
 RADEON_LDFLAGS = @RADEON_LDFLAGS@
+INTEL_LIBS = @INTEL_LIBS@
+INTEL_CFLAGS = @INTEL_CFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
index b2a969bc8c9477e0500a6f6eeb2f1c7ab3785891..d3fbd0271322a4de49ef2e94a7b97bf9082aa5be 100644 (file)
@@ -447,8 +447,6 @@ AC_SUBST([GALLIUM_WINSYS_DIRS])
 AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
 AC_SUBST([GALLIUM_DRIVERS_DIRS])
 AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
-AC_SUBST([RADEON_CFLAGS])
-AC_SUBST([RADEON_LDFLAGS])
 
 dnl
 dnl User supplied program configuration
@@ -576,13 +574,6 @@ dri)
     GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
     DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
 
-    PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
-
-    if test "$HAVE_LIBDRM_RADEON" = yes; then
-       RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
-       RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
-    fi
-
     # find the DRI deps for libGL
     if test "$x11_pkgconfig" = yes; then
         # add xcb modules if necessary
@@ -802,6 +793,27 @@ AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
 AC_SUBST([DRI_LIB_DEPS])
 
+case $DRI_DIRS in
+*i915*|*i965*)
+    PKG_CHECK_MODULES([INTEL], [libdrm_intel])
+    ;;
+
+*radeon*|*r200*|*r300*|*r600*)
+    PKG_CHECK_MODULES([LIBDRM_RADEON],
+                     [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
+                     HAVE_LIBDRM_RADEON=yes,
+                     HAVE_LIBDRM_RADEON=no)
+
+    if test "$HAVE_LIBDRM_RADEON" = yes; then
+       RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
+       RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
+    fi
+    ;;
+esac
+AC_SUBST([RADEON_CFLAGS])
+AC_SUBST([RADEON_LDFLAGS])
+
+
 dnl
 dnl OSMesa configuration
 dnl
index 37f15aa7671a414975a18c4eb5fe1571af4a51f4..788e78654ebe6f79a5acd2b7ea5541834d059f8a 100644 (file)
@@ -64,7 +64,8 @@ DRIVER_DEFINES = -I../intel -I../intel/server -DI915 \
        $(shell pkg-config libdrm --atleast-version=2.3.1 \
                                && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
 
-DRI_LIB_DEPS += -ldrm_intel
+INCLUDES += $(INTEL_CFLAGS)
+DRI_LIB_DEPS += $(INTEL_LIBS)
 
 include ../Makefile.template
 
index 7a55333e896fd372e750fddb9eaca71dd5c97c98..7cdbdc70713213274353518f76a8b4714f77a01e 100644 (file)
@@ -96,7 +96,8 @@ ASM_SOURCES =
 
 DRIVER_DEFINES = -I../intel -I../intel/server
 
-DRI_LIB_DEPS += -ldrm_intel
+INCLUDES += $(INTEL_CFLAGS)
+DRI_LIB_DEPS += $(INTEL_LIBS)
 
 include ../Makefile.template