From: Todd C. Miller Date: Sat, 13 Aug 2011 22:09:13 +0000 (-0400) Subject: When building with gcc on HP-UX, use -march=1.1 to produce portable X-Git-Tag: SUDO_1_7_7~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e02b14851696db41ab10c904238ad3f067f07ac4;p=sudo When building with gcc on HP-UX, use -march=1.1 to produce portable binaries on a pa-risc2 host. Previously, the +Dportable option was used for the HP-UX C compiler but gcc always produced native binaries. --HG-- branch : 1.7 --- diff --git a/configure b/configure index b8f7e2317..3945e3143 100755 --- a/configure +++ b/configure @@ -13776,19 +13776,23 @@ done : ${mansectsu='1m'} : ${mansectform='4'} - if test -z "$GCC"; then - # HP-UX bundled compiler can't generate shared objects - if test "x$ac_cv_prog_cc_c89" = "xno"; then - with_noexec=no - fi + # HP-UX bundled compiler can't generate shared objects + if test -z "$GCC" -a "x$ac_cv_prog_cc_c89" = "xno"; then + with_noexec=no + fi - # Use the +DAportable flag on hppa if it is supported - case "$host_cpu" in - hppa*) + # Build PA-RISC1.1 objects for better portability + case "$host_cpu" in + hppa2-9*) _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 -n "$GCC"; then + portable_flag="-march=1.1" + else + portable_flag="+DAportable" + fi + CFLAGS="$CFLAGS $portable_flag" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands $portable_flag" >&5 +$as_echo_n "checking whether $CC understands $portable_flag... " >&6; } if ${sudo_cv_var_daportable+:} false; then : $as_echo_n "(cached) " >&6 else @@ -13820,8 +13824,7 @@ $as_echo "$sudo_cv_var_daportable" >&6; } CFLAGS="$_CFLAGS" fi ;; - esac - fi + esac case "$host" in *-*-hpux1-8.*) diff --git a/configure.in b/configure.in index ae0c47b51..358ef67f1 100644 --- a/configure.in +++ b/configure.in @@ -1507,18 +1507,22 @@ case "$host" in : ${mansectsu='1m'} : ${mansectform='4'} - if test -z "$GCC"; then - # HP-UX bundled compiler can't generate shared objects - if test "x$ac_cv_prog_cc_c89" = "xno"; then - with_noexec=no - fi + # HP-UX bundled compiler can't generate shared objects + if test -z "$GCC" -a "x$ac_cv_prog_cc_c89" = "xno"; then + with_noexec=no + fi - # Use the +DAportable flag on hppa if it is supported - case "$host_cpu" in - hppa*) + # Build PA-RISC1.1 objects for better portability + case "$host_cpu" in + hppa[2-9]*) _CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS +DAportable" - AC_CACHE_CHECK([whether $CC understands +DAportable], + if test -n "$GCC"; then + portable_flag="-march=1.1" + else + portable_flag="+DAportable" + fi + CFLAGS="$CFLAGS $portable_flag" + AC_CACHE_CHECK([whether $CC understands $portable_flag], [sudo_cv_var_daportable], [AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[]])], @@ -1531,8 +1535,7 @@ case "$host" in CFLAGS="$_CFLAGS" fi ;; - esac - fi + esac case "$host" in *-*-hpux[1-8].*)