Fix build for darwin
[mesa.git] / src / gallium / targets / gbm / Makefile.am
index 6d71a65b9cbe591ae1941d212d0a2aa6b17c36af..bfc03073b3c6fa51af492fe9a9d7be2e7c57cef9 100644 (file)
@@ -34,33 +34,48 @@ AM_CPPFLAGS = \
 
 AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
+       $(VISIBILITY_CFLAGS) \
        $(LIBDRM_CFLAGS)
 
 gbm_LTLIBRARIES = gbm_gallium_drm.la
 
+nodist_EXTRA_gbm_gallium_drm_la_SOURCES = dummy.cpp
 gbm_gallium_drm_la_SOURCES = gbm.c
 
 gbm_gallium_drm_la_LIBADD = \
-       $(GALLIUM_PIPE_LOADER_LIBS) \
-       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
+       $(GALLIUM_PIPE_LOADER_CLIENT_LIBS) \
+       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_client.la \
        $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
        $(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(LIBDRM_LIBS) \
-       -lm
+       $(GALLIUM_COMMON_LIB_DEPS)
 
-gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module
+if HAVE_DRI
+gbm_gallium_drm_la_LIBADD += \
+       $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la
+endif
 
-# FIXME: this shouldn't be needed
-if HAVE_MESA_LLVM
-gbm_gallium_drm_la_LINK = $(CXXLINK) $(gbm_gallium_drm_la_LDFLAGS)
-# Mention a dummy pure C++ file to trigger generation of the $(LINK) variable
-nodist_EXTRA_gbm_gallium_drm_la_SOURCES = dummy-cpp.cpp
+if NEED_WINSYS_XLIB
+gbm_gallium_drm_la_LIBADD += \
+       $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
+       -lX11 -lXext -lXfixes \
+       $(LIBDRM_LIBS)
+endif
 
+gbm_gallium_drm_la_LDFLAGS = \
+       -module \
+       -no-undefined \
+       -avoid-version \
+if HAVE_LD_VERSION_SCRIPT
+       -Wl,--version-script=$(top_srcdir)/src/gallium/targets/gbm/gbm.sym \
+endif
+       $(GC_SECTIONS) \
+       $(LD_NO_UNDEFINED)
+
+if HAVE_MESA_LLVM
 gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)
 gbm_gallium_drm_la_LDFLAGS += $(LLVM_LDFLAGS)
-else
-gbm_gallium_drm_la_LINK = $(CXXLINK) $(gbm_gallium_drm_la_LDFLAGS)
-# Mention a dummy pure C file to trigger generation of the $(LINK) variable
-nodist_EXTRA_gbm_gallium_drm_la_SOURCES = dummy-c.c
 endif
+
+TESTS = gallium-gbm-symbols-check