Commit f2d0f7fe authored by Kenneth Raffenetti's avatar Kenneth Raffenetti Committed by Pavan Balaji
Browse files

build-system: fix prepend/append flag macros



Contains 2 fixes:

  1. Use double quotes in grep expressions so variable expansion takes place.
  2. Tweak grep expressions so a substring match will not cause to new flag to
     be incorrectly de-duped.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent d04c8a1e
...@@ -64,7 +64,7 @@ dnl argument is already present in the variable ...@@ -64,7 +64,7 @@ dnl argument is already present in the variable
AC_DEFUN([PAC_APPEND_FLAG],[ AC_DEFUN([PAC_APPEND_FLAG],[
AC_REQUIRE([AC_PROG_FGREP]) AC_REQUIRE([AC_PROG_FGREP])
AS_IF( AS_IF(
[echo "$$2" | $FGREP -e '$1' >/dev/null 2>&1], [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1],
[echo "$2(='$$2') contains '$1', not appending" >&AS_MESSAGE_LOG_FD], [echo "$2(='$$2') contains '$1', not appending" >&AS_MESSAGE_LOG_FD],
[echo "$2(='$$2') does not contain '$1', appending" >&AS_MESSAGE_LOG_FD [echo "$2(='$$2') does not contain '$1', appending" >&AS_MESSAGE_LOG_FD
$2="$$2 $1"] $2="$$2 $1"]
...@@ -80,7 +80,7 @@ dnl should be added in reverse order. ...@@ -80,7 +80,7 @@ dnl should be added in reverse order.
AC_DEFUN([PAC_PREPEND_FLAG],[ AC_DEFUN([PAC_PREPEND_FLAG],[
AC_REQUIRE([AC_PROG_FGREP]) AC_REQUIRE([AC_PROG_FGREP])
AS_IF( AS_IF(
[echo "$$2" | $FGREP -e '$1' >/dev/null 2>&1], [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1],
[echo "$2(='$$2') contains '$1', not prepending" >&AS_MESSAGE_LOG_FD], [echo "$2(='$$2') contains '$1', not prepending" >&AS_MESSAGE_LOG_FD],
[echo "$2(='$$2') does not contain '$1', prepending" >&AS_MESSAGE_LOG_FD [echo "$2(='$$2') does not contain '$1', prepending" >&AS_MESSAGE_LOG_FD
$2="$1 $$2"] $2="$1 $$2"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment