summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-09-18 00:36:55 -0700
committerMark Mueller <MarkKMueller@gmail.com>2013-10-28 11:06:48 -0700
commitfb1868f389a34e01553110c978f6c54f79b1c95f (patch)
treec712e20646421814882e9a7c972adeefdafddda9
parent2b9a8326d5f88fefd404d83516ff4b6e22055440 (diff)
clover: Prepare the build system for ICD support.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--configure.ac14
-rw-r--r--src/gallium/state_trackers/clover/Makefile.am4
-rw-r--r--src/gallium/targets/opencl/Makefile.am15
3 files changed, 25 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index addbf57d4c..dfa35b41b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,6 +593,12 @@ AC_ARG_ENABLE([opencl],
@<:@default=no@:>@])],
[],
[enable_opencl=no])
+AC_ARG_ENABLE([opencl_icd],
+ [AS_HELP_STRING([--enable-opencl-icd],
+ [Build an OpenCL ICD library to be loaded by an ICD implementation
+ @<:@default=no@:>@])],
+ [enable_opencl_icd="$enableval"],
+ [enable_opencl_icd=no])
AC_ARG_ENABLE([xlib-glx],
[AS_HELP_STRING([--enable-xlib-glx],
[make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
@@ -1356,8 +1362,16 @@ if test "x$enable_opencl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
enable_gallium_loader=yes
+
+ if test "x$enable_opencl_icd" = xyes; then
+ OPENCL_LIBNAME="MesaOpenCL"
+ else
+ OPENCL_LIBNAME="OpenCL"
+ fi
fi
AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
+AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
+AC_SUBST([OPENCL_LIBNAME])
dnl
dnl Gallium configuration
diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
index d0ce68eb21..240a2d0602 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -12,6 +12,10 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/winsys \
-I$(srcdir)
+if HAVE_CLOVER_ICD
+AM_CPPFLAGS += -DHAVE_CLOVER_ICD
+endif
+
noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
libcltgsi_la_CXXFLAGS = \
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
index 46bb29fffa..cdc7500f31 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -1,12 +1,12 @@
AUTOMAKE_OPTIONS = subdir-objects
-lib_LTLIBRARIES = libOpenCL.la
+lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
-libOpenCL_la_LDFLAGS = \
+lib@OPENCL_LIBNAME@_la_LDFLAGS = \
$(LLVM_LDFLAGS) \
-version-number 1:0
-libOpenCL_la_LIBADD = \
+lib@OPENCL_LIBNAME@_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
$(top_builddir)/src/gallium/state_trackers/clover/libclover.la \
@@ -28,14 +28,13 @@ libOpenCL_la_LIBADD = \
-lclangBasic \
$(LLVM_LIBS)
-
-libOpenCL_la_SOURCES =
+lib@OPENCL_LIBNAME@_la_SOURCES =
# Force usage of a C++ linker
-nodist_EXTRA_libOpenCL_la_SOURCES = dummy.cpp
+nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
-all-local: libOpenCL.la
+all-local: lib@OPENCL_LIBNAME@.la
$(MKDIR_P) $(top_builddir)/$(LIB_DIR)
- ln -f .libs/libOpenCL.so* $(top_builddir)/$(LIB_DIR)/
+ ln -f .libs/lib@OPENCL_LIBNAME@.so* $(top_builddir)/$(LIB_DIR)/