From 1ff9e235e7413c7f945cc87cb3d4fe9ab0464d3b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Sat, 14 Jul 2007 09:38:42 +0200 Subject: * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/. (gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter. Don't mix comma- and space-separated lists. Patch from Karel Zak. --- m4/include-exclude-prog.m4 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'm4/include-exclude-prog.m4') diff --git a/m4/include-exclude-prog.m4 b/m4/include-exclude-prog.m4 index 77627ea0e..32447f592 100644 --- a/m4/include-exclude-prog.m4 +++ b/m4/include-exclude-prog.m4 @@ -19,7 +19,7 @@ AC_DEFUN([gl_ADD_PROG], # Usage: gl_REMOVE_PROG([prog_list_var_name], [prog_name]) AC_DEFUN([gl_REMOVE_PROG], [{ - $1=`echo "$$1"|sed 's/\<'"$1"'\>//;s/ */ /g;s/^ *//;s/ *$//'` + $1=`echo "$$1"|sed 's/\<'"$2"'\>//;s/ */ /g;s/^ *//;s/ *$//'` }]) # Given the name of a variable containing a space-separated list of @@ -30,7 +30,7 @@ AC_DEFUN([gl_REMOVE_PROG], # Usage: gl_INCLUDE_EXCLUDE_PROG([prog_list_var_name], [NI_prog1]) AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG], [{ - gl_no_install_progs_default=$2 + gl_no_install_progs_default=`echo "$2"|tr -s , ' '` AC_ARG_ENABLE([install-program], [AS_HELP_STRING([--enable-install-program=PROG_LIST], [install the programs in PROG_LIST (comma-separated, @@ -49,15 +49,18 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG], [gl_no_install_prog=] ) + # Convert to space separated lists. + gl_do_install_prog=`echo "$gl_do_install_prog"|tr -s , ' '` + gl_no_install_prog=`echo "$gl_no_install_prog"|tr -s , ' '` + # For each not-to-be-installed program name, ensure that it's a # valid name, remove it from the list of programs to build/install, # as well as from the list of man pages to install. - extra_programs= - for gl_i in `echo "$gl_no_install_prog"|tr -s , ' '`; do + for gl_i in $gl_no_install_prog; do # Fail upon a request to install and not-install the same program. - case ",$gl_do_install_prog," in - *",$gl_i,"*) AC_MSG_ERROR(['$gl_i' is both included and excluded]) ;; + case " $gl_do_install_prog " in + *" $gl_i "*) AC_MSG_ERROR(['$gl_i' is both included and excluded]) ;; esac gl_msg= @@ -79,7 +82,7 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG], test "$gl_msg" != '' && AC_MSG_WARN([$gl_msg]) done - for gl_i in `echo "$gl_do_install_prog"|tr -s , ' '`; do + for gl_i in $gl_do_install_prog; do case " $gl_no_install_progs_default " in *" $gl_i "*) gl_ADD_PROG([$1], $gl_i) ;; *) AC_MSG_WARN(['$gl_i' is not an optionally-installable program]) ;; -- cgit v1.2.3-54-g00ecf