]> granicus.if.org Git - sudo/commitdiff
When building with gcc on HP-UX, use -march=1.1 to produce portable
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 9 May 2011 14:02:16 +0000 (10:02 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 9 May 2011 14:02:16 +0000 (10:02 -0400)
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
configure.in

index 63ae1b490a7fea28fbb17f7c23bca1e01ec5525b..e90e2a53371f6e1606633d6f3b0da3e57c78c7b5 100755 (executable)
--- 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.*)
index 4144518698679255794a8cf95e96a50d7aa62a63..daea5fd43a53abdfc16361dac07e271fdfd87c2d 100644 (file)
@@ -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].*)