From a199f247a4cfd951b1135f745049f1da020cb0e1 Mon Sep 17 00:00:00 2001 From: Daniel Mierswa Date: Tue, 2 Feb 2010 21:46:15 +0100 Subject: [PATCH] Make VLC_ADD_* capable of handling multiple plugins. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Loop during autoconf since we always use fixed strings for the first parameter anyway. Probably saves some runtime too ;). Signed-off-by: Daniel Mierswa Signed-off-by: Rémi Denis-Courmont --- m4/vlc.m4 | 62 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/m4/vlc.m4 b/m4/vlc.m4 index 46b10214e7..38fd988057 100644 --- a/m4/vlc.m4 +++ b/m4/vlc.m4 @@ -11,58 +11,60 @@ AC_DEFUN([VLC_ADD_BUILTINS], [ ]) AC_DEFUN([VLC_ADD_PLUGIN], [ - PLUGINS="${PLUGINS} $1" - AC_SUBST([LTLIB$1], ["lib$1_plugin.la"]) + m4_foreach_w([element], [$1], [ + [PLUGINS="${PLUGINS} ]element["] + AC_SUBST([LTLIB]element, [lib]element[_plugin.la]) + ]) ]) dnl Special cases: vlc, pics, plugins, save AC_DEFUN([VLC_ADD_CPPFLAGS], [ - for element in [$1]; do - eval "CPPFLAGS_${element}="'"$'"{CPPFLAGS_${element}} $2"'"' - am_modules_with_cppflags="${am_modules_with_cppflags} ${element}" - done + m4_foreach_w([element], [$1], [ + [CPPFLAGS_]element[="${CPPFLAGS_]element[} $2"] + [am_modules_with_cppflags="${am_modules_with_cppflags} ]element["] + ]) ]) AC_DEFUN([VLC_ADD_CFLAGS], [ - for element in [$1]; do - eval "CFLAGS_${element}="'"$'"{CFLAGS_${element}} $2"'"' - am_modules_with_cflags="${am_modules_with_cflags} ${element}" - done + m4_foreach_w([element], [$1], [ + [CFLAGS_]element[="${CFLAGS_]element[} $2"] + [am_modules_with_cflags="${am_modules_with_cflags} ]element["] + ]) ]) AC_DEFUN([VLC_ADD_CXXFLAGS], [ - for element in [$1]; do - eval "CXXFLAGS_${element}="'"$'"{CXXFLAGS_${element}} $2"'"' - am_modules_with_cxxflags="${am_modules_with_cxxflags} ${element}" - done + m4_foreach_w([element], [$1], [ + [CXXFLAGS_]element[="${CXXFLAGS_]element[} $2"] + [am_modules_with_cxxflags="${am_modules_with_cxxflags} ]element["] + ]) ]) AC_DEFUN([VLC_ADD_OBJCFLAGS], [ - for element in [$1]; do - eval "OBJCFLAGS_${element}="'"$'"{OBJCFLAGS_${element}} $2"'"' - am_modules_with_objcflags="${am_modules_with_objcflags} ${element}" - done + m4_foreach_w([element], [$1], [ + [OBJCFLAGS_]element[="${OBJCFLAGS_]element[} $2"] + [am_modules_with_objcflags="${am_modules_with_objcflags} ]element["] + ]) ]) AC_DEFUN([VLC_ADD_LDFLAGS], [ - for element in [$1]; do - eval "LDFLAGS_${element}="'"'"$2 "'$'"{LDFLAGS_${element}} "'"' - am_modules_with_ldflags="${am_modules_with_ldflags} ${element}" - done + m4_foreach_w([element], [$1], [ + [LDFLAGS_]element[="${LDFLAGS_]element[} $2"] + [am_modules_with_ldflags="${am_modules_with_ldflags} ]element["] + ]) ]) AC_DEFUN([VLC_ADD_LIBS], [ - for element in [$1]; do - eval "LIBS_${element}="'"'"$2 "'$'"{LIBS_${element}} "'"' - am_modules_with_libs="${am_modules_with_libs} ${element}" - done + m4_foreach_w([element], [$1], [ + [LIBS_]element[="${LIBS_]element[} $2"] + [am_modules_with_libs="${am_modules_with_libs} ]element["] + ]) ]) AC_DEFUN([VLC_SET_CFLAGS_WERROR], [ - for element in [$1]; do - eval "CFLAGS_WERROR_${element}="'"'"$2"'"' - am_modules_with_werror="${am_modules_with_werror} ${element}" - done + m4_foreach_w([element], [$1], [ + [CFLAGS_WERROR_]element[="${CFLAGS_WERROR_]element[} $2"] + [am_modules_with_werror="${am_modules_with_werror} ]element["] + ]) ]) dnl =========================================================================== -- 2.39.2