diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-07-09 19:25:41 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-07-09 19:25:41 -0700 |
commit | 89563d78b2e35257aab68f262dc27446b5f273e8 (patch) | |
tree | 6f0e15294618591385114e1a88fd9e85d8281b25 | |
parent | e8d6bbacd4acf22050e80e87f9b79445523124b9 (diff) | |
download | nasm-89563d78b2e35257aab68f262dc27446b5f273e8.tar.gz |
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@zytor.com>
-rw-r--r-- | autoconf/m4/pa_add_cflags.m4 | 4 | ||||
-rw-r--r-- | autoconf/m4/pa_add_flags.m4 | 8 | ||||
-rw-r--r-- | 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])]) |