Kaydet (Commit) 0a2923d0 authored tarafından Petr Mladek's avatar Petr Mladek

Fall back to --hash-style=sysv when gnu is not supported

Based on patch by Francois Tigeot <ftigeot at wolfpond dot org>
üst 9da441f0
...@@ -957,8 +957,10 @@ AC_ARG_WITH(system-mozilla, ...@@ -957,8 +957,10 @@ AC_ARG_WITH(system-mozilla,
WITH_SYSTEM_MOZILLA=no) WITH_SYSTEM_MOZILLA=no)
AC_ARG_WITH(linker-hash-style, AC_ARG_WITH(linker-hash-style,
[ --with-linker-hash-style AS_HELP_STRING([--with-linker-hash-style],
], WITH_LINKER_HASH_STYLE=$withval, WITH_LINKER_HASH_STYLE=gnu) [Use linker with --hash-style=<style> when linking shared objects.
Possible values: "sysv", "gnu", "both". The default value is "gnu"
if supported on the build system, and "sysv" otherwise.]))
AC_ARG_WITH(stlport, AC_ARG_WITH(stlport,
AS_HELP_STRING([--with-stlport], AS_HELP_STRING([--with-stlport],
...@@ -2021,21 +2023,43 @@ if test "$_os" = "SunOS"; then ...@@ -2021,21 +2023,43 @@ if test "$_os" = "SunOS"; then
fi fi
fi fi
if test "$GCC" = "yes"; then HAVE_LD_HASH_STYLE=FALSE
AC_MSG_CHECKING( for --hash-style=$WITH_LINKER_HASH_STYLE linker support ) WITH_LINKER_HASH_STYLE=
hash_style_ldflags_save=$LDFLAGS AC_MSG_CHECKING( for --hash-style gcc linker support )
LDFLAGS="$LDFLAGS -Wl,--hash-style=$WITH_LINKER_HASH_STYLE" if test "$GCC" = "yes" ; then
AC_LINK_IFELSE([AC_LANG_PROGRAM([ if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes" ; then
#include <stdio.h> hash_styles="gnu sysv"
],[ elif test "$with_linker_hash_style" = "no" ; then
printf ("hello world\n"); hash_styles=
])], HAVE_LD_HASH_STYLE=TRUE, HAVE_LD_HASH_STYLE=FALSE)
if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then
AC_MSG_RESULT( found )
else else
AC_MSG_RESULT( not found ) hash_styles="$with_linker_hash_style"
fi
for hash_style in $hash_styles ; do
test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
hash_style_ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
AC_TRY_RUN([
#include <stdio.h>
int main(char argc, char** argv) {
printf ("hello world\n");
return 0;
}
], HAVE_LD_HASH_STYLE=TRUE; WITH_LINKER_HASH_STYLE=$hash_style, HAVE_LD_HASH_STYLE=FALSE)
LDFLAGS=$hash_style_ldflags_save
done
if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
else
AC_MSG_RESULT( no )
fi fi
LDFLAGS=$hash_style_ldflags_save LDFLAGS=$hash_style_ldflags_save
else
AC_MSG_RESULT( no )
fi fi
AC_SUBST(HAVE_LD_HASH_STYLE) AC_SUBST(HAVE_LD_HASH_STYLE)
AC_SUBST(WITH_LINKER_HASH_STYLE) AC_SUBST(WITH_LINKER_HASH_STYLE)
......
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