Make DRI dependencies and build depend on the target
[mesa.git] / src / glx / Makefile.am
index 0c99c0709d644354e2388404a7b0d00646d3b002..4553de01a1737e99232e1e39efbe4b7de7576f05 100644 (file)
@@ -82,24 +82,40 @@ libglx_la_SOURCES = \
          single2.c \
          singlepix.c \
          vertarr.c \
-         xfont.c \
          glx_pbuffer.c \
          glx_query.c \
-         drisw_glx.c \
-         dri_common.c \
+         glxhash.c
+
+if HAVE_DRISW
+libglx_la_SOURCES += \
+         drisw_glx.c
+endif
+
+if HAVE_DRICOMMON
+libglx_la_SOURCES += \
+         xfont.c \
+         dri_common.c
+endif
+
+if HAVE_DRI2
+libglx_la_SOURCES += \
          dri_glx.c \
          XF86dri.c \
-         glxhash.c \
          dri2_glx.c \
          dri2.c \
-         dri2_query_renderer.c \
-         applegl_glx.c
+         dri2_query_renderer.c
+endif
 
 if HAVE_DRI3
 libglx_la_SOURCES += \
           dri3_glx.c
 endif
 
+if HAVE_APPLEDRI
+libglx_la_SOURCES += \
+         applegl_glx.c
+endif
+
 libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la
 
 GL_LIBS = \
@@ -111,8 +127,9 @@ GL_LIBS = \
 GL_LDFLAGS = \
        -no-undefined \
        -version-number 1:2 \
-       -Wl,-Bsymbolic \
-       -Wl,--no-undefined
+       $(BSYMBOLIC) \
+       $(GC_SECTIONS) \
+       $(LD_NO_UNDEFINED)
 
 lib@GL_LIB@_la_SOURCES =
 lib@GL_LIB@_la_LIBADD = $(GL_LIBS)