pipe-loader: split out "client" version
authorRob Clark <robclark@freedesktop.org>
Mon, 10 Feb 2014 14:39:23 +0000 (09:39 -0500)
committerRob Clark <robclark@freedesktop.org>
Sun, 16 Feb 2014 13:31:10 +0000 (08:31 -0500)
Build two versions of pipe-loader, with only the client version linking
in x11 client side dependencies.  This will allow the XA state tracker
to use pipe-loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
configure.ac
src/gallium/auxiliary/pipe-loader/Makefile.am
src/gallium/targets/gbm/Makefile.am
src/gallium/targets/opencl/Makefile.am
src/gallium/tests/trivial/Makefile.am

index 00a0eaa2d356128e71137f0a15b0ae9ca6d8ee53..cf7562b671f7f10c4b229abb9caee5386da7178d 100644 (file)
@@ -1913,6 +1913,11 @@ AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -
                                                   "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
                                                   && test "x$MESA_LLVM" = x1)
 
+# NOTE: anything using xcb or other client side libs ends up in separate
+#       _CLIENT variables.  The pipe loader is built in two variants,
+#       one that is standalone and does not link any x client libs (for
+#       use by XA tracker in particular, but could be used in any case
+#       where communication with xserver is not desired).
 if test "x$enable_gallium_loader" = xyes; then
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
 
@@ -1921,13 +1926,18 @@ if test "x$enable_gallium_loader" = xyes; then
         PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
                           pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
         if test "x$pipe_loader_have_xcb" = xyes; then
-            GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XCB"
-            GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
+            GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES -DHAVE_PIPE_LOADER_XCB"
+            GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
         fi
     fi
 
+    GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES $GALLIUM_PIPE_LOADER_DEFINES"
+    GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_LIBS"
+
     AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
     AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
+    AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
+    AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
 fi
 
 AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
index 74a61a3bd5c55ed2b059f8cb34655997108f0d62..ccdbea56d7a7abc39b147cd928aff0c106b823b6 100644 (file)
@@ -2,7 +2,6 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 AM_CPPFLAGS = $(DEFINES) \
        $(VISIBILITY_CFLAGS) \
-       $(GALLIUM_PIPE_LOADER_DEFINES) \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/src/loader \
        -I$(top_srcdir)/src/gallium/include \
@@ -13,8 +12,9 @@ noinst_LTLIBRARIES =
 
 if HAVE_LOADER_GALLIUM
 noinst_LTLIBRARIES += libpipe_loader.la
+noinst_LTLIBRARIES += libpipe_loader_client.la
 
-libpipe_loader_la_SOURCES = \
+COMMON_SOURCES = \
        pipe_loader.h \
        pipe_loader_priv.h \
        pipe_loader.c \
@@ -23,10 +23,25 @@ libpipe_loader_la_SOURCES = \
 if HAVE_DRM_LOADER_GALLIUM
 AM_CFLAGS = $(LIBDRM_CFLAGS)
 
-libpipe_loader_la_SOURCES += pipe_loader_drm.c
+COMMON_SOURCES += pipe_loader_drm.c
 
-libpipe_loader_la_LIBADD = \
+COMMON_LIBADD = \
        $(top_builddir)/src/loader/libloader.la
 
 endif
+
+libpipe_loader_la_CFLAGS  = \
+       $(GALLIUM_PIPE_LOADER_DEFINES) \
+       $(AM_CFLAGS) $(AM_CPPFLAGS)
+libpipe_loader_la_SOURCES = $(COMMON_SOURCES)
+libpipe_loader_la_LIBADD  = $(COMMON_LIBADD) \
+       $(GALLIUM_PIPE_LOADER_LIBS)
+
+libpipe_loader_client_la_CFLAGS  = \
+       $(GALLIUM_PIPE_LOADER_CLIENT_DEFINES) \
+       $(AM_CFLAGS) $(AM_CPPFLAGS)
+libpipe_loader_client_la_SOURCES = $(COMMON_SOURCES)
+libpipe_loader_client_la_LIBADD  = $(COMMON_LIBADD) \
+       $(GALLIUM_PIPE_LOADER_CLIENT_LIBS)
+
 endif
index f44aee88962139111fbc1dfaac833be290f75cb3..c0dcd8cd1c298fc983d557b4db7c5381edd09e4f 100644 (file)
@@ -42,8 +42,8 @@ gbm_LTLIBRARIES = gbm_gallium_drm.la
 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 \
index d0275ae2cf7ab18e2f769dabe06bc40444983491..8eec40586e3507725fbb9f53f24333038d587a42 100644 (file)
@@ -7,11 +7,11 @@ lib@OPENCL_LIBNAME@_la_LDFLAGS = \
        -version-number 1:0
 
 lib@OPENCL_LIBNAME@_la_LIBADD = \
-       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
+       $(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/clover/libclover.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-       $(GALLIUM_PIPE_LOADER_LIBS) \
+       $(GALLIUM_PIPE_LOADER_CLIENT_LIBS) \
        -ldl \
        -lclangCodeGen \
        -lclangFrontendTool \
index 0702f684ba92fa85a7485cbacaf29dc4a00fa00c..debb2e24e91734fc28473eb39f5b5b727429134d 100644 (file)
@@ -11,8 +11,8 @@ AM_CPPFLAGS = \
        -DPIPE_SEARCH_DIR=\"$(PIPE_SRC_DIR)/.libs\" \
        $(GALLIUM_PIPE_LOADER_DEFINES)
 
-LDADD = $(GALLIUM_PIPE_LOADER_LIBS) \
-       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
+LDADD = $(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/auxiliary/libgallium.la \
        $(DLOPEN_LIBS) \