Mesa (radeon-rewrite): radeon: add cflags to decide whether to link libdrm_radeon or not.

Dave Airlie airlied at kemper.freedesktop.org
Sun Feb 15 07:04:30 UTC 2009


Module: Mesa
Branch: radeon-rewrite
Commit: b0e8ac8fd2eeb88b5f9299afb36102113a2435d4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0e8ac8fd2eeb88b5f9299afb36102113a2435d4

Author: Dave Airlie <airlied at redhat.com>
Date:   Sun Feb 15 17:03:47 2009 +1000

radeon: add cflags to decide whether to link libdrm_radeon or not.

You don't need libdrm_radeon for the legacy driver to build,
only for the experimental mm/cs paths.

---

 configs/autoconf.in                  |    2 ++
 configure.ac                         |    9 +++++++++
 src/mesa/drivers/dri/r200/Makefile   |    4 +++-
 src/mesa/drivers/dri/r300/Makefile   |    4 +++-
 src/mesa/drivers/dri/radeon/Makefile |    4 +++-
 5 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index b352974..d786029 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -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@
diff --git a/configure.ac b/configure.ac
index a9a8d5a..ea2992d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile
index 41c7aed..e593ed9 100644
--- a/src/mesa/drivers/dri/r200/Makefile
+++ b/src/mesa/drivers/dri/r200/Makefile
@@ -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 #####
 
diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile
index 77846a4..497b1ec 100644
--- a/src/mesa/drivers/dri/r300/Makefile
+++ b/src/mesa/drivers/dri/r300/Makefile
@@ -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 #####
 
diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile
index 0a5775b..f469c6f 100644
--- a/src/mesa/drivers/dri/radeon/Makefile
+++ b/src/mesa/drivers/dri/radeon/Makefile
@@ -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 = 
 




More information about the mesa-commit mailing list