[Mesa-dev] [PATCH] configure: link against -lLLVM to determine build type

Maarten Lankhorst maarten.lankhorst at canonical.com
Tue Aug 13 08:53:52 PDT 2013


Fixes a build failure of 9.2 on ubuntu, because libLLVM-3.3.so is not present in /usr/lib/llvm-3.2/lib.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
diff --git a/configure.ac b/configure.ac
index 35f6797..579d8d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1870,7 +1870,18 @@ if test "x$MESA_LLVM" != x0; then
     if test "x$with_llvm_shared_libs" = xyes; then
         dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
         LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
-        AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
+
+        AC_MSG_CHECKING([whether $LLVM_SO_NAME is a monolithic blob])
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS $LLVM_LDFLAGS"
+        LIBS="$LIBS -l$LLVM_SO_NAME"
+
+        AC_LINK_IFELSE([AC_LANG_CALL([], [LLVMInitializeCore])],
+                           [llvm_have_one_so=yes], [llvm_have_one_so=no])
+        LIBS="$save_LIBS"
+        LDFLAGS="$save_LDFLAGS"
+        AC_MSG_RESULT([$llvm_have_one_so])
 
         if test "x$llvm_have_one_so" = xyes; then
             dnl LLVM was built using auto*, so there is only one shared object.



More information about the mesa-dev mailing list