]> 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>
Sat, 13 Aug 2011 22:09:13 +0000 (18:09 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 13 Aug 2011 22:09:13 +0000 (18:09 -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.

--HG--
branch : 1.7

configure
configure.in

index b8f7e231792eeb39a6e3554348d99d8504d8b8a6..3945e31438f1731b3d18bb35ab7fd87ad0ff79f0 100755 (executable)
--- 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.*)
index ae0c47b51616c9097e3320c612f2f767d831e6a3..358ef67f1672ed46864cdaa2aac0791ed7f44bc2 100644 (file)
@@ -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].*)