radeon: add cflags to decide whether to link libdrm_radeon or not.
authorDave Airlie <airlied@redhat.com>
Sun, 15 Feb 2009 07:03:47 +0000 (17:03 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 15 Feb 2009 07:03:47 +0000 (17:03 +1000)
You don't need libdrm_radeon for the legacy driver to build,
only for the experimental mm/cs paths.

configs/autoconf.in
configure.ac
src/mesa/drivers/dri/r200/Makefile
src/mesa/drivers/dri/r300/Makefile
src/mesa/drivers/dri/radeon/Makefile

index b352974a4c53c03de443c46fe99877bcddeee7fc..d7860294eae9b51fb7cb1a037d393e4cd75bd419 100644 (file)
@@ -20,6 +20,8 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
        $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
 LDFLAGS = @LDFLAGS@
 EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
+RADEON_CFLAGS = @RADEON_CFLAGS@
+RADEON_LDFLAGS = @RADEON_LDFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
index a9a8d5ad0be27a70ed6893c84c5f29018aca327d..ea2992d38b0e9643f94318e3686d5d6088059c3d 100644 (file)
@@ -446,6 +446,8 @@ AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
 AC_SUBST([GALLIUM_DRIVER_DIRS])
 AC_SUBST([GALLIUM_AUXILIARY_DIRS])
 AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
+AC_SUBST([RADEON_CFLAGS])
+AC_SUBST([RADEON_LDFLAGS])
 
 dnl
 dnl User supplied program configuration
@@ -573,6 +575,13 @@ 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], 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
index 41c7aed3655fa66e56958d0015b382a1a54b6372..e593ed91c5814fb235a2c6fb9a98c7d89a895cd7 100644 (file)
@@ -3,6 +3,8 @@
 TOP = ../../../../..
 include $(TOP)/configs/current
 
+CFLAGS += $(RADEON_CFLAGS)
+
 LIBNAME = r200_dri.so
 
 MINIGLX_SOURCES = server/radeon_dri.c 
@@ -80,7 +82,7 @@ COMMON_SYMLINKS = \
        radeon_dma.c \
        radeon_dma.h
 
-DRI_LIB_DEPS += #-ldrm_radeon
+DRI_LIB_DEPS += $(RADEON_LDFLAGS)
 
 ##### TARGETS #####
 
index 77846a4d676ab05838e724d161e6fd9833691238..497b1ec528f35811f64c457fae178b111b056c5d 100644 (file)
@@ -3,6 +3,8 @@
 TOP = ../../../../..
 include $(TOP)/configs/current
 
+CFLAGS += $(RADEON_CFLAGS)
+
 LIBNAME = r300_dri.so
 
 MINIGLX_SOURCES = server/radeon_dri.c
@@ -96,7 +98,7 @@ COMMON_SYMLINKS = \
        radeon_texture.c \
        radeon_texture.h
 
-DRI_LIB_DEPS += #-ldrm_radeon
+DRI_LIB_DEPS += $(RADEON_LDFLAGS)
 
 ##### TARGETS #####
 
index 0a5775b11c1a9efca2e9a34600123361ec958c4f..f469c6f43a149c64869a5a2d263c164c69c75a8c 100644 (file)
@@ -4,6 +4,8 @@
 TOP = ../../../../..
 include $(TOP)/configs/current
 
+CFLAGS += $(RADEON_CFLAGS)
+
 LIBNAME = radeon_dri.so
 
 MINIGLX_SOURCES = server/radeon_dri.c 
@@ -39,7 +41,7 @@ C_SOURCES = \
 
 DRIVER_DEFINES = -DRADEON_COMMON=0
 
-DRI_LIB_DEPS += #-ldrm_radeon
+DRI_LIB_DEPS += $(RADEON_LDFLAGS)
 
 X86_SOURCES =