mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 00:30:13 +01:00
configure: Trust LLVM >= 4.0 llvm-config --libs for shared libraries
No need to manually look for the library files anymore with current LLVM. This sidesteps the manual method failing when LLVM was built with -DLLVM_APPEND_VC_REV=ON. (This might already work with older versions of LLVM) Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
165e18dd21
commit
3d8da1f678
1 changed files with 28 additions and 26 deletions
54
configure.ac
54
configure.ac
|
|
@ -2623,35 +2623,37 @@ if test "x$enable_llvm" = xyes; then
|
||||||
fi
|
fi
|
||||||
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
||||||
|
|
||||||
dnl llvm-config may not give the right answer when llvm is a built as a
|
|
||||||
dnl single shared library, so we must work the library name out for
|
|
||||||
dnl ourselves.
|
|
||||||
dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
|
|
||||||
if test "x$enable_llvm_shared_libs" = xyes; then
|
if test "x$enable_llvm_shared_libs" = xyes; then
|
||||||
dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
|
if test $LLVM_VERSION_MAJOR -lt 4; then
|
||||||
LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
|
dnl llvm-config may not give the right answer when llvm is a built as a
|
||||||
AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
|
dnl single shared library, so we must work the library name out for
|
||||||
|
dnl ourselves.
|
||||||
|
dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
|
||||||
|
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.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
|
||||||
|
|
||||||
if test "x$llvm_have_one_so" = xyes; then
|
if test "x$llvm_have_one_so" = xyes; then
|
||||||
dnl LLVM was built using auto*, so there is only one shared object.
|
dnl LLVM was built using auto*, so there is only one shared object.
|
||||||
LLVM_LIBS="-l$LLVM_SO_NAME"
|
LLVM_LIBS="-l$LLVM_SO_NAME"
|
||||||
else
|
else
|
||||||
dnl If LLVM was built with CMake, there will be one shared object per
|
dnl If LLVM was built with CMake, there will be one shared object per
|
||||||
dnl component.
|
dnl component.
|
||||||
AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
|
AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
|
||||||
[AC_MSG_ERROR([Could not find llvm shared libraries:
|
[AC_MSG_ERROR([Could not find llvm shared libraries:
|
||||||
Please make sure you have built llvm with the --enable-shared option
|
Please make sure you have built llvm with the --enable-shared option
|
||||||
and that your llvm libraries are installed in $LLVM_LIBDIR
|
and that your llvm libraries are installed in $LLVM_LIBDIR
|
||||||
If you have installed your llvm libraries to a different directory you
|
If you have installed your llvm libraries to a different directory you
|
||||||
can use the --with-llvm-prefix= configure flag to specify this directory.
|
can use the --with-llvm-prefix= configure flag to specify this directory.
|
||||||
NOTE: Mesa is attempting to use llvm shared libraries by default.
|
NOTE: Mesa is attempting to use llvm shared libraries by default.
|
||||||
If you do not want to build with llvm shared libraries and instead want to
|
If you do not want to build with llvm shared libraries and instead want to
|
||||||
use llvm static libraries then add --disable-llvm-shared-libs to your configure
|
use llvm static libraries then add --disable-llvm-shared-libs to your configure
|
||||||
invocation and rebuild.])])
|
invocation and rebuild.])])
|
||||||
|
|
||||||
dnl We don't need to update LLVM_LIBS in this case because the LLVM
|
dnl We don't need to update LLVM_LIBS in this case because the LLVM
|
||||||
dnl install uses a shared object for each component and we have
|
dnl install uses a shared object for each component and we have
|
||||||
dnl already added all of these objects to LLVM_LIBS.
|
dnl already added all of these objects to LLVM_LIBS.
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])
|
AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue