Commit 0874734e authored by Alexandre Julliard's avatar Alexandre Julliard

configure: Try readelf before ldd to determine a library soname.

parent b93e29f0
......@@ -22,18 +22,20 @@ dnl configuration script generated by Autoconf, you may include it
dnl under the same distribution terms that you use for the rest of
dnl that program.
dnl **** Get the ldd program name; used by WINE_GET_SONAME ****
dnl **** Get the programs used by WINE_GET_SONAME ****
dnl
dnl Usage: WINE_PATH_LDD
dnl Usage: WINE_PATH_SONAME_TOOLS
dnl
AC_DEFUN([WINE_PATH_LDD],[AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)])
AC_DEFUN([WINE_PATH_SONAME_TOOLS],
[AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)
AC_CHECK_TOOLS(READELF,[readelf],true)])
dnl **** Extract the soname of a library ****
dnl
dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
dnl
AC_DEFUN([WINE_CHECK_SONAME],
[AC_REQUIRE([WINE_PATH_LDD])dnl
[AC_REQUIRE([WINE_PATH_SONAME_TOOLS])dnl
AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
AC_MSG_CHECKING([for -l$1])
......@@ -44,7 +46,9 @@ LIBS="-l$1 $5 $LIBS"
[case "$LIBEXT" in
dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
dylib) AS_VAR_SET(ac_Lib,[`otool -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;;
*) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`]) ;;
*) AS_VAR_SET(ac_Lib,[`$READELF -d conftest$ac_exeext | grep "NEEDED.*ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\\m4_dquote(\\(ac_lib_pattern\\.$LIBEXT[[^ ]]*\\)\\).*$/\1/"';2,$d'`])
AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = x],
[AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;;
esac])
LIBS=$ac_check_soname_save_LIBS])dnl
AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = "x"],
......
......@@ -690,7 +690,7 @@ AC_SUBST(IMPLIBEXT,"def")
AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"")
STATIC_IMPLIBEXT="def.a"
WINE_PATH_LDD
WINE_PATH_SONAME_TOOLS
case $host_os in
cygwin*|mingw32*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment