Rework QF_PROCESS_NEED to be more general.

QF_PROCESS_NEED has been renamed to QF_PROCESS_NEED_LIBS and its guts have
been moved to QF_PROCESS_NEED_subroutine, with additional modifications to
allow QF_NEED to be used for other targets as well (eg, directories,
executables, etc).
This commit is contained in:
Bill Currie 2012-02-10 01:30:41 +09:00
parent 9281ad8521
commit 717d5368de
2 changed files with 18 additions and 14 deletions

View file

@ -315,9 +315,9 @@ if test "x$BUILD_GLSL" = xyes; then
VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_glsl.la" VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_glsl.la"
fi fi
QF_PROCESS_NEED(vid, [asm common gl glsl sdl sw sw32 svga x11]) QF_PROCESS_NEED_LIBS(vid, [asm common gl glsl sdl sw sw32 svga x11])
QF_PROCESS_NEED(qw, [client common sdl server], a) QF_PROCESS_NEED_LIBS(qw, [client common sdl server], a)
QF_PROCESS_NEED(nq, [client common sdl server], a) QF_PROCESS_NEED_LIBS(nq, [client common sdl server], a)
AC_SUBST(CAN_BUILD_GL) AC_SUBST(CAN_BUILD_GL)
AC_SUBST(CAN_BUILD_GLSL) AC_SUBST(CAN_BUILD_GLSL)

View file

@ -93,19 +93,23 @@ for qfn_lib in $2; do
done done
]) ])
AC_DEFUN([QF_PROCESS_NEED], [ AC_DEFUN([QF_PROCESS_NEED_subroutin], [
if test -n "$3"; then qfn_pref="$1"
qfn_ext="$3" qfn_pref=${qfn_pref:+${qfn_pref}$2_}
else qfn_suf="$3"
qfn_ext=la for qfn_need in $5; do
fi if eval test x'"${$2_need_'${qfn_need}'}"' = xyes; then
for qfn_lib in $2; do qfn_tmp="${$2_$4} ${qfn_pref}${qfn_need}${qfn_suf}"
if eval test x'"${$1_need_'$qfn_lib'}"' = xyes; then eval '$2_$4="$qfn_tmp"'
qfn_tmp="${$1_libs} lib$1_$qfn_lib.$qfn_ext"
eval '$1_libs="$qfn_tmp"'
fi fi
done done
AC_SUBST($1_libs) AC_SUBST([$2_$4])
])
AC_DEFUN([QF_PROCESS_NEED_LIBS], [
qfn_ext="$3"
qfn_ext=${qfn_ext:-la}
QF_PROCESS_NEED_subroutin([lib],[$1],[.${qfn_ext}],[libs],[$2])
]) ])
AC_DEFUN([QF_WITH_TARGETS], [ AC_DEFUN([QF_WITH_TARGETS], [