Use the autoconf cache when checking for symbol export control support.

This commit is contained in:
Todd C. Miller
2012-07-02 11:20:05 -04:00
parent f8f0021710
commit f38349a026
2 changed files with 150 additions and 97 deletions

60
configure vendored
View File

@@ -20256,14 +20256,18 @@ fi
if test -n "$LT_LDEXPORTS"; then if test -n "$LT_LDEXPORTS"; then
if test "$lt_cv_prog_gnu_ld" = "yes"; then if test "$lt_cv_prog_gnu_ld" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports anonymous map files" >&5
$as_echo_n "checking whether ld supports anonymous map files... " >&6; }
if ${sudo_cv_var_gnu_ld_anon_map+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.map <<-EOF cat > conftest.map <<-EOF
{ {
global: foo; global: foo;
local: *; local: *;
}; };
EOF EOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports anonymous map files" >&5
$as_echo_n "checking whether ld supports anonymous map files... " >&6; }
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
@@ -20281,24 +20285,36 @@ main ()
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,--version-script,\$(shlib_map)" sudo_cv_var_gnu_ld_anon_map=yes
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_gnu_ld_anon_map" >&5
$as_echo "$sudo_cv_var_gnu_ld_anon_map" >&6; }
if test "$sudo_cv_var_gnu_ld_anon_map" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,--version-script,\$(shlib_map)"
fi
else else
case "$host" in case "$host" in
*-*-solaris2*) *-*-solaris2*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports anonymous map files" >&5
$as_echo_n "checking whether ld supports anonymous map files... " >&6; }
if ${sudo_cv_var_solaris_ld_anon_map+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.map <<-EOF cat > conftest.map <<-EOF
{ {
global: foo; global: foo;
local: *; local: *;
}; };
EOF EOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports anonymous map files" >&5
$as_echo_n "checking whether ld supports anonymous map files... " >&6; }
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
@@ -20316,20 +20332,30 @@ main ()
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,-M,\$(shlib_map)" sudo_cv_var_solaris_ld_anon_map=yes
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_solaris_ld_anon_map" >&5
$as_echo "$sudo_cv_var_solaris_ld_anon_map" >&6; }
if test "$sudo_cv_var_solaris_ld_anon_map" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,-M,\$(shlib_map)"
fi
;; ;;
*-*-hpux*) *-*-hpux*)
cat > conftest.opt <<-EOF
+e foo
EOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports controlling exported symbols" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld supports controlling exported symbols" >&5
$as_echo_n "checking whether ld supports controlling exported symbols... " >&6; } $as_echo_n "checking whether ld supports controlling exported symbols... " >&6; }
if ${sudo_cv_var_hpux_ld_symbol_export+:} false; then :
$as_echo_n "(cached) " >&6
else
echo "+e foo" > conftest.opt
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
@@ -20351,19 +20377,27 @@ main ()
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_opt)"; LT_LDOPT="-Wl,-c,\$(shlib_opt)" sudo_cv_var_hpux_ld_symbol_export=yes
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_hpux_ld_symbol_export" >&5
$as_echo "$sudo_cv_var_hpux_ld_symbol_export" >&6; }
if test "$sudo_cv_var_hpux_ld_symbol_export" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_opt)"; LT_LDOPT="-Wl,-c,\$(shlib_opt)"
fi
;; ;;
esac esac
fi fi
fi fi
if test "$enable_pie" != "no"; then if test "$enable_pie" != "no" -a -n "$GCC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIE" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIE" >&5
$as_echo_n "checking whether C compiler accepts -fPIE... " >&6; } $as_echo_n "checking whether C compiler accepts -fPIE... " >&6; }
if ${ax_cv_check_cflags___fPIE+:} false; then : if ${ax_cv_check_cflags___fPIE+:} false; then :

View File

@@ -3219,47 +3219,61 @@ dnl This test relies on AC_LANG_WERROR
dnl dnl
if test -n "$LT_LDEXPORTS"; then if test -n "$LT_LDEXPORTS"; then
if test "$lt_cv_prog_gnu_ld" = "yes"; then if test "$lt_cv_prog_gnu_ld" = "yes"; then
AC_CACHE_CHECK([whether ld supports anonymous map files],
[sudo_cv_var_gnu_ld_anon_map],
[
cat > conftest.map <<-EOF cat > conftest.map <<-EOF
{ {
global: foo; global: foo;
local: *; local: *;
}; };
EOF EOF
AC_MSG_CHECKING([whether ld supports anonymous map files])
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -fpic -shared -Wl,--version-script,./conftest.map" LDFLAGS="$LDFLAGS -fpic -shared -Wl,--version-script,./conftest.map"
AC_TRY_LINK([int foo;], [], [ AC_TRY_LINK([int foo;], [], [
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,--version-script,\$(shlib_map)" sudo_cv_var_gnu_ld_anon_map=yes
]) ])
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_gnu_ld_anon_map" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,--version-script,\$(shlib_map)"
fi
else else
case "$host" in case "$host" in
*-*-solaris2*) *-*-solaris2*)
AC_CACHE_CHECK([whether ld supports anonymous map files],
[sudo_cv_var_solaris_ld_anon_map],
[
cat > conftest.map <<-EOF cat > conftest.map <<-EOF
{ {
global: foo; global: foo;
local: *; local: *;
}; };
EOF EOF
AC_MSG_CHECKING([whether ld supports anonymous map files])
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared -Wl,-M,./conftest.map" LDFLAGS="$LDFLAGS -shared -Wl,-M,./conftest.map"
AC_TRY_LINK([int foo;], [], [ AC_TRY_LINK([int foo;], [], [
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,-M,\$(shlib_map)" sudo_cv_var_solaris_ld_anon_map=yes
]) ])
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_solaris_ld_anon_map" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,-M,\$(shlib_map)"
fi
;; ;;
*-*-hpux*) *-*-hpux*)
cat > conftest.opt <<-EOF AC_CACHE_CHECK([whether ld supports controlling exported symbols],
+e foo [sudo_cv_var_hpux_ld_symbol_export],
EOF [
AC_MSG_CHECKING([whether ld supports controlling exported symbols]) echo "+e foo" > conftest.opt
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic" CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
@@ -3269,10 +3283,15 @@ if test -n "$LT_LDEXPORTS"; then
LDFLAGS="$LDFLAGS -Wl,-b -Wl,-c,./conftest.opt" LDFLAGS="$LDFLAGS -Wl,-b -Wl,-c,./conftest.opt"
fi fi
AC_TRY_LINK([int foo;], [], [ AC_TRY_LINK([int foo;], [], [
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_opt)"; LT_LDOPT="-Wl,-c,\$(shlib_opt)" sudo_cv_var_hpux_ld_symbol_export=yes
]) ])
CFLAGS="$_CFLAGS" CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS" LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_hpux_ld_symbol_export" = "yes"; then
LT_LDEXPORTS=; LT_LDDEP="\$(shlib_opt)"; LT_LDOPT="-Wl,-c,\$(shlib_opt)"
fi
;; ;;
esac esac
fi fi
@@ -3282,7 +3301,7 @@ dnl
dnl Check for PIE executable support if using gcc. dnl Check for PIE executable support if using gcc.
dnl This test relies on AC_LANG_WERROR dnl This test relies on AC_LANG_WERROR
dnl dnl
if test "$enable_pie" != "no"; then if test "$enable_pie" != "no" -a -n "$GCC"; then
AX_CHECK_COMPILE_FLAG([-fPIE], [ AX_CHECK_COMPILE_FLAG([-fPIE], [
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIE" CFLAGS="$CFLAGS -fPIE"