From 411737cf2589b6770e2f1e88b7d07f82a4c9d07e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 9 May 2011 10:02:16 -0400 Subject: [PATCH] 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. --- configure | 21 ++++++++++++--------- configure.in | 19 +++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 63ae1b490..e90e2a533 100755 --- a/configure +++ b/configure @@ -13084,14 +13084,18 @@ done : ${mansectsu='1m'} : ${mansectform='4'} - if test -z "$GCC"; then - # 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 test "${sudo_cv_var_daportable+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -13123,8 +13127,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 414451869..daea5fd43 100644 --- a/configure.in +++ b/configure.in @@ -1513,13 +1513,17 @@ case "$host" in : ${mansectsu='1m'} : ${mansectform='4'} - if test -z "$GCC"; then - # 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([[]], [[]])], @@ -1532,8 +1536,7 @@ case "$host" in CFLAGS="$_CFLAGS" fi ;; - esac - fi + esac case "$host" in *-*-hpux[1-8].*) -- 2.40.0