clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.

Tom Stellard:
  -Keep --with-libclc-path and mark it deprecated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
Johannes Obermayr
2012-11-30 01:44:56 +01:00
committed by Tom Stellard
parent ed3f237e09
commit 959e83d650
4 changed files with 22 additions and 6 deletions

View File

@@ -183,7 +183,8 @@ VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@ XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# Path to OpenCL C library libclc # Path to OpenCL C library libclc
LIBCLC_PATH = @LIBCLC_PATH@ LIBCLC_INCLUDEDIR = @LIBCLC_INCLUDEDIR@
LIBCLC_LIBEXECDIR = @LIBCLC_LIBEXECDIR@
# pkg-config substitutions # pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@ GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@

View File

@@ -1452,17 +1452,27 @@ dnl
AC_ARG_WITH([libclc-path], AC_ARG_WITH([libclc-path],
[AS_HELP_STRING([--with-libclc-path], [AS_HELP_STRING([--with-libclc-path],
[Path to libclc builtins library. Example: --with-libclc-path=\$HOME/libclc/])], [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
[LIBCLC_PATH="$withval"], [LIBCLC_PATH="$withval"],
[LIBCLC_PATH=""]) [LIBCLC_PATH=""])
if test "x$LIBCLC_PATH" != x; then
AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
Please review the updated build instructions for clover:
http://dri.freedesktop.org/wiki/GalliumCompute])
fi
AC_ARG_WITH([clang-libdir], AC_ARG_WITH([clang-libdir],
[AS_HELP_STRING([--with-clang-libdir], [AS_HELP_STRING([--with-clang-libdir],
[Path to Clang libraries @<:@default=llvm-config --libdir@:>@])], [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
[CLANG_LIBDIR="$withval"], [CLANG_LIBDIR="$withval"],
[CLANG_LIBDIR=""]) [CLANG_LIBDIR=""])
AC_SUBST([LIBCLC_PATH]) LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
AC_SUBST([LIBCLC_INCLUDEDIR])
AC_SUBST([LIBCLC_LIBEXECDIR])
if test "x$enable_opencl" = xyes; then if test "x$enable_opencl" = xyes; then
if test "x$with_gallium_drivers" = x; then if test "x$with_gallium_drivers" = x; then
@@ -1473,6 +1483,10 @@ if test "x$enable_opencl" = xyes; then
AC_MSG_ERROR([gcc >= 4.6 is required to build clover]) AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
fi fi
if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
fi
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover" GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
enable_gallium_loader=yes enable_gallium_loader=yes

View File

@@ -23,7 +23,8 @@ libclllvm_la_CXXFLAGS = \
-std=c++98 \ -std=c++98 \
$(LLVM_CPPFLAGS) \ $(LLVM_CPPFLAGS) \
$(DEFINES) \ $(DEFINES) \
-DLIBCLC_PATH=\"$(LIBCLC_PATH)/\" \ -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
-DLIBCLC_LIBEXECDIR=\"$(LIBCLC_LIBEXECDIR)/\" \
-DCLANG_RESOURCE_DIR=\"$(CLANG_RESOURCE_DIR)\" -DCLANG_RESOURCE_DIR=\"$(CLANG_RESOURCE_DIR)\"
libclllvm_la_SOURCES = \ libclllvm_la_SOURCES = \

View File

@@ -149,7 +149,7 @@ namespace {
c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR; c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR;
// Add libclc generic search path // Add libclc generic search path
c.getHeaderSearchOpts().AddPath(LIBCLC_PATH "/generic/include/", c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
clang::frontend::Angled, clang::frontend::Angled,
false, false, false); false, false, false);
@@ -205,7 +205,7 @@ namespace {
llvm::Linker linker("clover", mod); llvm::Linker linker("clover", mod);
// Link the kernel with libclc // Link the kernel with libclc
linker.LinkInFile(llvm::sys::Path(LIBCLC_PATH + triple + "/lib/builtins.bc"), isNative); linker.LinkInFile(llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc"), isNative);
mod = linker.releaseModule(); mod = linker.releaseModule();
// Add a function internalizer pass. // Add a function internalizer pass.