diff m4/lib-prefix.m4 @ 39145:70e60f1ab942

Don’t use AC_EGREP_CPP if affected by CFLAGS * m4/float_h.m4 (gl_FLOAT_H): * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): * m4/lib-ld.m4 (AC_LIB_PROG_LD): * m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): * m4/year2038.m4 (gl_YEAR2038): Prefer AC_COMPILE_IFELSE to AC_EGREP_CPP when testing conditions likely to be affected by the choice of CFLAGS, since CFLAGS are not used by AC_EGREP_CPP. Without this patch, ‘./configure CFLAGS="-m32"’ fails on gzip with GNU/Linux x86-64.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 05 Nov 2017 20:04:11 -0800
parents 760837dbf3b5
children e8b5ba4ca15e
line wrap: on
line diff
--- a/m4/lib-prefix.m4	Sun Nov 05 14:29:10 2017 -0800
+++ b/m4/lib-prefix.m4	Sun Nov 05 20:04:11 2017 -0800
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 9
+# lib-prefix.m4 serial 10
 dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -188,11 +188,16 @@
          dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
          dnl symlink is missing, so we set acl_libdirstem2 too.
          AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-           [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
-              ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+           [AC_COMPILE_IFELSE([sixtyfour bits],
+              [AC_LANG_SOURCE(
+                 [[#ifdef _LP64
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_solaris_64bit=yes],
+              [gl_cv_solaris_64bit=no])
            ])
          if test $gl_cv_solaris_64bit = yes; then
            acl_libdirstem=lib/64