macro-ize --with-{clients,servers} and implement --with-tools using the new

macro
This commit is contained in:
Bill Currie 2002-09-17 22:19:14 +00:00
parent ece9660099
commit 317c02539b
17 changed files with 233 additions and 131 deletions

View file

@ -1135,3 +1135,23 @@ for qfn_lib in $2; do
done
AC_SUBST($1_libs)
])
AC_DEFUN(QF_WITH_TARGETS, [
AC_ARG_WITH($1,
[$2]
[$3], $1="$withval", $1=all
)
if test "x${$1}" = "xall"; then
for qf_t in `echo '$3' | sed -e "s/,/ /g"`''; do
eval ENABLE_$1_${qf_t}=yes
done
else
for qf_t in `echo '$3' | sed -e "s/,/ /g"`''; do
if echo ",${clients}," | grep ",$qf_t," > /dev/null; then
eval ENABLE_$1_${qf_t}=yes
else
eval ENABLE_$1_${qf_t}=no
fi
done
fi
])

View file

@ -1464,102 +1464,21 @@ dnl ==================================================================
dnl Find out what to build
dnl ==================================================================
AC_ARG_WITH(clients,
[ --with-clients=<list> compile clients in <list>;
3dfx,fbdev,glx,mgl,sdl,sdl32,sgl,svga,wgl,x11],
clients="$withval",
clients="all"
QF_WITH_TARGETS(
clients,
[ --with-clients=<list> compile clients in <list>:],
[3dfx,fbdev,glx,mgl,sdl,sdl32,sgl,svga,wgl,x11],dummy
)
if test "$clients" = "all"; then
ENABLE_3DFX=yes
ENABLE_FBDEV=yes
ENABLE_GLX=yes
ENABLE_MGL=yes
ENABLE_SDL=yes
ENABLE_SDL32=yes
ENABLE_SGL=yes
ENABLE_SVGA=yes
ENABLE_WGL=yes
ENABLE_X11=yes
else
ENABLE_3DFX=no
ENABLE_FBDEV=no
ENABLE_GLX=no
ENABLE_MGL=no
ENABLE_SDL=no
ENABLE_SDL32=no
ENABLE_SGL=no
ENABLE_SVGA=no
ENABLE_WGL=no
ENABLE_X11=no
IFS=","
for client in $clients; do
case "$client" in
3dfx)
ENABLE_3DFX=yes
;;
fbdev)
ENABLE_FBDEV=yes
;;
glx)
ENABLE_GLX=yes
;;
mgl)
ENABLE_MGL=yes
;;
sdl)
ENABLE_SDL=yes
;;
sdl32)
ENABLE_SDL32=yes
;;
sgl)
ENABLE_SGL=yes
;;
svga)
ENABLE_SVGA=yes
;;
wgl)
ENABLE_WGL=yes
;;
x11)
ENABLE_X11=yes
;;
esac
done
IFS=" "
fi
AC_ARG_WITH(servers,
[ --with-servers=<list> compile dedicated server
master,nq,qw],
servers="$withval",
servers=all
QF_WITH_TARGETS(
servers,
[ --with-servers=<list> compile dedicated server:],
[master,nq,qw],dummy
)
QF_WITH_TARGETS(
tools,
[ --with-tools=<list> compile qf tools:],
[pak,qfcc,qfdefs,qflight,qfmodelgen,qfprogs,qfvis,qwaq,wav],dummy
)
if test "$servers" = "all"; then
ENABLE_NQ_SERVER=yes
ENABLE_QW_MASTER=yes
ENABLE_QW_SERVER=yes
else
ENABLE_NQ_SERVER=no
ENABLE_QW_MASTER=no
ENABLE_QW_SERVER=no
IFS=","
for server in $servers; do
case "$server" in
nq)
ENABLE_NQ_SERVER=yes
;;
master)
ENABLE_QW_MASTER=yes
;;
qw)
ENABLE_QW_SERVER=yes
;;
esac
done
IFS=" "
fi
unset CL_TARGETS
QW_TARGETS=""
@ -1582,7 +1501,7 @@ VID_REND_NOINST_TARGETS=""
VID_TARGETS=""
if test "x$HAVE_FBDEV" = xyes; then
if test "x$ENABLE_FBDEV" = xyes; then
if test "x$ENABLE_clients_fbdev" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-fbdev\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-fbdev\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS FBDEV"
@ -1597,7 +1516,7 @@ fi
if test "x$HAVE_X" = xyes; then
CAN_BUILD_GL=yes
CAN_BUILD_SW=yes
if test "x$ENABLE_GLX" = xyes; then
if test "x$ENABLE_clients_glx" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-glx\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-glx\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS GLX"
@ -1607,7 +1526,7 @@ if test "x$HAVE_X" = xyes; then
QF_NEED(qw, [client common net])
QF_NEED(nq, [client common net])
fi
if test "x$ENABLE_X11" = xyes; then
if test "x$ENABLE_clients_x11" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-x11\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-x11\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS X11"
@ -1619,7 +1538,7 @@ if test "x$HAVE_X" = xyes; then
fi
fi
if test "x$HAVE_MGL" = xyes; then
if test "x$ENABLE_MGL" = xyes; then
if test "x$ENABLE_clients_mgl" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-mgl\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-mgl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS MGL"
@ -1632,7 +1551,7 @@ if test "x$HAVE_MGL" = xyes; then
CAN_BUILD_SW=yes
fi
if test "x$HAVE_SDL" = xyes; then
if test "x$ENABLE_SDL" = xyes; then
if test "x$ENABLE_clients_sdl" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-sdl\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-sdl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SDL"
@ -1643,7 +1562,7 @@ if test "x$HAVE_SDL" = xyes; then
QF_NEED(nq, [client common net sdl])
fi
CAN_BUILD_SW=yes
if test "x$ENABLE_SDL32" = xyes; then
if test "x$ENABLE_clients_sdl32" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-sdl32\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-sdl32\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SDL32"
@ -1654,7 +1573,7 @@ if test "x$HAVE_SDL" = xyes; then
QF_NEED(nq, [client common net sdl])
fi
CAN_BUILD_SW32=yes
if test "x$ENABLE_SGL" = xyes; then
if test "x$ENABLE_clients_sgl" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-sgl\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-sgl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SDL-GL"
@ -1667,7 +1586,7 @@ if test "x$HAVE_SDL" = xyes; then
fi
fi
if test "x$HAVE_SVGA" = xyes; then
if test "x$ENABLE_SVGA" = xyes; then
if test "x$ENABLE_clients_svga" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-svga\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-svga\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SVGAlib"
@ -1678,7 +1597,7 @@ if test "x$HAVE_SVGA" = xyes; then
QF_NEED(nq, [client common net])
fi
CAN_BUILD_SW=yes
if test "x$ENABLE_3DFX" = xyes; then
if test "x$ENABLE_clients_3dfx" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-3dfx\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-3dfx\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS 3dfx"
@ -1691,7 +1610,7 @@ if test "x$HAVE_SVGA" = xyes; then
CAN_BUILD_GL=yes
fi
if test "x$mingw" = xyes; then
if test "x$ENABLE_WGL" = xyes; then
if test "x$ENABLE_clients_wgl" = xyes; then
QW_TARGETS="$QW_TARGETS qw-client-wgl\$(EXEEXT)"
NQ_TARGETS="$NQ_TARGETS nq-wgl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS WGL"
@ -1705,21 +1624,70 @@ if test "x$mingw" = xyes; then
fi
unset SV_TARGETS
if test "x$ENABLE_NQ_SERVER" = xyes; then
if test "x$ENABLE_servers_nq" = xyes; then
NQ_TARGETS="nq-server\$(EXEEXT) $NQ_TARGETS"
SV_TARGETS="$SV_TARGETS nq"
QF_NEED(nq, [common net server])
fi
if test "x$ENABLE_QW_MASTER" = xyes; then
if test "x$ENABLE_servers_master" = xyes; then
QW_TARGETS="qw-master\$(EXEEXT) $QW_TARGETS"
SV_TARGETS="$SV_TARGETS master"
fi
if test "x$ENABLE_QW_SERVER" = xyes; then
if test "x$ENABLE_servers_qw" = xyes; then
QW_TARGETS="qw-server\$(EXEEXT) $QW_TARGETS"
SV_TARGETS="$SV_TARGETS qw"
QF_NEED(qw, [common net server])
fi
unset PAK_TARGETS
unset QFCC_TARGETS
unset QFDEFS_TARGETS
unset QFLIGHT_TARGETS
unset QFMODELGEN_TARGETS
unset QFPROGS_TARGETS
unset QFVIS_TARGETS
unset QWAQ_TARGETS
unset WAV_TARGETS
unset TOOLS_TARGETS
if test "x$ENABLE_tools_pak" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS pak"
fi
if test "x$ENABLE_tools_qfcc" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qfcc"
fi
if test "x$ENABLE_tools_qfdefs" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qfdefs"
fi
if test "x$ENABLE_tools_qflight" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qflight"
fi
if test "x$ENABLE_tools_qfmodelgen" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qfmodelgen"
fi
if test "x$ENABLE_tools_qfprogs" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qfprogs"
fi
if test "x$ENABLE_tools_qfvis" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qfvis"
fi
if test "x$ENABLE_tools_qwaq" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS qwaq"
fi
if test "x$ENABLE_tools_wav" = xyes; then
TOOLS_TARGETS="$TOOLS_TARGETS wav"
fi
AM_CONDITIONAL(BUILD_PAK, test "$ENABLE_tools_pak" = "yes")
AM_CONDITIONAL(BUILD_QFCC, test "$ENABLE_tools_qfcc" = "yes")
AM_CONDITIONAL(BUILD_QFDEFS, test "$ENABLE_tools_qfdefs" = "yes")
AM_CONDITIONAL(BUILD_QFLIGHT, test "$ENABLE_tools_qflight" = "yes")
AM_CONDITIONAL(BUILD_QFMODELGEN, test "$ENABLE_tools_qfmodelgen" = "yes")
AM_CONDITIONAL(BUILD_QFPROGS, test "$ENABLE_tools_qfprogs" = "yes")
AM_CONDITIONAL(BUILD_QFVIS, test "$ENABLE_tools_qfvis" = "yes")
AM_CONDITIONAL(BUILD_QWAQ, test "$ENABLE_tools_qwaq" = "yes" -a "$ENABLE_tools_qfcc" = "yes")
AM_CONDITIONAL(BUILD_WAV, test "$ENABLE_tools_wav" = "yes")
AM_CONDITIONAL(BUILD_RUAMOKO, test "$ENABLE_tools_qfcc" = "yes" -a "$ENABLE_tools_pak" = "yes")
if test "x$BUILD_SW" = xyes; then
VID_REND_NOINST_TARGETS="$VID_REND_NOINST_TARGETS libQFrenderer_sw.la"
VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_sw.la"
@ -2095,6 +2063,7 @@ AC_MSG_RESULT([
Build type :$BUILD_TYPE
Server support :${SV_TARGETS- no}
Client support :${CL_TARGETS- no}
Tools support :${TOOLS_TARGETS- no}
Sound support :${SOUND_TYPES- no}
CD Audio system :${CDTYPE- no}
IPv6 networking : $NETTYPE_IPV6

View file

@ -17,7 +17,16 @@ GZ=
endif
STRIP=$(shell echo `echo -n $(srcdir)/ | sed -e 's/[^/]//g' | wc -c`)
pkgdata_DATA= menu.dat$(GZ)
menu_data=menu.dat$(GZ)
if BUILD_RUAMOKO
data=$(menu_data)
else
data=
endif
pkgdata_DATA= $(data)
EXTRA_DATA= $(menu_data)
menu_src= \
client_menu.qc controls_o.qc \

View file

@ -10,7 +10,14 @@ QCFLAGS=-qq -g -Werror
QCPPFLAGS=-I. -I$(srcdir) -I$(top_builddir)/ruamoko/include -I$(top_srcdir)/ruamoko/include
STRIP=$(shell echo `echo -n $(srcdir)/ | sed -e 's/[^/]//g' | wc -c`)
pkgdata_DATA= game.dat
if BUILD_RUAMOKO
data=game.dat
else
data=
endif
pkgdata_DATA= $(data)
EXTRA_DATA= game.dat
game_src= Axe.r GameEntity.r World.r tempent.r

View file

@ -8,7 +8,15 @@ RANLIB=touch
INCLUDES= -I$(top_srcdir)/ruamoko/include -I$(top_srcdir)/include
noinst_LIBRARIES= libr.a libgui.a libcsqc.a
ruamoko_libs=libr.a libgui.a libcsqc.a
if BUILD_RUAMOKO
libs=$(ruamoko_libs)
else
libs=
endif
noinst_LIBRARIES= $(libs)
EXTRA_LIBRARIES= $(ruamoko_libs)
%.qfo: %.r
$(QFCC) $(QCFLAGS) $(QCPPFLAGS) -c -o $@ $<
@ -30,4 +38,4 @@ libcsqc_a_SOURCES= \
cbuf.r cmd.r cvar.r file.r
libcsqc_a_AR= $(PAK) -cf
CLEANFILES= *.qfo
CLEANFILES= *.qfo *.o

View file

@ -6,12 +6,22 @@ PAK_INCS=@PAK_INCS@
INCLUDES= -I$(top_srcdir)/include $(PAK_INCS)
bin_PROGRAMS= pak
if BUILD_PAK
pak=pak
mans=pak.1
else
pak=
mans=
endif
man_MANS= pak.1
bin_PROGRAMS= $(pak)
EXTRA_PROGRAMS= pak
man_MANS= $(mans)
EXTRA_MANS= pak.1
pak_SOURCES= pak.c
pak_LDADD= $(PAK_LIBS)
pak_DEPENDENCIES= $(PAK_DEPS)
EXTRA_DIST= pak.h pak.1
EXTRA_DIST= pak.h

View file

@ -1,5 +1,10 @@
AUTOMAKE_OPTIONS= foreign
man_MANS=qfcc.1
if BUILD_QFCC
mans=qfcc.1
else
mans=
endif
EXTRA_DIST=$(man_MANS)
man_MANS=$(mans)
EXTRA_MANS=qfcc.1

View file

@ -35,8 +35,17 @@ QFCC_INCS=@QFCC_INCS@
INCLUDES= -I$(top_srcdir)/include $(QFCC_INCS)
YFLAGS = -d
bin_PROGRAMS= qfcc
noinst_PROGRAMS= qfodump
if BUILD_QFCC
qfcc=qfcc
qfodump=qfodump
else
qfcc=
qfodump=
endif
bin_PROGRAMS= $(qfcc)
noinst_PROGRAMS= $(qfodump)
EXTRA_PROGRAMS= qfcc qfodump
qfcc_SOURCES= \
class.c cpp.c debug.c def.c emit.c expr.c function.c idstuff.c \

View file

@ -7,8 +7,17 @@ QFDEFS_INCS=@QFDEFS_INCS@
INCLUDES= -I$(top_srcdir)/include $(QFDEFS_INCS)
GENDEFS=./gendefs
bin_PROGRAMS= qfdefs
noinst_PROGRAMS= gendefs
if BUILD_QFDEFS
qfdefs=qfdefs
gendefs=gendefs
else
qfdefs=
gendefs=
endif
bin_PROGRAMS= $(qfdefs)
noinst_PROGRAMS= $(gendefs)
EXTRA_PROGRAMS= qfdefs gendefs
qfdefs_SOURCES= defs.c defs_nq.c defs_qw.c fix_globals.c qfdefs.c
qfdefs_LDADD= $(QFDEFS_LIBS)

View file

@ -2,6 +2,12 @@ AUTOMAKE_OPTIONS= foreign
SUBDIRS= include source
man_MANS= qflight.1
if BUILD_QFLIGHT
mans=qflight.1
else
mans=
endif
EXTRA_DIST= $(man_MANS)
man_MANS= $(mans)
EXTRA_MANS= qflight.1

View file

@ -6,7 +6,14 @@ QFLIGHT_INCS=@QFLIGHT_INCS@
INCLUDES= -I$(top_srcdir)/include $(QFLIGHT_INCS)
bin_PROGRAMS= qflight
if BUILD_QFLIGHT
qflight=qflight
else
qflight=
endif
bin_PROGRAMS= $(qflight)
EXTRA_PROGRAMS= qflight
qflight_SOURCES= entities.c ltface.c options.c qflight.c threads.c trace.c

View file

@ -6,7 +6,14 @@ QFMODELGEN_INCS=@QFMODELGEN_INCS@
INCLUDES= -I$(top_srcdir)/include $(QFMODELGEN_INCS)
bin_PROGRAMS= qfmodelgen
if BUILD_QFMODELGEN
qfmodelgen=qfmodelgen
else
qfmodelgen=
endif
bin_PROGRAMS= $(qfmodelgen)
EXTRA_PROGRAMS= qfmodelgen
qfmodelgen_SOURCES= cmdlib.c lbmlib.c modelgen.c scriplib.c trilib.c

View file

@ -6,7 +6,14 @@ QFPROGS_INCS=@QFPROGS_INCS@
INCLUDES= -I$(top_srcdir)/include $(QFPROGS_INCS)
bin_PROGRAMS= qfprogs
if BUILD_QFPROGS
qfprogs=qfprogs
else
qfprogs=
endif
bin_PROGRAMS= $(qfprogs)
EXTRA_PROGRAMS= qfprogs
#man_MANS= qfprogs.1

View file

@ -2,6 +2,11 @@ AUTOMAKE_OPTIONS= foreign
SUBDIRS= include source
man_MANS= qfvis.1
if BUILD_QFVIS
mans=qfvis.1
else
mans=
endif
EXTRA_DIST= $(man_MANS)
man_MANS= $(mans)
EXTRA_MANS= qfvis.1

View file

@ -7,7 +7,14 @@ PTHREAD_FLAGS=@PTHREAD_FLAGS@
INCLUDES= -I$(top_srcdir)/include $(QFVIS_INCS)
bin_PROGRAMS= qfvis
if BUILD_QFVIS
qfvis=qfvis
else
qfvis=
endif
bin_PROGRAMS= $(qfvis)
EXTRA_PROGRAMS= qfvis
qfvis_SOURCES= flow.c options.c qfvis.c soundphs.c

View file

@ -7,8 +7,18 @@ INCLUDES= -I$(top_srcdir)/include $(QWAQ_INCS)
QFCC=$(top_builddir)/tools/qfcc/source/qfcc
QCFLAGS=-qq -g -Werror
noinst_PROGRAMS=qwaq
noinst_DATA=qwaq.dat
if BUILD_QWAQ
qwaq=qwaq
data=qwaq.dat
else
qwaq=
data=
endif
noinst_PROGRAMS=$(qwaq)
noinst_DATA=$(data)
EXTRA_PROGRAMS=qwaq
EXTRA_DATA=qwaq.dat
qwaq_dat_src= \
defs.qc main.qc test.r

View file

@ -6,7 +6,14 @@ WAV_INCS=@WAV_INCS@
INCLUDES= -I$(top_srcdir)/include $(WAV_INCS)
bin_PROGRAMS= qfwavinfo
if BUILD_WAV
qfwavinfo=qfwavinfo
else
qfwavinfo=
endif
bin_PROGRAMS= $(qfwavinfo)
EXTRA_PROGRAMS= qfwavinfo
#man_MANS= qfwavinfo.1