summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2012-03-27 22:24:39 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-03-30 09:13:04 -0400
commit7d87c71a70c95d4fe3a94676128fd9524f048112 (patch)
tree4a12a47b12436c68d99ddac9a5fdc208f31b4bcc
parent2402ce04ae06f909e361782f5063fa3070091bf1 (diff)
configure: Add --with-llvm-shared-libs
This option allows targets to link against the LLVM shared library instead of the static libs. With LLVM 2.9, his saves ~11 MB for each of the r300 target libraries.
-rw-r--r--configure.ac15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 1c437e7baaf..135bacf7f46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1779,6 +1779,13 @@ AC_ARG_ENABLE([gallium-llvm],
[build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
[enable_gallium_llvm="$enableval"],
[enable_gallium_llvm=auto])
+
+AC_ARG_WITH([llvm-shared-libs],
+ [AS_HELP_STRING([--with-llvm-shared-libs],
+ [link with LLVM shared libraries @<:@default=disabled@:>@])],
+ [with_llvm_shared_libs=yes],
+ [with_llvm_shared_libs=no])
+
if test "x$with_gallium_drivers" = x; then
enable_gallium_llvm=no
fi
@@ -1793,8 +1800,12 @@ if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g'`
- LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
-
+ if test "x$with_llvm_shared_libs" = xyes; then
+ dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
+ LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
+ else
+ LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
+ fi
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
DEFINES="$DEFINES -D__STDC_CONSTANT_MACROS"
MESA_LLVM=1