summaryrefslogtreecommitdiff
path: root/m4/ax_append_flag.m4
diff options
context:
space:
mode:
authorBastien ROUCARIÈS <roucaries.bastien@gmail.com>2015-01-06 19:02:59 +0100
committerBastien ROUCARIÈS <roucaries.bastien@gmail.com>2015-01-06 19:02:59 +0100
commit0ea2e334bf02043ced62b053aea5ee372d73ba36 (patch)
treee9378157d1d6620f94710d46b367765766ea2a1d /m4/ax_append_flag.m4
parent1a869696e4129279f7b99c3f9052717354b79a86 (diff)
downloadautoconf-archive-0ea2e334bf02043ced62b053aea5ee372d73ba36.tar.gz
Add case of variable contain $1 at end of FLAG
Current case does not test if $1 was just added
Diffstat (limited to 'm4/ax_append_flag.m4')
-rw-r--r--m4/ax_append_flag.m410
1 files changed, 4 insertions, 6 deletions
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
index 8ec21bd..d26286c 100644
--- a/m4/ax_append_flag.m4
+++ b/m4/ax_append_flag.m4
@@ -49,24 +49,22 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 3
+#serial 4
AC_DEFUN([AX_APPEND_FLAG],
[dnl
AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
-_ax_append_flag_tmp_rspace=" $1"
-_ax_append_flag_tmp_rlspace=" $1 "
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
AS_CASE([AS_VAR_GET(FLAGS)],
- [*$_ax_append_flag_tmp_rlspace*],[AC_RUN_LOG([: FLAGS already contains $1])],
+ ["* $1 *|*$1"],[AC_RUN_LOG([: FLAGS already contains $1])],
[
- AS_VAR_APPEND(FLAGS,$_ax_append_flag_tmp_rspace)
+ AS_VAR_APPEND(FLAGS," $1")
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
],
[
- AS_VAR_SET(FLAGS,["$1"])
+ AS_VAR_SET(FLAGS,[$1])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
AS_VAR_POPDEF([FLAGS])dnl