From 07c618492fa90e210e251363018482aeb2f25b7d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 22 Apr 2012 10:03:52 +0900 Subject: [PATCH] Break out the default plugin code into its own macro. --- m4/quakeforge.m4 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/m4/quakeforge.m4 b/m4/quakeforge.m4 index 446fe85be..2c3139733 100644 --- a/m4/quakeforge.m4 +++ b/m4/quakeforge.m4 @@ -113,14 +113,18 @@ AC_DEFUN([QF_PROCESS_NEED_DIRS], [QF_PROCESS_NEED_subroutine([],[$1],[],[$1_dirs],[$2]) QF_SUBST([$1_dirs])]) -AC_DEFUN([QF_PROCESS_NEED_PLUGINS], -[QF_PROCESS_NEED_subroutine([$1_],[$1],[.la],[$1_plugins],[$2]) -QF_SUBST([$1_plugins]) -m4_define([qfn_default], m4_default($3,$1)[_default]) +AC_DEFUN([QF_DEFAULT_PLUGIN], +[m4_define([qfn_default], m4_default($3,$1)[_default]) if test -z "${qfn_default}"; then QF_PROCESS_NEED_FUNC([$1],[$2],[qfn_default=qfn_need]) fi AC_DEFINE_UNQUOTED(m4_toupper(qfn_default), ["${qfn_default}"], [Define to default the $1 plugin]) +]) + +AC_DEFUN([QF_PROCESS_NEED_PLUGINS], +[QF_PROCESS_NEED_subroutine([$1_],[$1],[.la],[$1_plugins],[$2]) +QF_SUBST([$1_plugins]) +QF_DEFAULT_PLUGIN([$1],[$2],[$3]) AC_DEFINE_UNQUOTED(m4_toupper(m4_default($3,$1)[_plugin_protos]), [], [list of $1 plugin prototypes]) AC_DEFINE_UNQUOTED(m4_toupper(m4_default($3,$1)[_plugin_list]), [{0, 0}], [list of $1 plugins]) ]) @@ -145,11 +149,7 @@ AC_DEFINE_UNQUOTED(m4_toupper([$1_plugin_list]), [${$1_plugin_list}], [list of $ AC_DEFUN([QF_PROCESS_NEED_STATIC_PLUGINS], [QF_PROCESS_NEED_subroutine([$1_],[$1],[.la],m4_default($4,$1)[_static_plugins],[$2]) QF_SUBST(m4_default($4,$1)[_static_plugins]) -m4_define([qfn_default], m4_default($4,$1)[_default]) -if test -z "${qfn_default}"; then - QF_PROCESS_NEED_FUNC([$1],[$2],[qfn_default=qfn_need]) -fi -AC_DEFINE_UNQUOTED(m4_toupper(qfn_default), ["${qfn_default}"], [Define to default the $1 plugin]) +QF_DEFAULT_PLUGIN([$1],[$2],[$4]) QF_STATIC_PLUGIN_LIBS(m4_default($4,$1),[$1],[$2],[$3]) QF_STATIC_PLUGIN_PROTOS(m4_default($4,$1),[$1],[$2]) QF_STATIC_PLUGIN_LIST(m4_default($4,$1),[$1],[$2])])