[nasm:nasm-2.15.xx] autoconf: add success/failure code options to PA_ADD_*FLAGS

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Thu Jul 9 19:30:04 PDT 2020


Commit-ID:  89563d78b2e35257aab68f262dc27446b5f273e8
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=89563d78b2e35257aab68f262dc27446b5f273e8
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Thu, 9 Jul 2020 19:25:41 -0700
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Thu, 9 Jul 2020 19:25:41 -0700

autoconf: add success/failure code options to PA_ADD_*FLAGS

Allow code to be executed in the success or failure scenatios of
PA_ADD_*FLAGS.

Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>


---
 autoconf/m4/pa_add_cflags.m4  | 4 ++--
 autoconf/m4/pa_add_flags.m4   | 8 +++++---
 autoconf/m4/pa_add_ldflags.m4 | 4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/autoconf/m4/pa_add_cflags.m4 b/autoconf/m4/pa_add_cflags.m4
index fc2223cb..26d55c4a 100644
--- a/autoconf/m4/pa_add_cflags.m4
+++ b/autoconf/m4/pa_add_cflags.m4
@@ -1,9 +1,9 @@
 dnl --------------------------------------------------------------------------
-dnl PA_ADD_CFLAGS(variable, flag [,actual_flag])
+dnl PA_ADD_CFLAGS(variable, flag [,actual_flag [,success [,failure]]]])
 dnl
 dnl Attempt to add the given option to xFLAGS, if it doesn't break
 dnl compilation.  If the option to be tested is different than the
 dnl option that should actually be added, add the option to be
 dnl actually added as a second argument.
 dnl --------------------------------------------------------------------------
-AC_DEFUN([PA_ADD_CFLAGS], [PA_ADD_FLAGS(CFLAGS, [$1], [$2])])
+AC_DEFUN([PA_ADD_CFLAGS], [PA_ADD_FLAGS(CFLAGS, [$1], [$2], [$3], [$4])])
diff --git a/autoconf/m4/pa_add_flags.m4 b/autoconf/m4/pa_add_flags.m4
index 5a88d16d..42b7781a 100644
--- a/autoconf/m4/pa_add_flags.m4
+++ b/autoconf/m4/pa_add_flags.m4
@@ -1,5 +1,5 @@
 dnl --------------------------------------------------------------------------
-dnl PA_ADD_FLAGS(variable, flag [,actual_flag])
+dnl PA_ADD_FLAGS(variable, flag [,actual_flag [,success [,failure]]])
 dnl
 dnl Attempt to add the given option to CPPFLAGS, if it doesn't break
 dnl compilation.  If the option to be tested is different than the
@@ -15,6 +15,8 @@ AC_DEFUN([PA_ADD_FLAGS],
  [AC_MSG_RESULT([yes])
   $1="$pa_add_flags__old_flags ifelse([$3],[],[$2],[$3])"
   AC_DEFINE(PA_SYM([$1_],[$2]), 1,
-   [Define to 1 if compiled with the `$2' compiler flag])],
+   [Define to 1 if compiled with the `$2' compiler flag])
+  $4],
  [AC_MSG_RESULT([no])
-  $1="$pa_add_flags__old_flags"])])
+  $1="$pa_add_flags__old_flags"
+  $5])])
diff --git a/autoconf/m4/pa_add_ldflags.m4 b/autoconf/m4/pa_add_ldflags.m4
index 0a80d348..96adc766 100644
--- a/autoconf/m4/pa_add_ldflags.m4
+++ b/autoconf/m4/pa_add_ldflags.m4
@@ -1,9 +1,9 @@
 dnl --------------------------------------------------------------------------
-dnl PA_ADD_LDFLAGS(variable, flag [,actual_flag])
+dnl PA_ADD_LDFLAGS(variable, flag [,actual_flag [,success [,failure]]]])
 dnl
 dnl Attempt to add the given option to xFLAGS, if it doesn't break
 dnl compilation.  If the option to be tested is different than the
 dnl option that should actually be added, add the option to be
 dnl actually added as a second argument.
 dnl --------------------------------------------------------------------------
-AC_DEFUN([PA_ADD_LDFLAGS], [PA_ADD_FLAGS(LDFLAGS, [$1], [$2])])
+AC_DEFUN([PA_ADD_LDFLAGS], [PA_ADD_FLAGS(LDFLAGS, [$1], [$2], [$3], [$4])])


More information about the Nasm-commits mailing list