From 329f79361678b1c727d6e4833b59c67e4853d442 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 28 Jul 2010 13:54:15 -0400 Subject: [PATCH] Only try to use +DAportable for non-GCC on hppa Check the value of $pic_flag insteaf of whether the compiler is ANSI C when detecting the HP-UX bundled C compiler. --HG-- branch : 1.7 --- configure | 26 ++++++++++++++++---------- configure.in | 40 +++++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 2ba1bdbc9..879bb8599 100755 --- a/configure +++ b/configure @@ -12670,15 +12670,18 @@ done : ${mansectsu='1m'} : ${mansectform='4'} - # HP-UX bundled compiler can't generate shared objects - if test "x$ac_cv_prog_cc_c89" = "xno"; then - with_noexec=no - fi + if test -z "$GCC"; then + # HP-UX bundled compiler can't generate shared objects + if -z "$pic_flag"; then + with_noexec=no + fi - # Use the +DAportable flag if it is supported - _CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS +DAportable" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands +DAportable" >&5 + # Use the +DAportable flag on hppa if it is supported + case "$host_cpu" in + hppa*) + _CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS +DAportable" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands +DAportable" >&5 $as_echo_n "checking whether $CC understands +DAportable... " >&6; } if test "${sudo_cv_var_daportable+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -12707,8 +12710,11 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_daportable" >&5 $as_echo "$sudo_cv_var_daportable" >&6; } - if test X"$sudo_cv_var_daportable" != X"yes"; then - CFLAGS="$_CFLAGS" + if test X"$sudo_cv_var_daportable" != X"yes"; then + CFLAGS="$_CFLAGS" + fi + ;; + esac fi case "$host" in diff --git a/configure.in b/configure.in index deb22cda6..2182e98c6 100644 --- a/configure.in +++ b/configure.in @@ -1454,25 +1454,31 @@ case "$host" in : ${mansectsu='1m'} : ${mansectform='4'} - # HP-UX bundled compiler can't generate shared objects - if test "x$ac_cv_prog_cc_c89" = "xno"; then - with_noexec=no - fi + if test -z "$GCC"; then + # HP-UX bundled compiler can't generate shared objects + if -z "$pic_flag"; then + with_noexec=no + fi - # Use the +DAportable flag if it is supported - _CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS +DAportable" - AC_CACHE_CHECK([whether $CC understands +DAportable], - [sudo_cv_var_daportable], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [sudo_cv_var_daportable=yes], - [sudo_cv_var_daportable=no] + # Use the +DAportable flag on hppa if it is supported + case "$host_cpu" in + hppa*) + _CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS +DAportable" + AC_CACHE_CHECK([whether $CC understands +DAportable], + [sudo_cv_var_daportable], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [sudo_cv_var_daportable=yes], + [sudo_cv_var_daportable=no] + ) + ] ) - ] - ) - if test X"$sudo_cv_var_daportable" != X"yes"; then - CFLAGS="$_CFLAGS" + if test X"$sudo_cv_var_daportable" != X"yes"; then + CFLAGS="$_CFLAGS" + fi + ;; + esac fi case "$host" in -- 2.40.0