gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, master, updated. gawk-4.1.0-4893-g79c1b152


From: Arnold Robbins
Subject: [SCM] gawk branch, master, updated. gawk-4.1.0-4893-g79c1b152
Date: Tue, 23 Aug 2022 03:38:57 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  79c1b1526338396ac62261decb09842e14406794 (commit)
      from  91290f6ab7cb68b898fc3d79e18b6ec1b9239355 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=79c1b1526338396ac62261decb09842e14406794

commit 79c1b1526338396ac62261decb09842e14406794
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Tue Aug 23 10:38:27 2022 +0300

    Improve check for -no-pie flag during configuration.

diff --git a/Makefile.in b/Makefile.in
index 194fa8de..7e58cef7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -121,6 +121,7 @@ bin_PROGRAMS = gawk$(EXEEXT)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
diff --git a/aclocal.m4 b/aclocal.m4
index 0891c33d..6de50fec 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1209,6 +1209,7 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([m4/arch.m4])
+m4_include([m4/ax_check_compile_flag.m4])
 m4_include([m4/codeset.m4])
 m4_include([m4/gettext.m4])
 m4_include([m4/host-cpu-c-abi.m4])
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index e6014767..3d4a937c 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -113,6 +113,7 @@ pkglibexec_PROGRAMS = pwcat$(EXEEXT) grcat$(EXEEXT)
 subdir = awklib
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
diff --git a/configure b/configure
index 06b0cb1d..7ac5755d 100755
--- a/configure
+++ b/configure
@@ -12588,6 +12588,45 @@ printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h
   fi
 
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler 
accepts " >&5
+printf %s "checking whether C compiler accepts ... " >&6; }
+if test ${ax_cv_check_cflags__+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS  "
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ax_cv_check_cflags__=yes
+else $as_nop
+  ax_cv_check_cflags__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__" 
>&5
+printf "%s\n" "$ax_cv_check_cflags__" >&6; }
+if test "x$ax_cv_check_cflags__" = xyes
+then :
+  :
+else $as_nop
+  :
+fi
+
+
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -12642,17 +12681,45 @@ fi
                use_persistent_malloc=yes
                case $host_os in
                linux-*)
-                       case $CC in
-                       gcc | clang)
-                               LDFLAGS="${LDFLAGS} -no-pie"
+                       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 
whether C compiler accepts -no-pie" >&5
+printf %s "checking whether C compiler accepts -no-pie... " >&6; }
+if test ${ax_cv_check_cflags___no_pie+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS  -no-pie"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ax_cv_check_cflags___no_pie=yes
+else $as_nop
+  ax_cv_check_cflags___no_pie=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 
$ax_cv_check_cflags___no_pie" >&5
+printf "%s\n" "$ax_cv_check_cflags___no_pie" >&6; }
+if test "x$ax_cv_check_cflags___no_pie" = xyes
+then :
+  LDFLAGS="${LDFLAGS} -no-pie"
                                export LDFLAGS
-                               ;;
-                       *)
-                               # tinycc and pcc don't support -no-pie flag
-                               # their executables are non-PIE automatically
-                               # so no need to do anything
-                               ;;
-                       esac
+else $as_nop
+  :
+fi
+
                        ;;
                *darwin*)
                        LDFLAGS="${LDFLAGS} -Xlinker -no_pie"
diff --git a/doc/Makefile.in b/doc/Makefile.in
index b6dd6a1d..31a03039 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -115,6 +115,7 @@ host_triplet = @host@
 subdir = doc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
diff --git a/extras/Makefile.in b/extras/Makefile.in
index 9ee6e9cd..50acff06 100644
--- a/extras/Makefile.in
+++ b/extras/Makefile.in
@@ -114,6 +114,7 @@ host_triplet = @host@
 subdir = extras
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 6addbf1a..43625699 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-23         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * pma.m4: Use AX_CHECK_COMPILE_FLAG to look for -no-pie instead
+       of hardcoding gcc and clang. Thanks to Sam James <sam@gentoo.org>
+       for the suggestion.
+       * ax_check_compile_flag.m4: New file.
+
 2022-08-11         Arnold D. Robbins     <arnold@skeeve.com>
 
        * pma.m4: Logic fix. Don't define USE_PERSITENT_MALLOC until
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 00000000..bd753b34
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], 
[EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the current language's compiler
+#   or gives an error.  (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 6
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+    [AS_VAR_SET(CACHEVAR,[yes])],
+    [AS_VAR_SET(CACHEVAR,[no])])
+  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/pma.m4 b/m4/pma.m4
index fff9a68d..96620ca5 100644
--- a/m4/pma.m4
+++ b/m4/pma.m4
@@ -7,6 +7,7 @@ dnl Decide whether or not to use the persistent memory allocator
 
 AC_DEFUN([GAWK_USE_PERSISTENT_MALLOC],
 [
+AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
 AC_CHECK_SIZEOF([void *])
 use_persistent_malloc=no
 if test "$SKIP_PERSIST_MALLOC" = no && test $ac_cv_sizeof_void_p -eq 8
@@ -18,17 +19,9 @@ then
                use_persistent_malloc=yes
                case $host_os in
                linux-*)
-                       case $CC in
-                       gcc | clang)
-                               LDFLAGS="${LDFLAGS} -no-pie"
-                               export LDFLAGS
-                               ;;
-                       *)
-                               # tinycc and pcc don't support -no-pie flag
-                               # their executables are non-PIE automatically
-                               # so no need to do anything
-                               ;;
-                       esac
+                       AX_CHECK_COMPILE_FLAG([-no-pie],
+                               [LDFLAGS="${LDFLAGS} -no-pie"
+                               export LDFLAGS])
                        ;;
                *darwin*)
                        LDFLAGS="${LDFLAGS} -Xlinker -no_pie"
diff --git a/support/Makefile.in b/support/Makefile.in
index bfa2e9fa..b25e5561 100644
--- a/support/Makefile.in
+++ b/support/Makefile.in
@@ -116,6 +116,7 @@ host_triplet = @host@
 subdir = support
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
diff --git a/test/Makefile.in b/test/Makefile.in
index c8edbb43..6aa3badb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -113,6 +113,7 @@ host_triplet = @host@
 subdir = test
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
+       $(top_srcdir)/m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                 |  1 +
 aclocal.m4                  |  1 +
 awklib/Makefile.in          |  1 +
 configure                   | 87 +++++++++++++++++++++++++++++++++++++++------
 doc/Makefile.in             |  1 +
 extras/Makefile.in          |  1 +
 m4/ChangeLog                |  7 ++++
 m4/ax_check_compile_flag.m4 | 53 +++++++++++++++++++++++++++
 m4/pma.m4                   | 15 +++-----
 support/Makefile.in         |  1 +
 test/Makefile.in            |  1 +
 11 files changed, 148 insertions(+), 21 deletions(-)
 create mode 100644 m4/ax_check_compile_flag.m4


hooks/post-receive
-- 
gawk



reply via email to

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