bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] [PATCH 2/2] use AC_CANONICAL_HOST instead of uname


From: Mike Frysinger
Subject: [bug-gawk] [PATCH 2/2] use AC_CANONICAL_HOST instead of uname
Date: Sat, 7 Dec 2013 01:54:23 -0500

The autoconf macro is designed for parsing the target and works in all the
various scenarios (cross-compile/native/etc...) while `uname` only works
when doing a native build.
---
 configure.ac | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0619a75..b5e1ac5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,7 @@ AC_ARG_ENABLE([lint], [  --disable-lint       Disable gawk 
lint checking],
        fi
 )
 
+AC_CANONICAL_HOST
 AC_USE_SYSTEM_EXTENSIONS
 
 dnl checks for programs
@@ -119,8 +120,8 @@ dnl need -D_SYSV3 for ISC
 fi
 
 dnl check for systems where libc is borked for regex handling
-case `uname` in
-MirBSD | MirOS)
+case $host_os in
+mirbsd*)
        AC_DEFINE([LIBC_IS_BORKED], 1, [libc is broken for regex handling])
        ;;
 esac
@@ -263,8 +264,8 @@ AC_CHECK_LIB(m, fmod)
 AC_CHECK_LIB(m, isinf)
 AC_CHECK_LIB(m, ismod)
 dnl Don't look for libsigsegv on OSF/1, gives us severe headaches
-case `uname` in
-OSF1)  : ;;
+case $host_os in
+osf1)  : ;;
 *)
        gl_LIBSIGSEGV
        ;;
@@ -289,8 +290,8 @@ if test "x$enable_extensions" != "xno"; then
        extensions_supported=no
 
        dnl On MirBSD (and probably other systems), don't even try.
-       case `uname` in
-       MirBSD | MirOS)
+       case $host_os in
+       mirbsd*)
                : ;;
        *)
        AC_CHECK_HEADER(dlfcn.h,
@@ -306,10 +307,12 @@ if test "x$enable_extensions" != "xno"; then
                        extensions_supported=yes
                        AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
                        # Add -export-dynamic for old extensions. Only works 
for GCC
-                       if test "$GCC" = yes &&
-                          uname | $EGREP -i 'linux|freebsd' > /dev/null
-                       then
-                               LDFLAGS="$LDFLAGS -export-dynamic"
+                       if test "$GCC" = yes; then
+                               case $host_os in
+                               linux*|freebsd*)
+                                       LDFLAGS="$LDFLAGS -export-dynamic"
+                                       ;;
+                               esac
                        fi
                fi
        ])
@@ -325,8 +328,8 @@ fi
 dnl check for how to use getpgrp
 dnl have to hardwire it for VMS POSIX. Sigh.
 dnl ditto for BeOS, OS/2, and MS-DOS.
-case `(uname) 2> /dev/null` in
-*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
+case $host_os in
+vms*|beos*|os2*|msdos)
        AC_DEFINE(GETPGRP_VOID, 1,
          [Define to 1 if the getpgrp function requires zero arguments.])
        ;;
-- 
1.8.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]