diff --git a/bootstrap b/bootstrap index 0ded0e893..b2677a226 100755 --- a/bootstrap +++ b/bootstrap @@ -49,10 +49,10 @@ if test -n "$lt" ; then LTIZE_VER_MAJOR=`echo $LTIZE_VER | cut -f1 -d'.'` LTIZE_VER_MINOR=`echo $LTIZE_VER | cut -f2 -d'.' | sed -e 's/[^0-9]//g'` - if test "$LTIZE_VER_MAJOR" -lt "1"; then + if test "$LTIZE_VER_MAJOR" -lt "2"; then errors="Libtool 1.4 or greater needed to build configure.\n$errors" fi - if test "$LTIZE_VER_MAJOR" -eq "1" -a "$LTIZE_VER_MINOR" -lt "4" ; then + if test "$LTIZE_VER_MAJOR" -eq "2" -a "$LTIZE_VER_MINOR" -lt "2" ; then errors="Libtool 1.4 or greater needed to build configure.\n$errors" fi fi @@ -69,11 +69,11 @@ if test -n "$ac" ; then AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'` if test "$AC_VER_MAJOR" -lt "2" ; then - errors="Autoconf 2.52 or greater needed to build configure.\n$errors" + errors="Autoconf 2.67 or greater needed to build configure.\n$errors" fi - if test "$AC_VER_MAJOR" -eq "2" -a "$AC_VER_MINOR" -lt "52" ; then - errors="Autoconf 2.52 or greater needed to build configure.\n$errors" + if test "$AC_VER_MAJOR" -eq "2" -a "$AC_VER_MINOR" -lt "67" ; then + errors="Autoconf 2.67 or greater needed to build configure.\n$errors" fi fi else @@ -89,8 +89,8 @@ if test -n "$am" ; then if test "$AM_VER_MAJOR" -lt "1"; then errors="Automake 1.6 or greater needed to build makefiles.\n$errors" fi - if test "$AM_VER_MAJOR" -eq "1" -a "$AM_VER_MINOR" -lt "6"; then - errors="Automake 1.6 or greater needed to build makefiles.\n$errors" + if test "$AM_VER_MAJOR" -eq "1" -a "$AM_VER_MINOR" -lt "11"; then + errors="Automake 1.11 or greater needed to build makefiles.\n$errors" fi fi else diff --git a/config.d/ac_config_files.m4 b/config.d/ac_config_files.m4 new file mode 100644 index 000000000..32e247c24 --- /dev/null +++ b/config.d/ac_config_files.m4 @@ -0,0 +1,91 @@ + Makefile + + include/Makefile + include/QF/Makefile + + libs/Makefile + libs/audio/Makefile + libs/audio/targets/Makefile + libs/audio/renderer/Makefile + libs/console/Makefile + libs/gamecode/Makefile + libs/gamecode/engine/Makefile + libs/gamecode/builtins/Makefile + libs/gib/Makefile + libs/image/Makefile + libs/models/Makefile + libs/models/alias/Makefile + libs/models/brush/Makefile + libs/models/sprite/Makefile + libs/net/Makefile + libs/net/nc/Makefile + libs/net/nm/Makefile + libs/qw/Makefile + libs/ruamoko/Makefile + libs/util/Makefile + libs/video/Makefile + libs/video/renderer/Makefile + libs/video/renderer/gl/Makefile + libs/video/renderer/sw/Makefile + libs/video/renderer/sw32/Makefile + libs/video/targets/Makefile + + hw/Makefile + hw/include/Makefile + hw/source/Makefile + + nq/Makefile + nq/include/Makefile + nq/source/Makefile + + qtv/Makefile + qtv/include/Makefile + qtv/source/Makefile + + qw/Makefile + qw/include/Makefile + qw/source/Makefile + + tools/Makefile + tools/bsp2img/Makefile + tools/carne/Makefile + tools/pak/Makefile + tools/qfbsp/Makefile + tools/qfbsp/include/Makefile + tools/qfbsp/source/Makefile + tools/qfcc/Makefile + tools/qfcc/doc/Makefile + tools/qfcc/doc/man/Makefile + tools/qfcc/include/Makefile + tools/qfcc/source/Makefile + tools/qflight/Makefile + tools/qflight/include/Makefile + tools/qflight/source/Makefile + tools/qfmodelgen/Makefile + tools/qfmodelgen/include/Makefile + tools/qfmodelgen/source/Makefile + tools/qfvis/Makefile + tools/qfvis/include/Makefile + tools/qfvis/source/Makefile + tools/qwaq/Makefile + tools/qwaq/progs.src + tools/wad/Makefile + tools/wav/Makefile + + ruamoko/Makefile + ruamoko/include/Makefile + ruamoko/lib/Makefile + ruamoko/game/Makefile + ruamoko/gui/Makefile + ruamoko/cl_menu/Makefile + ruamoko/scheme/Makefile + + pkg-config/Makefile + pkg-config/qfcc.pc + pkg-config/quakeforge.pc + + doc/Makefile + doc/quakeforge.dox + doc/man/Makefile + + debian/Makefile diff --git a/config.d/asm.m4 b/config.d/asm.m4 new file mode 100644 index 000000000..79e5ceea8 --- /dev/null +++ b/config.d/asm.m4 @@ -0,0 +1,26 @@ +dnl Check for ia32 +AC_MSG_CHECKING(for an ia32 machine) +case "${host}" in + i?86-*-*) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(to see if we should disable asm optimizations) + AC_ARG_ENABLE(asmopt, + [ --disable-asmopt disable assembler optimization], + AC_MSG_RESULT(yes), + AC_DEFINE(USE_INTEL_ASM, 1, [Define this if you want to use Intel assembly optimizations]) + ASM_ARCH=yes + AC_MSG_RESULT(no) + ) + ;; + *) AC_MSG_RESULT(no) +esac +AM_CONDITIONAL(ASM_ARCH, test "x$ASM_ARCH" = "xyes") + +AC_MSG_CHECKING(for underscore prefix in names) +AC_TRY_LINK( + [asm(".long _bar"); + int bar;], + [], + AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE, 1, [Define this if C symbols are prefixed with an underscore]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) diff --git a/config.d/build_control.m4 b/config.d/build_control.m4 new file mode 100644 index 000000000..33bce3d1c --- /dev/null +++ b/config.d/build_control.m4 @@ -0,0 +1,588 @@ +dnl ================================================================== +dnl Find out what to build +dnl ================================================================== + +QF_WITH_TARGETS( + clients, + [ --with-clients= compile clients in :], + [3dfx,fbdev,glx,mgl,sdl,sdl32,sgl,svga,wgl,x11],dummy +) +QF_WITH_TARGETS( + servers, + [ --with-servers= compile dedicated server:], + [master,nq,qw,qtv],dummy +) +QF_WITH_TARGETS( + tools, + [ --with-tools= compile qf tools:], + [bsp2img,carne,gsc,pak,qfbsp,qfcc,qflight,qfmodelgen,qfvis,qwaq,wad,wav],dummy +) + +unset CL_TARGETS +HW_TARGETS="" +QTV_TARGETS="" +QW_TARGETS="" +NQ_TARGETS="" +QW_DESKTOP_DATA="" +NQ_DESKTOP_DATA="" + +BUILD_GL=no +BUILD_SW32=no +BUILD_SW=no +CAN_BUILD_GL=no +CAN_BUILD_SW32=no +CAN_BUILD_SW=no + +CD_TARGETS="" +SND_PLUGIN_TARGETS="snd_output_disk.la" +SND_REND_TARGETS="" +SND_TARGETS="" +VID_MODEL_TARGETS="" +VID_REND_TARGETS="" +VID_REND_NOINST_TARGETS="" +VID_TARGETS="" + +if test "x$HAVE_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" + VID_TARGETS="$VID_TARGETS libQFfbdev.la" + BUILD_SW=yes + QF_NEED(vid, [common sw]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + CAN_BUILD_SW=yes +fi +if test "x$HAVE_X" = xyes; then + CAN_BUILD_GL=yes + CAN_BUILD_SW=yes + if test "x$ENABLE_clients_glx" = xyes; then + QW_TARGETS="$QW_TARGETS qw-client-glx\$(EXEEXT)" + NQ_TARGETS="$NQ_TARGETS nq-glx\$(EXEEXT)" + QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-glx.desktop" + NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-glx.desktop" + CL_TARGETS="$CL_TARGETS GLX" + VID_TARGETS="$VID_TARGETS libQFglx.la" + BUILD_GL=yes + QF_NEED(vid, [common gl x11]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + if test "x$ENABLE_clients_x11" = xyes; then + QW_TARGETS="$QW_TARGETS qw-client-x11\$(EXEEXT)" + NQ_TARGETS="$NQ_TARGETS nq-x11\$(EXEEXT)" + QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-x11.desktop" + NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-x11.desktop" + CL_TARGETS="$CL_TARGETS X11" + VID_TARGETS="$VID_TARGETS libQFx11.la" + BUILD_SW=yes + QF_NEED(vid, [common sw x11]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi +fi +if test "x$HAVE_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" + VID_TARGETS="$VID_TARGETS libQFwgl.la" + BUILD_SW=yes + QF_NEED(vid, [common sw]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + CAN_BUILD_SW=yes +fi +if test "x$HAVE_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)" + QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sdl.desktop" + NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl.desktop" + CL_TARGETS="$CL_TARGETS SDL" + VID_TARGETS="$VID_TARGETS libQFsdl.la" + BUILD_SW=yes + QF_NEED(vid, [common sdl sw]) + QF_NEED(qw, [client common sdl]) + QF_NEED(nq, [client common sdl]) + QF_NEED(console, [client]) + fi + CAN_BUILD_SW=yes + if test "x$ENABLE_clients_sdl32" = xyes; then + QW_TARGETS="$QW_TARGETS qw-client-sdl32\$(EXEEXT)" + NQ_TARGETS="$NQ_TARGETS nq-sdl32\$(EXEEXT)" + QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sdl32.desktop" + NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl32.desktop" + CL_TARGETS="$CL_TARGETS SDL32" + VID_TARGETS="$VID_TARGETS libQFsdl32.la" + BUILD_SW32=yes + QF_NEED(vid, [common sdl sw32]) + QF_NEED(qw, [client common sdl]) + QF_NEED(nq, [client common sdl]) + QF_NEED(console, [client]) + fi + CAN_BUILD_SW32=yes + if test "x$ENABLE_clients_sgl" = xyes; then + QW_TARGETS="$QW_TARGETS qw-client-sgl\$(EXEEXT)" + NQ_TARGETS="$NQ_TARGETS nq-sgl\$(EXEEXT)" + QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sgl.desktop" + NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sgl.desktop" + CL_TARGETS="$CL_TARGETS SDL-GL" + VID_TARGETS="$VID_TARGETS libQFsgl.la" + BUILD_GL=yes + CAN_BUILD_GL=yes + QF_NEED(vid, [common sdl gl]) + QF_NEED(qw, [client common sdl]) + QF_NEED(nq, [client common sdl]) + QF_NEED(console, [client]) + fi +fi +if test "x$HAVE_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" + VID_TARGETS="$VID_TARGETS libQFsvga.la" + BUILD_SW=yes + QF_NEED(vid, [asm common svga sw]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + CAN_BUILD_SW=yes + 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" + VID_TARGETS="$VID_TARGETS libQFtdfx.la" + BUILD_GL=yes + QF_NEED(vid, [asm common gl svga]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + CAN_BUILD_GL=yes +fi +if test "x$mingw" = 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" + VID_TARGETS="$VID_TARGETS libQFwgl.la" + BUILD_GL=yes + QF_NEED(vid, [common gl]) + QF_NEED(qw, [client common]) + QF_NEED(nq, [client common]) + QF_NEED(console, [client]) + fi + CAN_BUILD_GL=yes +fi + +unset SV_TARGETS +if test "x$ENABLE_servers_nq" = xyes; then + NQ_TARGETS="nq-server\$(EXEEXT) $NQ_TARGETS" + SV_TARGETS="$SV_TARGETS nq" + QF_NEED(nq, [common server]) + QF_NEED(console, [server]) +fi +if test "x$ENABLE_servers_qtv" = xyes; then + QTV_TARGETS="qtv\$(EXEEXT) $QTV_TARGETS" + SV_TARGETS="$SV_TARGETS qtv" +# QF_NEED(qtv, [common server]) + QF_NEED(console, [server]) +fi +if test "x$ENABLE_servers_master" = xyes; then + HW_TARGETS="hw-master\$(EXEEXT) $HW_TARGETS" + QW_TARGETS="qw-master\$(EXEEXT) $QW_TARGETS" + SV_TARGETS="$SV_TARGETS master" +fi +if test "x$ENABLE_servers_qw" = xyes; then + QW_TARGETS="qw-server\$(EXEEXT) $QW_TARGETS" + SV_TARGETS="$SV_TARGETS qw" + QF_NEED(qw, [common server]) + QF_NEED(console, [server]) +fi + +unset TOOLS_TARGETS +if test "x$ENABLE_tools_bsp2img" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS bsp2img" +fi +if test "x$ENABLE_tools_carne" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS carne" +fi +if test "x$ENABLE_tools_gsc" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS gsc" +fi +if test "x$ENABLE_tools_pak" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS pak" +fi +if test "x$ENABLE_tools_qfbsp" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS qfbsp" +fi +if test "x$ENABLE_tools_qfcc" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS qfcc" +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_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_wad" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS wad" +fi +if test "x$ENABLE_tools_wav" = xyes; then + TOOLS_TARGETS="$TOOLS_TARGETS wav" +fi + +AM_CONDITIONAL(BUILD_BSP2IMG, test "$ENABLE_tools_bsp2img" = "yes") +AM_CONDITIONAL(BUILD_CARNE, test "$ENABLE_tools_carne" = "yes") +AM_CONDITIONAL(BUILD_GSC, test "$ENABLE_tools_gsc" = "yes") +AM_CONDITIONAL(BUILD_PAK, test "$ENABLE_tools_pak" = "yes") +AM_CONDITIONAL(BUILD_QFBSP, test "$ENABLE_tools_qfbsp" = "yes") +AM_CONDITIONAL(BUILD_QFCC, test "$ENABLE_tools_qfcc" = "yes") +AM_CONDITIONAL(BUILD_QFLIGHT, test "$ENABLE_tools_qflight" = "yes") +AM_CONDITIONAL(BUILD_QFMODELGEN, test "$ENABLE_tools_qfmodelgen" = "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_WAD, test "$ENABLE_tools_wad" = "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" +fi +if test "x$BUILD_SW32" = xyes; then + VID_REND_TARGETS="$VID_REND_TARGETS libQFrenderer_sw32.la" + if test "x$BUILD_SW" != xyes; then + VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_sw.la" + fi +fi +if test "x$BUILD_GL" = xyes; then + VID_REND_TARGETS="$VID_REND_TARGETS libQFrenderer_gl.la" + VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_gl.la" +fi + +QF_PROCESS_NEED(vid, [asm common gl sdl sw sw32 svga x11]) +QF_PROCESS_NEED(qw, [client common sdl server], a) +QF_PROCESS_NEED(nq, [client common sdl server], a) + +AC_SUBST(CAN_BUILD_GL) +AC_SUBST(CAN_BUILD_SW) +AC_SUBST(CAN_BUILD_SW32) + +AC_SUBST(HAVE_FBDEV) +AC_SUBST(HAVE_SDL) +AC_SUBST(HAVE_SVGA) + +ALSA_PLUGIN="alsa" +if test "`echo $SOUND_TYPES | grep ALSA0_9`"; then + ALSA_PLUGIN="alsa0_9" +fi + +if test -n "$CL_TARGETS"; then + CD_TARGETS="libQFcd.la" + SND_TARGETS="libQFsound.la" + JOY_TARGETS="libQFjs.la" + # the following will catch both ALSA and ALSA0_9 + if test "`echo $SOUND_TYPES | grep ALSA`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_$ALSA_PLUGIN.la" + fi + if test "`echo $SOUND_TYPES | grep MME`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_mme.la" + fi + if test "`echo $SOUND_TYPES | grep OSS`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_oss.la" + fi + if test "`echo $SOUND_TYPES | grep SDL`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sdl.la" + fi + if test "`echo $SOUND_TYPES | grep SGI`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sgi.la" + fi + if test "`echo $SOUND_TYPES | grep SUN`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sun.la" + fi + if test "`echo $SOUND_TYPES | grep Win32`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_win.la" + fi + if test "`echo $SOUND_TYPES | grep DirectX`"; then + SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_dx.la" + fi + if test "$SOUND_TYPES"; then + SND_REND_TARGETS="$SND_REND_TARGETS snd_render_default.la" + if test "`echo $SOUND_TYPES | grep JACK`"; then + SND_REND_TARGETS="$SND_REND_TARGETS snd_render_jack.la" + fi + fi + + # priority sorted list for default sound driver in order of increasing + # priority. default is no driver. + SND_OUTPUT_DEFAULT="" + if test "`echo $SOUND_TYPES | grep SDL`"; then + SND_OUTPUT_DEFAULT="sdl" + fi + if test "`echo $SOUND_TYPES | grep MME`"; then + SND_OUTPUT_DEFAULT="mme" + fi + if test "`echo $SOUND_TYPES | grep SGI`"; then + SND_OUTPUT_DEFAULT="sgi" + fi + if test "`echo $SOUND_TYPES | grep SUN`"; then + SND_OUTPUT_DEFAULT="sun" + fi + if test "`echo $SOUND_TYPES | grep Win32`"; then + SND_OUTPUT_DEFAULT="win" + fi + if test "`echo $SOUND_TYPES | grep DirectX`"; then + SND_OUTPUT_DEFAULT="dx" + fi + if test "`echo $SOUND_TYPES | grep OSS`"; then + SND_OUTPUT_DEFAULT="oss" + fi + if test "`echo $SOUND_TYPES | grep ALSA`"; then + SND_OUTPUT_DEFAULT="$ALSA_PLUGIN" + fi + AC_DEFINE_UNQUOTED(SND_OUTPUT_DEFAULT, "$SND_OUTPUT_DEFAULT", [Define this to the default sound output driver.]) +else + unset CDTYPE + CD_PLUGIN_TARGETS="" + CD_TARGETS="" + JOY_TARGETS="" + SND_PLUGIN_TARGETS="" + SND_REND_TARGETS="" + SND_TARGETS="" + unset SOUND_TYPES +fi +AC_SUBST(ALSA_PLUGIN) + +SERVER_PLUGIN_TARGETS="" +if test x$console_need_server = xyes; then + SERVER_PLUGIN_TARGETS="console_server.la" +fi +SERVER_PLUGIN_STATIC="" +CLIENT_PLUGIN_TARGETS="" +if test x$console_need_client = xyes; then + CLIENT_PLUGIN_TARGETS="console_client.la" +fi +CLIENT_PLUGIN_STATIC="" +CD_PLUGIN_STATIC="" +SND_PLUGIN_STATIC="" +SND_REND_STATIC="" + +if test "x$enable_shared" = xno; then + PREFER_PIC= + PREFER_NON_PIC= +else + PREFER_PIC="-prefer-pic ${VISIBILITY}" + PREFER_NON_PIC="-prefer-non-pic ${VISIBILITY}" +fi +if test "x$enable_static" = xno; then + STATIC= +else + STATIC=-static +fi +AC_SUBST(PREFER_PIC) +AC_SUBST(PREFER_NON_PIC) +AC_SUBST(STATIC) + +AC_ARG_WITH(static-plugins, +[ --with-static-plugins build plugins into executable rather than separate], + static_plugins="$withval", static_plugins=auto) +if test "x$static_plugins" = xauto; then + if test "x$enable_shared" = xno -o "x$SYSTYPE" = xWIN32; then + static_plugins=yes + fi +fi +if test "x$static_plugins" = xyes; then + AC_DEFINE(STATIC_PLUGINS, 1, [Define this if you are building static plugins]) + SERVER_PLUGIN_STATIC="$SERVER_PLUGIN_TARGETS" + SERVER_PLUGIN_TARGETS="" + CLIENT_PLUGIN_STATIC="$CLIENT_PLUGIN_TARGETS" + CLIENT_PLUGIN_TARGETS="" + CD_PLUGIN_STATIC="$CD_PLUGIN_TARGETS" + CD_PLUGIN_TARGETS="" + SND_PLUGIN_STATIC="$SND_PLUGIN_TARGETS" + SND_PLUGIN_TARGETS="" + SND_REND_STATIC="$SND_REND_TARGETS" + SND_REND_TARGETS="" + if test -n "$SOUND_TYPES"; then + SOUND_TYPES="$SOUND_TYPES (static)" + CDTYPE="$CDTYPE (static)" + fi + plugin_ldflags="$plugin_ldflags" +else + plugin_ldflags="$plugin_ldflags"' -version-info $(plugin_version) -rpath $(plugindir)' +fi + +dnl Do not use -module here, it belongs in makefile.am due to automake +dnl needing it there to work correctly +plugin_ldflags="$plugin_ldflags -avoid-version" +SERVER_PLUGIN_STATIC_LIBS="" +CLIENT_PLUGIN_STATIC_LIBS="" +CD_PLUGIN_STATIC_LIBS="" +SND_PLUGIN_STATIC_LIBS="" +SND_REND_STATIC_LIBS="" +SERVER_PLUGIN_LIST="{0, 0}" +CLIENT_PLUGIN_LIST="{0, 0}" +CD_PLUGIN_LIST="{0, 0}" +SND_OUTPUT_LIST="{0, 0}" +SND_RENDER_LIST="{0, 0}" +SERVER_PLUGIN_PROTOS="" +CLIENT_PLUGIN_PROTOS="" +CD_PLUGIN_PROTOS="" +SND_OUTPUT_PROTOS="" +SND_RENDER_PROTOS="" +for l in $SERVER_PLUGIN_STATIC; do + SERVER_PLUGIN_STATIC_LIBS="$SERVER_PLUGIN_STATIC_LIBS "'$(top_builddir)'"/libs/console/$l" + n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" + SERVER_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SERVER_PLUGIN_LIST" + SERVER_PLUGIN_PROTOS="$SERVER_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" +done +for l in $CLIENT_PLUGIN_STATIC; do + CLIENT_PLUGIN_STATIC_LIBS="$CLIENT_PLUGIN_STATIC_LIBS "'$(top_builddir)'"/libs/console/$l" + n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" + CLIENT_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$CLIENT_PLUGIN_LIST" + CLIENT_PLUGIN_PROTOS="$CLIENT_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" +done +for l in $CD_PLUGIN_STATIC; do + CD_PLUGIN_STATIC_LIBS="$CD_PLUGIN_STATIC_LIBS $l" + n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" + CD_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$CD_PLUGIN_LIST" + CD_PLUGIN_PROTOS="$CD_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" +done +for l in $SND_PLUGIN_STATIC; do + SND_PLUGIN_STATIC_LIBS="$SND_PLUGIN_STATIC_LIBS targets/$l" + n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" + SND_OUTPUT_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_OUTPUT_LIST" + SND_OUTPUT_PROTOS="$SND_OUTPUT_PROTOS extern plugin_t *${n}_PluginInfo (void);" +done +for l in $SND_REND_STATIC; do + SND_REND_STATIC_LIBS="$SND_REND_STATIC_LIBS renderer/$l" + n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" + SND_RENDER_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_RENDER_LIST" + SND_RENDER_PROTOS="$SND_RENDER_PROTOS extern plugin_t *${n}_PluginInfo (void);" +done +AC_DEFINE_UNQUOTED(SERVER_PLUGIN_LIST, $SERVER_PLUGIN_LIST, [list of server plugins]) +AC_DEFINE_UNQUOTED(SERVER_PLUGIN_PROTOS, $SERVER_PLUGIN_PROTOS, [list of server prototypes]) +AC_DEFINE_UNQUOTED(CLIENT_PLUGIN_LIST, $CLIENT_PLUGIN_LIST, [list of client plugins]) +AC_DEFINE_UNQUOTED(CLIENT_PLUGIN_PROTOS, $CLIENT_PLUGIN_PROTOS, [list of client prototypes]) +AC_DEFINE_UNQUOTED(CD_PLUGIN_LIST, $CD_PLUGIN_LIST, [list of cd plugins]) +AC_DEFINE_UNQUOTED(CD_PLUGIN_PROTOS, $CD_PLUGIN_PROTOS, [list of cd prototypes]) +AC_DEFINE_UNQUOTED(SND_OUTPUT_LIST, $SND_OUTPUT_LIST, [list of sound output plugins]) +AC_DEFINE_UNQUOTED(SND_OUTPUT_PROTOS, $SND_OUTPUT_PROTOS, [list of sound output prototypes]) +AC_DEFINE_UNQUOTED(SND_RENDER_LIST, $SND_RENDER_LIST, [list of sound render plugins]) +AC_DEFINE_UNQUOTED(SND_RENDER_PROTOS, $SND_RENDER_PROTOS, [list of sound render prototypes]) + +AC_SUBST(HW_TARGETS) +AC_SUBST(NQ_TARGETS) +AC_SUBST(NQ_DESKTOP_DATA) +AC_SUBST(QTV_TARGETS) +AC_SUBST(QW_TARGETS) +AC_SUBST(QW_DESKTOP_DATA) +AC_SUBST(SERVER_PLUGIN_STATIC) +AC_SUBST(SERVER_PLUGIN_STATIC_LIBS) +AC_SUBST(SERVER_PLUGIN_TARGETS) +AC_SUBST(CLIENT_PLUGIN_STATIC) +AC_SUBST(CLIENT_PLUGIN_STATIC_LIBS) +AC_SUBST(CLIENT_PLUGIN_TARGETS) +AC_SUBST(CD_PLUGIN_STATIC) +AC_SUBST(CD_PLUGIN_STATIC_LIBS) +AC_SUBST(CD_PLUGIN_TARGETS) +AC_SUBST(CD_TARGETS) +AC_SUBST(JOY_TARGETS) +AC_SUBST(SND_PLUGIN_STATIC) +AC_SUBST(SND_PLUGIN_STATIC_LIBS) +AC_SUBST(SND_PLUGIN_TARGETS) +AC_SUBST(SND_REND_STATIC) +AC_SUBST(SND_REND_STATIC_LIBS) +AC_SUBST(SND_REND_TARGETS) +AC_SUBST(SND_TARGETS) +AC_SUBST(VID_MODEL_TARGETS) +AC_SUBST(VID_REND_TARGETS) +AC_SUBST(VID_REND_NOINST_TARGETS) +AC_SUBST(VID_TARGETS) +AC_SUBST(plugin_ldflags) +AC_SUBST(plugin_libadd) + +QF_DEPS(BSP2IMG, + [], + [$(top_builddir)/libs/image/libQFimage.la $(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QFBSP, + [-I$(top_srcdir)/tools/qfbsp/include], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QFCC, + [-I$(top_srcdir)/tools/qfcc/include], + [$(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QFLIGHT, + [-I$(top_srcdir)/tools/qflight/include], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QFMODELGEN, + [-I$(top_srcdir)/tools/qfmodelgen/include], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QFVIS, + [-I$(top_srcdir)/tools/qfvis/include], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(QWAQ, + [], + [$(top_builddir)/libs/ruamoko/libQFruamoko.la $(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la $(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la], + [$(WIN32_LIBS)], +) +QF_DEPS(CARNE, + [], + [$(top_builddir)/libs/gib/libQFgib.la $(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(GSC, + [], + [$(top_builddir)/libs/gibscript/libQFgibscript.la $(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(PAK, + [], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(WAD, + [], + [$(top_builddir)/libs/image/libQFimage.la $(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) +QF_DEPS(WAV, + [], + [$(top_builddir)/libs/util/libQFutil.la], + [$(WIN32_LIBS)], +) + +AM_CONDITIONAL(BUILD_GL, test "$BUILD_GL" = "yes") +AM_CONDITIONAL(BUILD_SW, test "$BUILD_SW" = "yes") +AM_CONDITIONAL(BUILD_SW_ASM, test "$BUILD_SW" = "yes" -a "$ASM_ARCH" = "yes") +AM_CONDITIONAL(BUILD_SW_MOD, test "$BUILD_SW" = "yes" -o "$BUILD_SW32" = "yes") +AM_CONDITIONAL(BUILD_SW32, test "$BUILD_SW32" = "yes") diff --git a/config.d/cdrom.m4 b/config.d/cdrom.m4 new file mode 100644 index 000000000..fa2362709 --- /dev/null +++ b/config.d/cdrom.m4 @@ -0,0 +1,83 @@ +dnl ================================================================== +dnl Checks for CD-ROM +dnl ================================================================== + +dnl XMMS Checks +AC_ARG_ENABLE(xmms, +[ --disable-xmms disable checking for XMMS], +) +if test "x$mingw" != xyes -a "x$enable_xmms" != xno; then + AM_PATH_XMMS(0.9.5.1, + HAVE_XMMS=yes, + HAVE_XMMS=no) + AC_SUBST(HAVE_XMMS) +fi +AC_SUBST(CD_CFLAGS) + +CD_CFLAGS="" +if test "x$HAVE_VORBIS" = xyes; then + CD_PLUGIN_TARGETS="cd_file.la" +else + CD_PLUGIN_TARGETS="" +fi +unset CDTYPE + +AC_MSG_CHECKING(for CD audio support) + +dnl Linux +AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef CDROMREADTOCENTRY +QF_maGiC_VALUE +#endif + ], + CDTYPE="$CDTYPE Linux" + CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_linux.la" +) + +dnl XMMS audio +if test "x$HAVE_XMMS" = "xyes"; then + CDTYPE="$CDTYPE XMMS" + CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_xmms.la" + AC_DEFINE(HAVE_XMMS, [1], [Define if you have XMMS]) +fi + +dnl SDL CD audio +if test "x$HAVE_SDL_CD" = "xyes"; then + CDTYPE="$CDTYPE SDL" + CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_sdl.la" +fi + +dnl SGI +AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef CD_READY +QF_maGiC_VALUE +#endif + ], + CDTYPE="$CDTYPE SGI" + CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_sgi.la" + SGI_CD_LIBS="-lcdaudio -lmediad -lds" +) +AC_SUBST(SGI_CD_LIBS) + +AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#include +#if defined(MCI_SET_DOOR_OPEN) +QF_maGiC_VALUE +#endif + ], + CDTYPE="$CDTYPE WIN32" + CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_win.la" +) +if test "$CDTYPE"; then + AC_MSG_RESULT([$CDTYPE]) +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(CD_LIBS) diff --git a/config.d/compiling.m4 b/config.d/compiling.m4 new file mode 100644 index 000000000..7a1e2419c --- /dev/null +++ b/config.d/compiling.m4 @@ -0,0 +1,244 @@ +if test -d $srcdir/.git; then + cvs_def_enabled="!= xno" + cvs_def_disabled="= xyes" +else + cvs_def_enabled="= xyes" + cvs_def_disabled="!= xno" +fi + +AC_ARG_ENABLE(debug, + [ --disable-debug compile without debugging], + debug=$enable_debug +) +AC_MSG_CHECKING(for debugging) +if test "x$debug" != xno; then + AC_MSG_RESULT(yes) + BUILD_TYPE="$BUILD_TYPE Debug" + CFLAGS="$CFLAGS -g" +else + AC_MSG_RESULT(no) +fi + +AC_ARG_ENABLE(optimize, + [ --disable-optimize compile without optimizations (for development)], + optimize=$enable_optimize, + optimize=yes +) +AC_MSG_CHECKING(for optimization) +if test "x$optimize" = xyes; then + AC_MSG_RESULT(yes) + BUILD_TYPE="$BUILD_TYPE Optimize" + if test "x$GCC" = xyes; then + set $CC + shift + args="$*" + AC_MSG_CHECKING(for gcc version) + CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*(GCC)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" + set $CCVER + save_IFS="$IFS" + IFS="." + set $2 + CC_MAJ=$1 + CC_MIN=$2 + CC_SUB=$3 + IFS="$save_IFS" + AC_MSG_RESULT($CCVER) + saved_cflags="$CFLAGS" + CFLAGS="" + QF_CC_OPTION(-frename-registers) + if test "$CC_MAJ" -ge 4; then + QF_CC_OPTION(-finline-limit=32000 -Winline) + fi + heavy="-O2 $CFLAGS -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations" + CFLAGS="$saved_cflags" + light="-O2" + AC_ARG_ENABLE(strict-aliasing, + [ --enable-strict-aliasing enable the -fstrict-aliasing option of gcc]) + if test "x$enable_strict_aliasing" = "xyes"; then + heavy="$heavy -fstrict-aliasing" + light="$light -fstrict-aliasing" + else + if test "x$enable_strict_aliasing" != "xno"; then + if test $CC_MAJ -ge 3; then + heavy="$heavy -fstrict-aliasing" + else + if test $CC_MAJ = 2 -a $CC_MIN = 96; then + light="$light -fno-strict-aliasing" + fi + fi + else + if test $CC_MAJ = 2 -a $CC_MIN = 96; then + light="$light -fno-strict-aliasing" + fi + fi + fi + AC_MSG_CHECKING(for special compiler settings) + AC_ARG_WITH(arch, + [ --with-arch=ARCH control compiler architecture directly], + arch="$withval", arch=auto + ) + case "$arch" in + auto) + case "${host_cpu}" in + i?86) + MORE_CFLAGS="-march=${host_cpu}" + ;; + *) + MORE_CFLAGS="" + ;; + esac + ;; + no|"") + MORE_CFLAGS="" + ;; + *) + MORE_CFLAGS="-march=$arch" + ;; + esac + if test "x$MORE_CFLAGS" = x; then + AC_MSG_RESULT(no) + else + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $MORE_CFLAGS" + AC_TRY_COMPILE( + [], + [], + AC_MSG_RESULT(yes), + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT(no) + ) + fi + if test $CC_MAJ = 2 -a $CC_MIN = 96; then + AC_MSG_CHECKING(if align options work) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2" + AC_TRY_COMPILE( + [], + [], + light="$light -malign-loops=2 -malign-jumps=2 -malign-functions=2" + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + CFLAGS="$save_CFLAGS" + CFLAGS="$CFLAGS $light" + else + CFLAGS="$CFLAGS $heavy" + fi + else + CFLAGS=-O2 + fi +else + AC_MSG_RESULT(no) +fi + +dnl CFLAGS for release and devel versions +AC_ARG_ENABLE(profile, + [ --enable-profile compile with profiling (for development)], + profile=$enable_profile +) +if test "x$profile" = xyes; then + BUILD_TYPE="$BUILD_TYPE Profile" + if test "x$GCC" = xyes; then + CFLAGS="`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'` -pg" + LDFLAGS="$LDFLAGS -pg" + else + CFLAGS="$CFLAGS -p" + fi +fi + +check_pipe=no +if test "x$GCC" = xyes; then + dnl Check for -pipe vs -save-temps. + AC_MSG_CHECKING(for -pipe vs -save-temps) + AC_ARG_ENABLE(save-temps, + [ --enable-save-temps save temporary files], + AC_MSG_RESULT(-save-temps) + CFLAGS="$CFLAGS -save-temps" + BUILD_TYPE="$BUILD_TYPE Save-temps" + , + AC_MSG_RESULT(-pipe) + check_pipe=yes + ) +fi +if test "x$check_pipe" = xyes; then + QF_CC_OPTION(-pipe) +fi +QF_CC_OPTION(-Wsign-compare) +QF_CC_OPTION_TEST([-fvisibility=hidden], [VISIBILITY=-fvisibility=hidden]) + +dnl QuakeForge uses lots of BCPL-style (//) comments, which can cause problems +dnl with many compilers that do not support the latest ISO standards. Well, +dnl that is our cover story -- the reality is that we like them and do not want +dnl to give them up. :) +dnl Make the compiler swallow its pride... +if test "x$GCC" != xyes; then + AC_MSG_CHECKING(for how to deal with BCPL-style comments) + case "${host}" in + *-aix*) + CFLAGS="$CFLAGS -qcpluscmt" + AC_MSG_RESULT([-qcpluscmt]) + ;; + *-irix6*) + CFLAGS="$CFLAGS -Xcpluscomm" + AC_MSG_RESULT([-Xcpluscomm]) + ;; + *-solaris*) + CFLAGS="$CFLAGS -xCC" + AC_MSG_RESULT([-xCC]) + ;; + *) + AC_MSG_RESULT(nothing needed or no switch known) + ;; + esac +fi + +AC_ARG_ENABLE(Werror, +[ --disable-Werror Do not treat warnings as errors] +) +dnl We want warnings, lots of warnings... +dnl The help text should be INVERTED before release! +dnl when in git, this test defaults to ENABLED. +dnl In a release, this test defaults to DISABLED. +if test "x$GCC" = "xyes"; then + if test "x$enable_Werror" $cvs_def_enabled; then + CFLAGS="$CFLAGS -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations" + else + CFLAGS="$CFLAGS -Wall" + fi + CFLAGS="$CFLAGS -fno-common" +fi + +AS="$CC" +if test "x$SYSTYPE" = "xWIN32"; then + ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES) -D_WIN32" + plugin_ldflags="-no-undefined" + plugin_libadd="-luser32 -lgdi32 -lwinmm" + case "$host_os" in + mingw*) + if test "x$host" != "x$build"; then + case "$build_os" in + cygwin*) + plugin_libadd=" -L/usr/lib/w32api $plugin_libadd" + ;; + esac + fi + ;; + esac + +else + ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)" + plugin_ldflags= + plugin_libadd= +fi +ASFLAGS="$ASFLAGS -DQFASM" +CCASFLAGS="$ASFLAGS" +CCAS="$AS" +AC_SUBST(AS) +AC_SUBST(ASFLAGS) +AC_SUBST(CCAS) +AC_SUBST(CCASFLAGS) + +dnl Finalization of CFLAGS, LDFLAGS, and LIBS +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBS) diff --git a/config.d/compression.m4 b/config.d/compression.m4 new file mode 100644 index 000000000..537bf71ac --- /dev/null +++ b/config.d/compression.m4 @@ -0,0 +1,87 @@ +AC_ARG_ENABLE(flac, +[ --disable-flac disable flac support], +) +HAVE_FLAC=no +if test "x$enable_flac" != "xno"; then + AM_PATH_LIBFLAC(HAVE_FLAC=yes, HAVE_FLAC=no) + if test "x$HAVE_FLAC" = xyes; then + AC_DEFINE(HAVE_FLAC, 1, [define this if you have flac libs]) + fi +fi +AM_CONDITIONAL(HAVE_FLAC, test "x$HAVE_FLAC" = "xyes") + +AC_ARG_ENABLE(wildmidi, +[ --disable-wildmidi disable libWildMidi support], +) +HAVE_WILDMIDI=no +WM_LIBS= +if test "x$enable_wildmidi" != "xno"; then + AC_CHECK_LIB(WildMidi, WildMidi_GetString, HAVE_WILDMIDI=yes, HAVE_WILDMIDI=no) + if test "x$HAVE_WILDMIDI" = "xyes"; then + AC_CHECK_HEADER(wildmidi_lib.h, HAVE_WILDMIDI=yes, HAVE_WILDMIDI=no) + if test "x$HAVE_WILDMIDI" = "xyes"; then + WM_LIBS="-lWildMidi" + AC_DEFINE(HAVE_WILDMIDI, 1, [Define if you have WildMidi]) + fi + fi +fi +AC_SUBST(WM_LIBS) +AM_CONDITIONAL(HAVE_MIDI, test "x$HAVE_WILDMIDI" = "xyes") + +AC_ARG_ENABLE(vorbis, +[ --disable-vorbis disable ogg vorbis support], +) +HAVE_VORBIS=no +if test "x$enable_vorbis" != "xno"; then + XIPH_PATH_OGG(HAVE_OGG=yes, HAVE_OGG=no) + if test "x$HAVE_OGG" = xyes; then + XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no) + if test "x$HAVE_VORBIS" = xyes; then + AC_DEFINE(HAVE_VORBIS, 1, [define this if you have ogg/vorbis libs]) + fi + fi +fi +AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBIS" = "xyes") + + +AC_ARG_ENABLE(zlib, [ --disable-zlib disable zlib support]) +HAVE_ZLIB=no +Z_LIBS="" +if test "x$enable_zlib" != "xno"; then + dnl Check for working -lz + dnl Note - must have gztell *and* gzgets in -lz *and* zlib.h + AC_CHECK_LIB(z, gztell, HAVE_ZLIB=yes, HAVE_ZLIB=no, [$LIBS]) + if test "x$HAVE_ZLIB" = "xyes"; then + AC_CHECK_LIB(z, gzgets, HAVE_ZLIB=yes, HAVE_ZLIB=no, [$LIBS]) + if test "x$HAVE_ZLIB" = "xyes"; then + AC_CHECK_HEADER(zlib.h, HAVE_ZLIB=yes, HAVE_ZLIB=no) + if test "x$HAVE_ZLIB" = "xyes"; then + Z_LIBS="-lz" + fi + fi + fi +fi +AC_SUBST(Z_LIBS) +AC_DEFINE(HAVE_ZLIB, 1, [Define if you have zlib]) +AM_CONDITIONAL(HAVE_ZLIB, test "$HAVE_ZLIB" = "yes") + +AC_ARG_ENABLE(png, +[ --disable-png disable png support], +) +HAVE_PNG=no +PNG_LIBS="" +if test "x$enable_png" != "xno"; then + if test "x$PKG_CONFIG" != "x"; then + PKG_CHECK_MODULES([PNG], [libpng], HAVE_PNG=yes, HAVE_PNG=no) + else + AC_CHECK_LIB(png, png_set_read_fn, HAVE_PNG=yes, HAVE_PNG=no, [$LIBS]) + if test "x$HAVE_PNG" = "xyes"; then + AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no) + if test "x$HAVE_PNG" = "xyes"; then + PNG_LIBS="-lpng" + AC_DEFINE(HAVE_PNG, 1, [Define if you have libpng]) + fi + fi + fi +fi +AC_SUBST(PNG_LIBS) diff --git a/config.d/cross_compile.m4 b/config.d/cross_compile.m4 new file mode 100644 index 000000000..66ca372a3 --- /dev/null +++ b/config.d/cross_compile.m4 @@ -0,0 +1,27 @@ +if test "x$cross_compiling" = xyes; then + AC_MSG_CHECKING(whether byte ordering is bigendian) + AC_ARG_WITH(endian, +[ --with-endian=TYPE set endian of target system for + cross-compiling. TYPE = little or big.], + endian="$withval", + ) + case "x$endian" in + xbig) + AC_DEFINE(WORDS_BIGENDIAN) + AC_MSG_RESULT(yes) + ;; + xlittle) + AC_MSG_RESULT(no) + ;; + x) + AC_MSG_RESULT(unspecified, use --with-endian={big,little}) + exit 1 + ;; + x*) + AC_MSG_RESULT(unrecognized endianness) + exit 1 + ;; + esac +else + AC_C_BIGENDIAN +fi diff --git a/config.d/curses.m4 b/config.d/curses.m4 new file mode 100644 index 000000000..80a2b0415 --- /dev/null +++ b/config.d/curses.m4 @@ -0,0 +1,19 @@ +AC_ARG_ENABLE(curses, +[ --disable-curses disable curses support] +) +if test "x$enable_curses" != "xno"; then + AC_CHECK_HEADERS(curses.h) + AC_CHECK_LIB(ncurses, initscr, + CURSES_LIBS=-lncurses, + AC_CHECK_LIB(pdcurses, initscr, + CURSES_LIBS=-lpdcurses, + AC_CHECK_LIB(curses, initscr, + CURSES_LIBS=-lcurses, + CURSES_LIBS= + ) + ) + ) +else + CURSES_LIBS= +fi +AC_SUBST(CURSES_LIBS) diff --git a/config.d/fbdev.m4 b/config.d/fbdev.m4 new file mode 100644 index 000000000..b1e238a4a --- /dev/null +++ b/config.d/fbdev.m4 @@ -0,0 +1,37 @@ +dnl Checks for Linux FBDev support +AC_ARG_WITH(fbdev, +[ --with-fbdev use Linux framebuffer device], +HAVE_FBDEV=$withval, HAVE_FBDEV=auto) +if test "x$HAVE_FBDEV" != xno; then + dnl We should still be able to compile it even if + dnl there is no fbdev support in the running kernel + AC_CHECK_HEADERS(linux/fb.h, HAVE_FBDEV=yes, HAVE_FBDEV=no) +fi + +AC_SUBST(HAVE_FBDEV) +if test "x$HAVE_FBDEV" = xyes; then + AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_VGA4) + AC_TRY_COMPILE( + [#include "linux/fb.h"], + [int foo = FB_AUX_VGA_PLANES_VGA4;], + AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_VGA4, 1, [Define this if you have FB_AUX_VGA_PLANES_VGA4]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_CFB4) + AC_TRY_COMPILE( + [#include "linux/fb.h"], + [int foo = FB_AUX_VGA_PLANES_CFB4;], + AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_CFB4, 1, [Define this if you have FB_AUX_VGA_PLANES_CFB4]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_CFB8) + AC_TRY_COMPILE( + [#include "linux/fb.h"], + [int foo = FB_AUX_VGA_PLANES_CFB8;], + AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_CFB8, 1, [Define this if you have FB_AUX_VGA_PLANES_CFB4]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) +fi diff --git a/config.d/header_files.m4 b/config.d/header_files.m4 new file mode 100644 index 000000000..00d75923a --- /dev/null +++ b/config.d/header_files.m4 @@ -0,0 +1,93 @@ +dnl ================================================================== +dnl Checks for header files. +dnl ================================================================== + +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_HEADER_MAJOR +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS( + alloca.h alsa/asoundlib.h arpa/inet.h asm/io.h assert.h conio.h \ + ctype.h ddraw.h dinput.h direct.h dirent.h dlfcn.h dmedia/audio.h \ + dmedia/cdaudio.h dpmi.h dsound.h errno.h execinfo.h fcntl.h io.h \ + libc.h limits.h linux/cdrom.h linux/joystick.h linux/soundcard.h \ + machine/soundcard.h malloc.h math.h mgraph.h _mingw.h netdb.h \ + netinet/in.h process.h pthread.h pwd.h rpc/types.h setjmp.h signal.h \ + stdarg.h stdio.h stdlib.h string.h strings.h sys/asoundlib.h \ + sys/audioio.h sys/filio.h sys/ioctl.h sys/io.h sys/ipc.h sys/mman.h \ + sys/param.h sys/poll.h sys/shm.h sys/signal.h sys/socket.h \ + sys/soundcard.h sys/stat.h sys/time.h sys/types.h sys/uio.h termios.h \ + time.h unistd.h vgakeyboard.h vgamouse.h windows.h winsock.h +) +if test "x$mingw" = xyes; then + AC_MSG_CHECKING(for fnmatch.h) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FNMATCH_H, 1, [Define this if you have fnmatch.h]) + AC_MSG_CHECKING(for tchar.h) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_TCHAR_H, 1, [Define this if you have tchar.h]) +else + AC_CHECK_HEADERS(fnmatch.h) +fi + +if test "x$ac_cv_header_alloca_h" = no; then + AC_MSG_CHECKING(for alloca in stdlib.h) + AC_TRY_COMPILE( + [#include ], + [void *(*foo)(size_t) = alloca;], + have_alloca_proto=yes + AC_MSG_RESULT(yes), + have_alloca_proto=no + AC_MSG_RESULT(no) + ) +else + AC_MSG_CHECKING(for alloca in alloca.h) + AC_TRY_COMPILE( + [#include ] + [#include ], + [void *(*foo)(size_t) = alloca;], + have_alloca_proto=yes + AC_MSG_RESULT(yes), + have_alloca_proto=no + AC_MSG_RESULT(no) + ) +fi + +if test "x$have_alloca_proto" = xyes; then + AC_DEFINE(HAVE_ALLOCA_PROTO) +fi +AH_VERBATIM([HAVE_ALLOCA_PROTO], +[/* Define this if alloca is prototyped */ +#undef HAVE_ALLOCA_PROTO +#ifndef HAVE_ALLOCA_PROTO +#ifndef QFASM +void *alloca (int size); +#endif +#endif]) + +AC_MSG_CHECKING(for fnmatch in fnmatch.h) +AC_TRY_COMPILE( + [#include "fnmatch.h"], + [int (*foo)() = fnmatch;], + AC_DEFINE(HAVE_FNMATCH_PROTO, 1, [Define this if fnmatch is prototyped in fnmatch.h]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +AC_MSG_CHECKING(for strnlen in string.h) +AC_TRY_COMPILE( + [#include "string.h"], + [int (*foo)() = strnlen;], + AC_DEFINE(HAVE_STRNLEN_PROTO, 1, [Define this if strnlen is prototyped in string.h]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +AC_MSG_CHECKING(for strcasestr in string.h) +AC_TRY_COMPILE( + [#include "string.h"], + [int (*foo)() = strcasestr;], + AC_DEFINE(HAVE_STRCASESTR_PROTO, 1, [Define this if strcasestr is prototyped in string.h]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) diff --git a/config.d/joystick.m4 b/config.d/joystick.m4 new file mode 100644 index 000000000..66ee70866 --- /dev/null +++ b/config.d/joystick.m4 @@ -0,0 +1,25 @@ +dnl Tests for joystick support +AC_MSG_CHECKING(for joystick support) +if test -z "$JOYTYPE" -a "x$ac_cv_header_linux_joystick_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE],[ +#include +#ifdef JS_VERSION +QF_maGiC_VALUE +#endif + ], JOYTYPE="Linux") +fi + +if test -z "$JOYTYPE" -a "x$ac_cv_header_dinput_h" = "xyes"; then + JOYTYPE="Win32" +fi + +if test "$JOYTYPE"; then + AC_MSG_RESULT([$JOYTYPE]) +else + AC_MSG_RESULT([no, using null joystick driver]) +fi +AC_SUBST(JOY_LIBS) +AC_SUBST(JOY_CFLAGS) +AM_CONDITIONAL(JOYTYPE_LINUX, test "$JOYTYPE" = "Linux") +AM_CONDITIONAL(JOYTYPE_WIN32, test "$JOYTYPE" = "Win32") +AM_CONDITIONAL(JOYTYPE_NULL, test "$JOYTYPE" != "Linux" -a "$JOYTYPE" != "Win32") diff --git a/config.d/library_functions.m4 b/config.d/library_functions.m4 new file mode 100644 index 000000000..ea41c22aa --- /dev/null +++ b/config.d/library_functions.m4 @@ -0,0 +1,71 @@ +dnl ================================================================== +dnl Checks for library functions. +dnl ================================================================== + +AC_FUNC_ALLOCA +AC_FUNC_MEMCMP +AC_FUNC_MMAP +AC_TYPE_SIGNAL +AC_FUNC_VPRINTF +AC_FUNC_VA_COPY +AC_FUNC__VA_COPY +AC_CHECK_FUNCS( + access _access gethostname gethostbyname connect gettimeofday getwd \ + mkdir _mkdir ftime _ftime fcntl stat putenv select socket strerror \ + strcasestr strnlen strstr snprintf _snprintf vsnprintf _vsnprintf \ + strsep dlopen getaddrinfo getnameinfo mprotect getpagesize +) + +DL_LIBS="" +if test "x$ac_cv_func_dlopen" != "xyes"; then + AC_CHECK_LIB(dl, dlopen, + AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have the dlopen function.]) DL_LIBS="-ldl" + ) +fi +AC_SUBST(DL_LIBS) + +dnl Checks for stricmp/strcasecmp +#AC_CHECK_FUNC(strcasecmp, +# , +# AC_CHECK_FUNC(stricmp, +# AC_DEFINE(strcasecmp, stricmp) +# ) +#) +AC_CHECK_FUNC(strcasecmp, strcasecmp=yes, strcasecmp=no) +if test "x$strcasecmp" = xno; then + AC_CHECK_FUNC(stricmp, + AC_DEFINE(strcasecmp, stricmp, [Define strcasecmp as stricmp if you have one but not the other]), + AC_MSG_ERROR([Neither stricmp nor strcasecmp found]) + ) +fi + +dnl Check for vsnprintf +if test "x$ac_cv_func_vsnprintf" = "xno" -a \ + "x$ac_cv_func__vsnprintf" = "xno"; then + dnl libdb may have this + AC_CHECK_LIB(db,vsnprintf) +fi + +AC_CHECK_FUNCS(usleep) + +AC_MSG_CHECKING(for fnmatch) +AC_TRY_LINK( + [], + [fnmatch();], + BUILD_FNMATCH=no + AC_MSG_RESULT(yes), + BUILD_FNMATCH=yes + AC_MSG_RESULT(no) +) +AM_CONDITIONAL(BUILD_FNMATCH, test "x$BUILD_FNMATCH" = "xyes") + +AC_MSG_CHECKING(for getopt_long) +AC_TRY_LINK( + [], + [getopt_long();], + BUILD_GETOPT=no + AC_MSG_RESULT(yes), + BUILD_GETOPT=yes + AC_MSG_RESULT(no) +) +AM_CONDITIONAL(BUILD_GETOPT, test "x$BUILD_GETOPT" = "xyes") diff --git a/config.d/mgl.m4 b/config.d/mgl.m4 new file mode 100644 index 000000000..81768b4bd --- /dev/null +++ b/config.d/mgl.m4 @@ -0,0 +1,38 @@ +dnl Checks for MGL support +AC_ARG_WITH(mgl, +[ --with-mgl=DIR use MGL found in DIR], +HAVE_MGL=$withval, HAVE_MGL=auto) +if test "x$HAVE_MGL" != xno; then + if test "x$ac_cv_header_windows_h" != "xyes"; then + HAVE_MGL=no + else + if test "x$HAVE_MGL" != xauto; then + MGL_CFLAGS="$MGL_CFLAGS -I$withval/include" + MGL_LIBS="$MGL_LIBS -L$withval/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $MGL_CFLAGS" + AC_CHECK_HEADER(mgraph.h, HAVE_MGL=yes, HAVE_MGL=no) + CPPFLAGS="$save_CPPFLAGS" + + dnl Make sure -lmgllt or -lmglfx works + if test "x$HAVE_MGL" = xyes; then + for lib in mglfx mgllt; do + MGL_LIBS="$MGL_LIBS -lgdi32 -lwinmm -ldinput -lddraw" + AC_CHECK_LIB($lib, MGL_registerDriver, + MGL_LIBS="-l$lib $MGL_LIBS" + HAVE_MGL=yes + break, + HAVE_MGL=no, + [$MGL_LIBS] + ) + done + fi + fi + if test "x$HAVE_MGL" != xyes; then + MGL_CFLAGS="" MGL_LIBS="" + fi +fi +AC_SUBST(HAVE_MGL) +AC_SUBST(MGL_CFLAGS) +AC_SUBST(MGL_LIBS) diff --git a/config.d/networking.m4 b/config.d/networking.m4 new file mode 100644 index 000000000..09a15f69a --- /dev/null +++ b/config.d/networking.m4 @@ -0,0 +1,79 @@ +dnl ================================================================== +dnl Checks for networking +dnl ================================================================== + +LIBCURL_CHECK_CONFIG([], [], [CURL=yes], []) + +AC_ARG_WITH(ipv6, +[ --with-ipv6=DIR enable IPv6 support. Optional argument specifies + location of inet6 libraries.], + if test "x$withval" = xno ; then + NETTYPE_IPV6=no + else + AC_DEFINE(HAVE_IPV6, 1, [Define this if you want IPv6 support]) + NETTYPE_IPV6=yes + if test "x$withval" != xyes ; then + LIBS="$LIBS -L${withval}" + fi + fi + , + NETTYPE_IPV6=no +) +AM_CONDITIONAL(NETTYPE_IPV6, test "x$NETTYPE_IPV6" = "xyes") + +if test "x$ac_cv_func_connect" != "xyes"; then + AC_CHECK_LIB(socket, connect, + NET_LIBS="$NET_LIBS -lsocket" + ac_cv_func_connect=yes + ) +fi +if test "x$ac_cv_func_gethostbyname" != "xyes"; then + AC_CHECK_LIB(nsl, gethostbyname, + NET_LIBS="$NET_LIBS -lnsl" + ac_cv_func_gethostbyname=yes + ) +fi + +AC_MSG_CHECKING([for connect in -lwsock32]) +SAVELIBS="$LIBS" +LIBS="$LIBS -lwsock32" +AC_TRY_LINK([ +#include +], +[ +connect(0, NULL, 42); +], + NET_LIBS="$NET_LIBS -lwsock32 -lwinmm" + ac_cv_func_connect=yes + ac_cv_func_gethostbyname=yes + HAVE_WSOCK=yes + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +LIBS="$SAVELIBS" + +AC_MSG_CHECKING(for UDP support) +if test "x$ac_cv_func_connect" = "xyes" -a "x$ac_cv_func_gethostbyname" = "xyes"; then + HAVE_UDP=yes + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +if test "x$ac_cv_func_connect" != "xyes"; then + AC_MSG_CHECKING([for connect in -lwsock32]) + SAVELIBS="$LIBS" + LIBS="$LIBS -lwsock32" + AC_TRY_LINK([ +#include + ], + [ +connect (0, NULL, 42); + ], + NET_LIBS="$NET_LIBS -lwsock32 -lwinmm" + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + LIBS="$SAVELIBS" +fi +AC_SUBST(NET_LIBS) diff --git a/config.d/paths.m4 b/config.d/paths.m4 new file mode 100644 index 000000000..4dca07d11 --- /dev/null +++ b/config.d/paths.m4 @@ -0,0 +1,117 @@ +dnl Whether to enable XDG support or not +AC_ARG_ENABLE(xdg, +[ --enable-xdg enable XDG support], + xdg=$enable_xdg, + xdg=no +) +if test "x$xdg" != xno; then + HAVE_XDG=yes +else + HAVE_XDG=no +fi +AM_CONDITIONAL(HAVE_XDG, test "$HAVE_XDG" = "yes") + +dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set +test "x$prefix" = "xNONE" && eval prefix="${ac_default_prefix}" +test "x$exec_prefix" = "xNONE" && eval exec_prefix="${prefix}" +test "x$datarootdir" = "x" && eval exec_prefix="${prefix}/share" + +if test "x$SYSTYPE" = "xWIN32"; then + default_globalconf="~/${PACKAGE}.conf" + default_userconf="~/${PACKAGE}rc" + default_sharepath="." + default_userpath="." +else + default_globalconf="/etc/${PACKAGE}.conf" + eval foo="$datarootdir" + default_sharepath="$foo/games/$PACKAGE" + + if test "x$HAVE_XDG" = "xyes"; then + default_userconf="~/.config/${PACKAGE}/${PACKAGE}.conf" + default_userpath="~/.local/share/${PACKAGE}" + else + default_userconf="~/.${PACKAGE}rc" + default_userpath="~/.$PACKAGE" + fi +fi + +AC_ARG_WITH(global-cfg, +[ --with-global-cfg=FILE If set will change the name and location of the + global config file used by QuakeForge. Defaults to + /etc/quakeforge.conf.], +globalconf="$withval", globalconf="auto") +if test "x$globalconf" = "xauto" || test "x$globalconf" = "xyes" || \ + test "x$globalconf" = "xno"; then dnl yes/no sanity checks + globalconf="$default_globalconf" +fi +AC_DEFINE_UNQUOTED(FS_GLOBALCFG, "$globalconf", [Define this to the location of the global config file]) +AC_SUBST(globalconf) + +AC_ARG_WITH(user-cfg, +[ --with-user-cfg=FILE If set will change the name and location of the + user-specific config file used by QuakeForge. + Defaults to ~/.quakeforgerc.], +userconf="$withval", userconf="auto") +if test "x$userconf" = "xauto" || test "x$userconf" = "xyes" || \ + test "x$userconf" = "xno"; then dnl yes/no sanity checks + userconf="$default_userconf" +fi +AC_DEFINE_UNQUOTED(FS_USERCFG, "$userconf", [Define this to the location of the user config file]) +AC_SUBST(userconf) + +AC_ARG_WITH(sharepath, +[ --with-sharepath=DIR Use DIR for shared game data, defaults to + '.' or \${datarootdir}/games/quakeforge (if new style)], +sharepath=$withval, sharepath="auto") +if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then + sharepath="$default_sharepath" +elif test "x$sharepath" = xno; then + sharepath="." +fi +AC_DEFINE_UNQUOTED(FS_SHAREPATH, "$sharepath", [Define this to the shared game directory root]) +AC_SUBST(sharepath) + +AC_ARG_WITH(userpath, +[ --with-userpath=DIR Use DIR for unshared game data, defaults to + '.' or ~/.quakeforge (if new style)], +userpath=$withval, userpath="auto") +if test "x$userpath" = "xauto" -o "x$userpath" = "xyes" -o "x$userpath" = "x"; then + userpath="$default_userpath" +elif test "x$userpath" = xno; then + userpath="." +fi +AC_DEFINE_UNQUOTED(FS_USERPATH, "$userpath", [Define this to the unshared game directory root]) +AC_SUBST(userpath) + +AC_ARG_WITH(plugin-path, +[ --with-plugin-path=DIR Use DIR for loading plugins, defaults to + \${libdir}/quakeforge], +plugindir=$withval, plugindir="auto") + +PLUGINDIR="\${libdir}/quakeforge" +if test "x$plugindir" = "xauto" -o "x$plugindir" = "xyes" -o "x$plugindir" = "x"; then + plugindir="$PLUGINDIR" +elif test "x$plugindir" = xno; then + plugindir="." +else + PLUGINDIR="$plugindir" +fi +eval expanded_plugindir="$plugindir" +eval expanded_plugindir="$expanded_plugindir" +AC_DEFINE_UNQUOTED(FS_PLUGINPATH, "$expanded_plugindir", [Define this to the path from which to load plugins]) +AC_SUBST(plugindir) +AC_SUBST(PLUGINDIR) + +AC_ARG_WITH(gl-driver, + [ --with-gl-driver=NAME Name of OpenGL driver DLL/DSO], + gl_driver=$withval, + gl_driver=auto +) +if test "x$gl_driver" = xauto -o "x$gl_driver" = xyes; then + if test "$SYSTYPE" = WIN32; then + gl_driver="OPENGL32.DLL" + else + gl_driver="libGL.so.1" + fi +fi +AC_DEFINE_UNQUOTED(GL_DRIVER, "$gl_driver", [Define this to the default GL dynamic lib]) diff --git a/config.d/programs.m4 b/config.d/programs.m4 new file mode 100644 index 000000000..9a5effbe7 --- /dev/null +++ b/config.d/programs.m4 @@ -0,0 +1,36 @@ +dnl ================================================================== +dnl Checks for programs. +dnl ================================================================== + +AC_PROG_INSTALL +AC_PROG_CC +AC_PROG_CPP +AC_PROG_LN_S +AC_PROG_RANLIB +AM_PROG_AS + +PKG_PROG_PKG_CONFIG + +AC_PROG_YACC +if echo $YACC | grep -v bison > /dev/null; then + AC_MSG_ERROR(GNU bison is required but was not found) +else + if echo $YACC | grep missing > /dev/null; then + AC_MSG_ERROR(GNU bison is required but was not found) + fi +fi + +AM_PROG_LEX +if echo $LEX | grep -v flex > /dev/null; then + AC_MSG_ERROR(GNU flex is required but was not found) +else + if echo $LEX | grep missing > /dev/null; then + AC_MSG_ERROR(GNU flex is required but was not found) + fi +fi + + + + +AC_CHECK_LIB(l, main, LEXLIB="-ll", AC_CHECK_LIB(fl, main, LEXLIB="-lfl")) +AC_SUBST(LEXLIB) diff --git a/config.d/pthread.m4 b/config.d/pthread.m4 new file mode 100644 index 000000000..ae6116652 --- /dev/null +++ b/config.d/pthread.m4 @@ -0,0 +1,20 @@ +if test "x$ac_cv_header_pthread_h" = "xyes"; then + save_ldflags="$LDFLAGS" + case "$host_os" in + *qnx*) dnl qnx have all pthread* functions in the libc. + ;; + *) LDFLAGS="$LDFLAGS -lpthread" + AC_TRY_LINK( + [#include ], + [pthread_attr_t type; + pthread_attr_setstacksize(&type, 0x100000);], + [PTHREAD_LDFLAGS=-lpthread], + [PTHREAD_LDFLAGS=-pthread] + ) + ;; + esac + LDFLAGS="$save_ldflags" + PTHREAD_CFLAGS=-D_REENTRANT +fi +AC_SUBST(PTHREAD_LDFLAGS) +AC_SUBST(PTHREAD_CFLAGS) diff --git a/config.d/qfcc.m4 b/config.d/qfcc.m4 new file mode 100644 index 000000000..adf9e4d69 --- /dev/null +++ b/config.d/qfcc.m4 @@ -0,0 +1,40 @@ +dnl silence automake about .r files +F77=touch +AC_SUBST(F77) + +AC_ARG_WITH(cpp, +[ --with-cpp=CPP how qfcc should invoke cpp], + cpp_name="$withval", cpp_name=auto +) +if test "x$cpp_name" != xauto; then + CPP_NAME="$cpp_name" +else + CPP_NAME="cpp %d -o %o %i" + case "$host_os" in + *freebsd*) + CPP_NAME="cpp %d %i %o" + ;; + *qnx*) + CPP_NAME="gcc -E -x c++ %d -o %o %i" + ;; + *darwin*) + CPP_NAME="/usr/libexec/gcc/darwin/`/usr/bin/arch`/default/cpp %d -o %o %i" + ;; + *bsd*) + touch conftest.c + CPP_NAME="`(f=\`$CC -v -E -Dfoo conftest.c -o conftest.i 2>&1 | grep -e -Dfoo\`; set $f; echo "$1")` %d %i %o" + rm -f conftest.[ci] + ;; + esac +fi + +AC_DEFINE_UNQUOTED(PATH_SEPARATOR, '/', + [Define this to your operating system path separator character]) +AC_DEFINE_UNQUOTED(CPP_NAME, "$CPP_NAME", + [Define this to the command line for the C preprocessor]) +AC_DEFINE_UNQUOTED(QFCC_INCLUDE_PATH, "${prefix}/include/QF/ruamoko", + [Define this to where qfcc should look for header files]) +eval expanded_libdir="${libdir}/ruamoko" +eval expanded_libdir="${expanded_libdir}" +AC_DEFINE_UNQUOTED(QFCC_LIB_PATH, "${expanded_libdir}", + [Define this to where qfcc should look for lib files]) diff --git a/config.d/result.m4 b/config.d/result.m4 new file mode 100644 index 000000000..f5095e234 --- /dev/null +++ b/config.d/result.m4 @@ -0,0 +1,31 @@ +AC_MSG_RESULT([ + QuakeForge has been configured successfully. + + Build type :$BUILD_TYPE + Server support :${SV_TARGETS- no} + Client support :${CL_TARGETS- no} + Tools support :${TOOLS_TARGETS- no} + Sound support :${SOUND_TYPES- no} ${SND_OUTPUT_DEFAULT} + CD Audio system :${CDTYPE- no} + IPv6 networking : $NETTYPE_IPV6 + Compression support: gz=$HAVE_ZLIB ogg=$HAVE_VORBIS flac=$HAVE_FLAC png=$HAVE_PNG + HTTP support : ${CURL-no} + Compiler version : $CCVER + Compiler flags : $CFLAGS + qfcc cpp invocation: $CPP_NAME + + Shared game data directory : $sharepath + Per-user game data directory: $userpath + Plugin load directory : $expanded_plugindir + Global configuration file : $globalconf + User configuration file : $userconf + OpenGL dynamic lib : $gl_driver + libWildMidi Support : $HAVE_WILDMIDI + XDG support : $HAVE_XDG +]) + +if test -d $srcdir/.git; then + echo "WARNING: Hackers at work, watch for falling bits of code." + echo "(This is from a development subversion tree. Expect problems)" + echo +fi diff --git a/config.d/rpm.m4 b/config.d/rpm.m4 new file mode 100644 index 000000000..95ac34cf7 --- /dev/null +++ b/config.d/rpm.m4 @@ -0,0 +1,2 @@ +AC_CONFIG_FILES(RPM/Makefile RPM/quakeforge.conf RPM/quakeforge.spec) +AC_CONFIG_FILES(RPM/build_rpm, [chmod +x RPM/build_rpm]) diff --git a/config.d/sdl.m4 b/config.d/sdl.m4 new file mode 100644 index 000000000..377f96831 --- /dev/null +++ b/config.d/sdl.m4 @@ -0,0 +1,45 @@ +dnl SDL/SDL-GL checks +AC_ARG_ENABLE(sdl, +[ --disable-sdl disable checking for SDL], +) + +if test "x$enable_sdl" != xno; then + AM_PATH_SDL(1.2.0, + HAVE_SDL=yes, + HAVE_SDL=no) + AC_SUBST(HAVE_SDL) + if test "x$HAVE_SDL" = "xyes"; then + case "$host_os" in + mingw*) + case "$build_os" in + cygwin*) + SDL_LIBS=`echo $SDL_LIBS | sed -e 's/-mwindows//'` + ;; + esac + ;; + esac + fi +fi + +dnl SDL-AUDIO checks +AC_ARG_ENABLE(sdl-audio, +[ --disable-sdl-audio disable checking for SDL-AUDIO], +) + +if test "x$enable_sdl_audio" != xno; then + if test "x$HAVE_SDL" = "xyes"; then + HAVE_SDL_AUDIO=yes + AC_SUBST(HAVE_SDL_AUDIO) + fi +fi + +dnl SDL-CD checks +AC_ARG_ENABLE(sdl-cd, +[ --disable-sdl-cd disable checking for SDL-CD], +) +if test "x$enable_sdl_cd" != xno; then + if test "x$HAVE_SDL" = "xyes"; then + HAVE_SDL_CD=yes + AC_SUBST(HAVE_SDL_CD) + fi +fi diff --git a/config.d/sound.m4 b/config.d/sound.m4 new file mode 100644 index 000000000..ff6941b40 --- /dev/null +++ b/config.d/sound.m4 @@ -0,0 +1,272 @@ +dnl ================================================================== +dnl Checks for sound +dnl ================================================================== + +AC_CHECK_LIB(mme, waveOutOpen, HAVE_LIBMME=yes) + +AC_ARG_ENABLE(alsa, + [ --disable-alsa disable checks for ALSA support]) + +AC_ARG_ENABLE(oss, + [ --disable-oss disable checks for OSS support]) + +AC_ARG_ENABLE(sound, + [ --disable-sound disable sound outright]) + +unset SOUND_TYPES + +HAVE_ALSA=no +if test "x$enable_alsa" != "xno"; then + if test "x$ac_cv_header_sys_asoundlib_h" = "xyes" -o \ + "x$ac_cv_header_alsa_asoundlib_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ + defined(SND_LIB_SUBMINOR) +#if SND_LIB_MAJOR > 0 || (SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && \ + SND_LIB_SUBMINOR >= 8) +QF_maGiC_VALUE +#endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES ALSA" + ALSA_LIBS="-lasound" + HAVE_ALSA=yes, + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ + defined(SND_LIB_SUBMINOR) +#if SND_LIB_MAJOR > 0 || (SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && \ + SND_LIB_SUBMINOR >= 8) +QF_maGiC_VALUE +#endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES ALSA" + ALSA_LIBS="-lasound" + HAVE_ALSA=yes + ) + ) + fi +fi +if test "x$HAVE_ALSA" = "xno"; then + if test "x$enable_alsa" != "xno"; then + if test "x$ac_cv_header_sys_asoundlib_h" = "xyes" -o \ + "x$ac_cv_header_alsa_asoundlib_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ + defined(SND_LIB_SUBMINOR) +#if SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && SND_LIB_SUBMINOR < 8 +QF_maGiC_VALUE +#endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES ALSA0_9" + ALSA_LIBS="-lasound" + HAVE_ALSA=yes, + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#if (defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ + defined(SND_LIB_SUBMINOR) +#if SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && SND_LIB_SUBMINOR < 8 +QF_maGiC_VALUE +#endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES ALSA0_9" + ALSA_LIBS="-lasound" + HAVE_ALSA=yes + ) + ) + fi + fi +fi +AC_SUBST(ALSA_LIBS) +AC_SUBST(HAVE_ALSA) + +AC_ARG_ENABLE(jack, +[ --disable-jack disable jack support], +) +HAVE_JACK=no +JACK_LIBS="" +if test "x$enable_jack" != "xno"; then + if test "x$PKG_CONFIG" != "x"; then + PKG_CHECK_MODULES([JACK], [jack], HAVE_JACK=yes, HAVE_JACK=no) + if test "x$HAVE_JACK" = "xyes"; then + AC_DEFINE(HAVE_JACK, 1, [Define if you have libjack]) + SOUND_TYPES="$SOUND_TYPES JACK" + fi + else + AC_CHECK_LIB(jack, jack_client_open, HAVE_JACK=yes, HAVE_JACK=no, + [$LIBS]) + if test "x$HAVE_JACK" = "xyes"; then + AC_CHECK_HEADER(jack/jack.h, HAVE_JACK=yes, HAVE_JACK=no) + if test "x$HAVE_JACK" = "xyes"; then + JACK_LIBS="-ljack" + AC_DEFINE(HAVE_JACK, 1, [Define if you have libjack]) + SOUND_TYPES="$SOUND_TYPES JACK" + fi + fi + fi +fi +AC_SUBST(JACK_LIBS) + +dnl AC_ARG_ENABLE(samplerate, +dnl [ --disable-samplerate disable libsamplerate support], +dnl ) +HAVE_SAMPLERATE=no +SAMPLERATE_LIBS="" +if test "x$enable_samplerate" != "xno"; then + if test "x$PKG_CONFIG" != "x"; then + PKG_CHECK_MODULES([SAMPLERATE], [samplerate], HAVE_SAMPLERATE=yes, + HAVE_SAMPLERATE=no) + if test "x$HAVE_SAMPLERATE" = "xyes"; then + AC_DEFINE(HAVE_SAMPLERATE, 1, [Define if you have libsamplerate]) + fi + else + AC_CHECK_LIB(samplerate, src_callback_new, HAVE_SAMPLERATE=yes, + HAVE_SAMPLERATE=no, [$LIBS]) + if test "x$HAVE_SAMPLERATE" = "xyes"; then + AC_CHECK_HEADER(samplerate.h, HAVE_SAMPLERATE=yes, + HAVE_SAMPLERATE=no) + if test "x$HAVE_SAMPLERATE" = "xyes"; then + SAMPLERATE_LIBS="-lsamplerate" + AC_DEFINE(HAVE_SAMPLERATE, 1, + [Define if you have libsamplerate]) + fi + fi + fi +fi +AC_SUBST(SAMPLERATE_LIBS) +dnl AM_CONDITIONAL(HAVE_SAMPLERATE, test "$HAVE_SAMPLERATE" = "yes") +if test "x$HAVE_SAMPLERATE" = "xno"; then + AC_MSG_ERROR(libsamplerate is required but was not found) +fi + +SOUND_TYPES="$SOUND_TYPES DISK" + +dnl MME +if test "x$ac_cv_header_mme_mmsystem_h" = "xyes" -a \ + "x$HAVE_LIBMME" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef WAVE_OPEN_SHAREABLE +QF_maGiC_VALUE +#endif + ], + SOUND_TYPES="$SOUND_TYPES MME" + MME_LIBS="-lmme" + ) +fi +AC_SUBST(MME_LIBS) + +dnl OSS +HAVE_OSS=no +if test "x$enable_oss" != "xno"; then + if test "x$ac_cv_header_sys_soundcard_h" = "xyes" -o \ + "x$ac_cv_header_machine_soundcard_h" = "xyes" -o \ + "x$ac_cv_header_linux_soundcard_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef SNDCTL_DSP_SETTRIGGER +QF_maGiC_VALUE +#endif + ], + SOUND_TYPES="$SOUND_TYPES OSS" + HAVE_OSS=yes + OSS_LIBS= + , + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef SNDCTL_DSP_SETTRIGGER +QF_maGiC_VALUE +#endif + ], + SOUND_TYPES="$SOUND_TYPES OSS" + HAVE_OSS=yes + OSS_LIBS= + , + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef SNDCTL_DSP_SETTRIGGER +QF_maGiC_VALUE +#endif + ], + SOUND_TYPES="$SOUND_TYPES OSS" + HAVE_OSS=yes + OSS_LIBS= + ) + ) + ) + fi +fi +AC_SUBST(HAVE_OSS) +AC_SUBST(OSS_LIBS) + +dnl SDL digital audio +if test "x$HAVE_SDL_AUDIO" = "xyes"; then + SOUND_TYPES="$SOUND_TYPES SDL" +fi + +dnl SGI +if test "x$ac_cv_header_dmedia_audio_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef AL_SAMPLE_16 +# ifdef AL_RATE +QF_maGiC_VALUE +# endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES SGI" + SGISND_LIBS="-laudio") +fi +AC_SUBST(SGISND_LIBS) + +dnl Sun +if test "x$ac_cv_header_sys_audioio_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#ifdef AUDIO_SETINFO +QF_maGiC_VALUE +#endif + ], + SOUND_TYPES="$SOUND_TYPES SUN" + ) +fi + +dnl Win32 +if test "x$ac_cv_header_windows_h" = "xyes"; then + SOUND_TYPES="$SOUND_TYPES Win32" + WINSND_LIBS="-lwinmm" + if test "x$ac_cv_header_dsound_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE], + [ +#include +#include +#ifdef GMEM_MOVEABLE +# ifdef DirectSoundEnumerate +QF_maGiC_VALUE +# endif +#endif + ], + SOUND_TYPES="$SOUND_TYPES DirectX" + ) + fi +fi +AC_SUBST(WINSND_LIBS) + +if test "x$enable_sound" = "xno"; then + unset SOUND_TYPES +fi diff --git a/config.d/svga.m4 b/config.d/svga.m4 new file mode 100644 index 000000000..63f064a35 --- /dev/null +++ b/config.d/svga.m4 @@ -0,0 +1,35 @@ +dnl Checks for SVGALib support +AC_ARG_WITH(svga, +[ --with-svga=DIR use SVGALib found in DIR], +HAVE_SVGA=$withval, HAVE_SVGA=auto) +if test "x$HAVE_SVGA" != xno; then + if test "x$HAVE_SVGA" != xauto; then + SVGA_CFLAGS="$SVGA_CFLAGS -I$withval/include" + SVGA_LIBS="$SVGA_LIBS -L$withval/lib" + dnl The default system location is /usr/include or /usr/local/include + dnl and we (obviously) do not need to set CFLAGS for that + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS" + AC_CHECK_HEADER(vga.h, HAVE_SVGA=yes, HAVE_SVGA=no) + CPPFLAGS="$save_CPPFLAGS" + + if test "x$ASM_ARCH" = xyes; then + dnl Make sure -lvga works + if test "x$HAVE_SVGA" = xyes; then + AC_CHECK_LIB(vga, vga_getmousetype, SVGA_LIBS="$SVGA_LIBS -lvga" + HAVE_SVGA=yes, HAVE_SVGA=no, [$SVGA_LIBS] + ) + fi + if test "x$HAVE_SVGA" != xyes; then + SVGA_CFLAGS="" SVGA_LIBS="" + fi + else + HAVE_SVGA=no + SVGA_CFLAGS= + SVGA_LIBS= + fi +fi +AC_SUBST(HAVE_SVGA) +AC_SUBST(SVGA_CFLAGS) +AC_SUBST(SVGA_LIBS) diff --git a/config.d/system_services.m4 b/config.d/system_services.m4 new file mode 100644 index 000000000..a23e8a002 --- /dev/null +++ b/config.d/system_services.m4 @@ -0,0 +1,7 @@ +dnl ================================================================== +dnl Checks for system services +dnl ================================================================== + +AC_SYS_LONG_FILE_NAMES +AC_EXEEXT +AC_OBJEXT diff --git a/config.d/typedefs_structs_compiler.m4 b/config.d/typedefs_structs_compiler.m4 new file mode 100644 index 000000000..5bc4f7df1 --- /dev/null +++ b/config.d/typedefs_structs_compiler.m4 @@ -0,0 +1,148 @@ +dnl ================================================================== +dnl Checks for typedefs, structures, and compiler characteristics +dnl ================================================================== + +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_STRUCT_ST_BLKSIZE +AC_HEADER_TIME +AC_STRUCT_TM + +if test "x$ac_cv_header_unistd_h" = xyes; then +AC_MSG_CHECKING(for _SC_PAGESIZE) +AC_TRY_COMPILE( + [#include ], + [int foo = _SC_PAGESIZE;], + AC_DEFINE(HAVE__SC_PAGESIZE,1,[Define this if you have _SC_PAGESIZE]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +fi + +AC_MSG_CHECKING(for __attribute__) +AC_TRY_COMPILE( + [static __attribute__ ((unused)) const char *foo = "bar";], + [], + AC_DEFINE(HAVE___ATTRIBUTE__) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +AH_VERBATIM([HAVE___ATTRIBUTE__], +[/* Define this if the GCC __attribute__ keyword is available */ +#undef HAVE___ATTRIBUTE__ +#ifndef HAVE___ATTRIBUTE__ +# define __attribute__(x) +#endif]) + +AC_MSG_CHECKING(for __attribute__ ((visibility))) +AC_TRY_COMPILE( + [void foo (void); + __attribute__ ((sivibility ("default"))) void foo (void) {}], + [], + AC_DEFINE(HAVE___ATTRIBUTE__VISIBILITY) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +AH_VERBATIM([HAVE___ATTRIBUTE__VISIBILITY], +[/* Define this if the GCC __attribute__ keyword is available */ +#undef HAVE___ATTRIBUTE__VISIBILITY +#ifdef HAVE___ATTRIBUTE__VISIBILITY +# define VISIBLE __attribute__((visibility ("default"))) +#else +# define VISIBLE +#endif]) + +AC_MSG_CHECKING(for __builtin_expect) +AC_TRY_COMPILE( + [long (*foo) (long, long) = __builtin_expect;], + [], + AC_DEFINE(HAVE___BUILTIN_EXPECT) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +AH_VERBATIM([HAVE___BUILTIN_EXPECT], +[/* Define this if the GCC __builtin_expect keyword is available */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(x,c) x +#endif]) + +AC_TYPE_VA_LIST + +AC_MSG_CHECKING(for type of fpos_t) +AC_TRY_COMPILE( + [#include ], + [fpos_t x = 0], + AC_MSG_RESULT(off_t), + AC_DEFINE(HAVE_FPOS_T_STRUCT, 1, [Define this if FPOS_T is a struct]) + AC_MSG_RESULT(struct) +) + +AC_MSG_CHECKING(for socklen_t in sys/types.h) +AC_TRY_COMPILE( + [#include ], + [ socklen_t x = 0;], + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define this if your system has socklen_t]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + dnl FreeBSD 4.0 has it in sys/socket.h + AC_MSG_CHECKING(for socklen_t in sys/socket.h) + AC_TRY_COMPILE( + [#include + #include ], + [ socklen_t x = 0;], + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define this if your system has socklen_t]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) +) + +if test "x$ac_cv_header_sys_uio_h" = xyes; then + AC_MSG_CHECKING(for struct in_pktinfo) + AC_TRY_COMPILE( + [#include + #include + #include + #include ], + [struct in_pktinfo x;], + AC_DEFINE(HAVE_IN_PKTINFO, 1, [Define this if your system has struct in_pktinfo]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) +fi + +AC_MSG_CHECKING(for size_t in sys/types.h) +AC_TRY_COMPILE( + [#include ], + [ size_t x = 0;], + AC_DEFINE(HAVE_SIZE_T, 1, [Define this if your system has size_t]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +dnl maybe these two (at least the 2nd) should be checked only if ipv6 is enabled? +AC_MSG_CHECKING(for ss_len in struct sockaddr_storage) +AC_TRY_COMPILE( + [#include + #include ], + [ void f(void) { struct sockaddr_storage ss; ss.ss_len=0; }], + AC_DEFINE(HAVE_SS_LEN, 1, [Define this if you have ss_len member in struct sockaddr_storage (BSD)]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +AC_MSG_CHECKING(for sin6_len in struct sockaddr_in6) +AC_TRY_COMPILE( + [#include + #include ], + [ void f(void) { struct sockaddr_in6 s6; s6.sin6_len=0; }], + AC_DEFINE(HAVE_SIN6_LEN, 1, [Define this if you have sin6_len member in struct sockaddr_in6 (BSD)]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +AC_MSG_CHECKING(for sa_len in struct sockaddr) +AC_TRY_COMPILE( + [#include + #include ], + [ void f(void) { struct sockaddr sa; sa.sa_len=0; }], + AC_DEFINE(HAVE_SA_LEN, 1, [Define this if you have sa_len member in struct sockaddr (BSD)]) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) diff --git a/config.d/versions.m4 b/config.d/versions.m4 new file mode 100644 index 000000000..56e3b9465 --- /dev/null +++ b/config.d/versions.m4 @@ -0,0 +1,21 @@ +dnl Define the proper name and extra version numbers for package +NQ_VERSION=1.09 +NQ_QSG_VERSION=1.0 +QW_VERSION=2.40 +QW_QSG_VERSION=2.0 +RPMVERSION=`echo $PACKAGE_VERSION | tr - _` +AC_SUBST(RPMVERSION) + +AC_DEFINE_UNQUOTED(NQ_VERSION, "$NQ_VERSION", + [Define this to the NetQuake standard version you support]) +AC_DEFINE_UNQUOTED(NQ_QSG_VERSION, "$NQ_QSG_VERSION", + [Define this to the QSG standard version you support in NetQuake]) +AC_DEFINE_UNQUOTED(QW_VERSION, "$QW_VERSION", + [Define this to the QuakeWorld standard version you support]) +AC_DEFINE_UNQUOTED(QW_QSG_VERSION, "$QW_QSG_VERSION", + [Define this to the QSG standard version you support in QuakeWorld]) + +AC_SUBST(NQ_VERSION) +AC_SUBST(NQ_QSG_VERSION) +AC_SUBST(QW_VERSION) +AC_SUBST(QW_QSG_VERSION) diff --git a/config.d/windows.m4 b/config.d/windows.m4 new file mode 100644 index 000000000..740e6beda --- /dev/null +++ b/config.d/windows.m4 @@ -0,0 +1,32 @@ +endian="" +case "$host_os" in + mingw32*) + mingw=yes + CFLAGS="$CFLAGS -I\$(top_srcdir)/include/win32" + if test "x$host" != "x$build"; then + case "$build_os" in + cygwin*) + CFLAGS="$CFLAGS -mno-cygwin -mconsole" + CPPFLAGS="$CPPFLAGS $CFLAGS" + ;; + *) + CC="$host_cpu-$host_os-gcc" + AS="$CC" + AR="$host_cpu-$host_os-ar" + RANLIB="$host_cpu-$host_os-ranlib" + ;; + esac + fi + endian="little" + ;; + cygwin*) + cygwin=yes + if test "x$host" != "x$build"; then + CC="$host_cpu-$host_os-gcc" + AS="$CC" + AR="$host_cpu_$host_os-ar" + RANLIB="$host_cpu-$host_os-ranlib" + endian="little" + fi + ;; +esac diff --git a/config.d/x11.m4 b/config.d/x11.m4 new file mode 100644 index 000000000..4737b6322 --- /dev/null +++ b/config.d/x11.m4 @@ -0,0 +1,66 @@ +dnl Checks for X11 and XShm +if test "x$mingw" != xyes; then + AC_PATH_XTRA + if test "x$no_x" = x; then + HAVE_X=yes + AC_CHECK_LIB(Xext, XShmQueryExtension, + X_SHM_LIB=-lXext, + HAVE_X=no, + [ $X_LIBS -lX11 $X_EXTRA_LIBS ] + ) + fi + AC_SUBST(X_SHM_LIB) +fi +AC_SUBST(HAVE_X) + +dnl Check for XFree86-VidMode support +AC_ARG_ENABLE(vidmode, +[ --disable-vidmode do not use XFree86 VidMode extension], + HAVE_VIDMODE=$enable_vidmode, HAVE_VIDMODE=auto) +if test "x$HAVE_VIDMODE" != xno; then + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$X_CFLAGS $CPPFLAGS" + AC_CHECK_HEADER(X11/extensions/xf86vmode.h, + dnl Make sure the library works + [AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode, + AC_DEFINE(HAVE_VIDMODE, 1, [Define if you have the XFree86 VIDMODE extension]) + VIDMODE_LIBS="-lXxf86vm",, + [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] + )], + [], + [#include ] + ) + CPPFLAGS="$save_CPPFLAGS" +fi +AC_SUBST(VIDMODE_LIBS) + +dnl Check for DGA support +AC_ARG_ENABLE(dga, +[ --disable-dga do not use XFree86 DGA extension], +HAVE_DGA=$enable_dga, HAVE_DGA=auto) +if test "x$HAVE_DGA" != xno; then + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$X_CFLAGS $CPPFLAGS" + AC_CHECK_HEADER(X11/extensions/Xxf86dga.h, + dnl Make sure the library works + [AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, + AC_DEFINE(HAVE_DGA, 1, [Define if you have the XFree86 DGA extension]) + DGA_LIBS="-lXxf86dga",, + [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] + )], + [AC_CHECK_HEADER(X11/extensions/xf86dga.h, + dnl Make sure the library works + [AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, + AC_DEFINE(HAVE_DGA, 1, [Define if you have the XFree86 DGA extension]) + AC_DEFINE(DGA_OLD_HEADERS, 1, [Define if DGA uses old headers]) + DGA_LIBS="-lXxf86dga",, + [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] + )], + [], + [#include ] + )], + [#include ] + ) + CPPFLAGS="$save_CPPFLAGS" +fi +AC_SUBST(DGA_LIBS) diff --git a/configure.ac b/configure.ac index f428f9857..dc2084439 100644 --- a/configure.ac +++ b/configure.ac @@ -1,42 +1,19 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.52) -AC_INIT(qw/source/sv_main.c) -AC_REVISION($Revision$) dnl -AM_CONFIG_HEADER(include/config.h) -AC_CANONICAL_SYSTEM -AC_VALIDATE_CACHED_SYSTEM_TUPLE( - rm $cache_file - echo restart configure - exit 1 -) +AC_PREREQ(2.67) +dnl This is the only place where the package name and version appear +AC_INIT([QuakeForge], [git-master]) +AM_INIT_AUTOMAKE([foreign]) +LT_INIT([win32-dll]) -dnl This is the only place where the package version appears -AM_INIT_AUTOMAKE(quakeforge, 0.5.5-SVN) +AC_REVISION([$Revision$]) dnl -dnl Define the proper name and extra version numbers for package -PROGRAM=QuakeForge -NQ_VERSION=1.09 -NQ_QSG_VERSION=1.0 -QW_VERSION=2.40 -QW_QSG_VERSION=2.0 -RPMVERSION=`echo $VERSION | tr - _` -AC_SUBST(RPMVERSION) +AC_CONFIG_HEADERS([include/config.h]) -AC_DEFINE_UNQUOTED(PROGRAM, "$PROGRAM", ["Proper" package name]) -AC_DEFINE_UNQUOTED(NQ_VERSION, "$NQ_VERSION", [Define this to the NetQuake standard version you support]) -AC_DEFINE_UNQUOTED(NQ_QSG_VERSION, "$NQ_QSG_VERSION", [Define this to the QSG standard version you support in NetQuake]) -AC_DEFINE_UNQUOTED(QW_VERSION, "$QW_VERSION", [Define this to the QuakeWorld standard version you support]) -AC_DEFINE_UNQUOTED(QW_QSG_VERSION, "$QW_QSG_VERSION", [Define this to the QSG standard version you support in QuakeWorld]) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST -AC_SUBST(PROGRAM) -AC_SUBST(NQ_VERSION) -AC_SUBST(NQ_QSG_VERSION) -AC_SUBST(QW_VERSION) -AC_SUBST(QW_QSG_VERSION) - -ISODATE=`date +%Y-%m-%d` -AC_SUBST(ISODATE) +m4_include(config.d/versions.m4) AC_LANG_C @@ -47,523 +24,20 @@ if test "$x{AR-unset}" = xunset; then AR="ar" fi export AR +AC_SUBST(AR) +AC_SUBST(RANLIB) -endian="" -case "$host_os" in - mingw32*) - mingw=yes - CFLAGS="$CFLAGS -I\$(top_srcdir)/include/win32" - if test "x$host" != "x$build"; then - case "$build_os" in - cygwin*) - CFLAGS="$CFLAGS -mno-cygwin -mconsole" - CPPFLAGS="$CPPFLAGS $CFLAGS" - ;; - *) - CC="$host_cpu-$host_os-gcc" - AS="$CC" - AR="$host_cpu-$host_os-ar" - RANLIB="$host_cpu-$host_os-ranlib" - ;; - esac - fi - endian="little" - ;; - cygwin*) - cygwin=yes - if test "x$host" != "x$build"; then - CC="$host_cpu-$host_os-gcc" - AS="$CC" - AR="$host_cpu_$host_os-ar" - RANLIB="$host_cpu-$host_os-ranlib" - endian="little" - fi - ;; -esac +m4_include(config.d/windows.m4) +m4_include(config.d/asm.m4) +m4_include(config.d/programs.m4) +m4_include(config.d/system_services.m4) +m4_include(config.d/header_files.m4) +m4_include(config.d/library_functions.m4) +m4_include(config.d/typedefs_structs_compiler.m4) -dnl Check for ia32 -AC_MSG_CHECKING(for an ia32 machine) -case "${host}" in - i?86-*-*) - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(to see if we should disable asm optimizations) - AC_ARG_ENABLE(asmopt, - [ --disable-asmopt disable assembler optimization], - AC_MSG_RESULT(yes), - AC_DEFINE(USE_INTEL_ASM, 1, [Define this if you want to use Intel assembly optimizations]) - ASM_ARCH=yes - AC_MSG_RESULT(no) - ) - ;; - *) AC_MSG_RESULT(no) -esac -AM_CONDITIONAL(ASM_ARCH, test "x$ASM_ARCH" = "xyes") +m4_include(config.d/cross_compile.m4) -dnl ================================================================== -dnl Checks for programs. -dnl ================================================================== - -AC_PROG_INSTALL -AC_PROG_CC -AC_PROG_CPP -AC_PROG_LN_S -AC_PROG_RANLIB -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL -AM_PROG_AS - -PKG_PROG_PKG_CONFIG - -AC_PROG_YACC -if echo $YACC | grep -v bison > /dev/null; then - AC_MSG_ERROR(GNU bison is required but wasn't found) -else - if echo $YACC | grep missing > /dev/null; then - AC_MSG_ERROR(GNU bison is required but wasn't found) - fi -fi - -AM_PROG_LEX -if echo $LEX | grep -v flex > /dev/null; then - AC_MSG_ERROR(GNU flex is required but wasn't found) -else - if echo $LEX | grep missing > /dev/null; then - AC_MSG_ERROR(GNU flex is required but wasn't found) - fi -fi - - - -AC_ARG_WITH(cpp, -[ --with-cpp=CPP how qfcc should invoke cpp], - cpp_name="$withval", cpp_name=auto -) -if test "x$cpp_name" != xauto; then - CPP_NAME="$cpp_name" -else - CPP_NAME="cpp %d -o %o %i" - case "$host_os" in - *freebsd*) - CPP_NAME="cpp %d %i %o" - ;; - *qnx*) - CPP_NAME="gcc -E -x c++ %d -o %o %i" - ;; - *darwin*) - CPP_NAME="/usr/libexec/gcc/darwin/`/usr/bin/arch`/default/cpp %d -o %o %i" - ;; - *bsd*) - touch conftest.c - CPP_NAME="`(f=\`$CC -v -E -Dfoo conftest.c -o conftest.i 2>&1 | grep -e -Dfoo\`; set $f; echo "$1")` %d %i %o" - rm -f conftest.[ci] - ;; - esac -fi - -AC_CHECK_LIB(l, main, LEXLIB="-ll", AC_CHECK_LIB(fl, main, LEXLIB="-lfl")) -AC_SUBST(LEXLIB) - -dnl ================================================================== -dnl Checks for system services -dnl ================================================================== - -AC_SYS_LONG_FILE_NAMES -AC_EXEEXT -AC_OBJEXT - -dnl ================================================================== -dnl Checks for header files. -dnl ================================================================== - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_MAJOR -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS( - alloca.h alsa/asoundlib.h arpa/inet.h asm/io.h assert.h conio.h \ - ctype.h ddraw.h dinput.h direct.h dirent.h dlfcn.h dmedia/audio.h \ - dmedia/cdaudio.h dpmi.h dsound.h errno.h execinfo.h fcntl.h io.h \ - libc.h limits.h linux/cdrom.h linux/joystick.h linux/soundcard.h \ - machine/soundcard.h malloc.h math.h mgraph.h _mingw.h netdb.h \ - netinet/in.h process.h pthread.h pwd.h rpc/types.h setjmp.h signal.h \ - stdarg.h stdio.h stdlib.h string.h strings.h sys/asoundlib.h \ - sys/audioio.h sys/filio.h sys/ioctl.h sys/io.h sys/ipc.h sys/mman.h \ - sys/param.h sys/poll.h sys/shm.h sys/signal.h sys/socket.h \ - sys/soundcard.h sys/stat.h sys/time.h sys/types.h sys/uio.h termios.h \ - time.h unistd.h vgakeyboard.h vgamouse.h windows.h winsock.h -) -if test "x$mingw" = xyes; then - AC_MSG_CHECKING(for fnmatch.h) - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FNMATCH_H, 1, [Define this if you have fnmatch.h]) - AC_MSG_CHECKING(for tchar.h) - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_TCHAR_H, 1, [Define this if you have tchar.h]) -else - AC_CHECK_HEADERS(fnmatch.h) -fi - -if test "x$ac_cv_header_pthread_h" = "xyes"; then - save_ldflags="$LDFLAGS" - case "$host_os" in - *qnx*) dnl qnx have all pthread* functions in the libc. - ;; - *) LDFLAGS="$LDFLAGS -lpthread" - AC_TRY_LINK( - [#include ], - [pthread_attr_t type; - pthread_attr_setstacksize(&type, 0x100000);], - [PTHREAD_LDFLAGS=-lpthread], - [PTHREAD_LDFLAGS=-pthread] - ) - ;; - esac - LDFLAGS="$save_ldflags" - PTHREAD_CFLAGS=-D_REENTRANT -fi -AC_SUBST(PTHREAD_LDFLAGS) -AC_SUBST(PTHREAD_CFLAGS) - -dnl ================================================================== -dnl Checks for typedefs, structures, and compiler characteristics -dnl ================================================================== - -AC_C_CONST -AC_C_INLINE -AC_TYPE_SIZE_T -AC_STRUCT_ST_BLKSIZE -AC_HEADER_TIME -AC_STRUCT_TM - -if test "x$ac_cv_header_unistd_h" = xyes; then -AC_MSG_CHECKING(for _SC_PAGESIZE) -AC_TRY_COMPILE( - [#include ], - [int foo = _SC_PAGESIZE;], - AC_DEFINE(HAVE__SC_PAGESIZE,1,[Define this if you have _SC_PAGESIZE]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) -fi - -AC_MSG_CHECKING(for __attribute__) -AC_TRY_COMPILE( - [static __attribute__ ((unused)) const char *foo = "bar";], - [], - AC_DEFINE(HAVE___ATTRIBUTE__) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) -AH_VERBATIM([HAVE___ATTRIBUTE__], -[/* Define this if the GCC __attribute__ keyword is available */ -#undef HAVE___ATTRIBUTE__ -#ifndef HAVE___ATTRIBUTE__ -# define __attribute__(x) -#endif]) - -AC_MSG_CHECKING(for __attribute__ ((visibility))) -AC_TRY_COMPILE( - [void foo (void); - __attribute__ ((sivibility ("default"))) void foo (void) {}], - [], - AC_DEFINE(HAVE___ATTRIBUTE__VISIBILITY) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) -AH_VERBATIM([HAVE___ATTRIBUTE__VISIBILITY], -[/* Define this if the GCC __attribute__ keyword is available */ -#undef HAVE___ATTRIBUTE__VISIBILITY -#ifdef HAVE___ATTRIBUTE__VISIBILITY -# define VISIBLE __attribute__((visibility ("default"))) -#else -# define VISIBLE -#endif]) - -AC_MSG_CHECKING(for __builtin_expect) -AC_TRY_COMPILE( - [long (*foo) (long, long) = __builtin_expect;], - [], - AC_DEFINE(HAVE___BUILTIN_EXPECT) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) -AH_VERBATIM([HAVE___BUILTIN_EXPECT], -[/* Define this if the GCC __builtin_expect keyword is available */ -#undef HAVE___BUILTIN_EXPECT -#ifndef HAVE___BUILTIN_EXPECT -# define __builtin_expect(x,c) x -#endif]) - -AC_TYPE_VA_LIST - -if test "x$cross_compiling" = xyes; then - AC_MSG_CHECKING(whether byte ordering is bigendian) - AC_ARG_WITH(endian, -[ --with-endian=TYPE set endian of target system for - cross-compiling. TYPE = little or big.], - endian="$withval", - ) - case "x$endian" in - xbig) - AC_DEFINE(WORDS_BIGENDIAN) - AC_MSG_RESULT(yes) - ;; - xlittle) - AC_MSG_RESULT(no) - ;; - x) - AC_MSG_RESULT(unspecified, use --with-endian={big,little}) - exit 1 - ;; - x*) - AC_MSG_RESULT(unrecognized endianness) - exit 1 - ;; - esac -else - AC_C_BIGENDIAN -fi - -AC_CHECK_FUNCS(usleep) - -AC_MSG_CHECKING(for fnmatch) -AC_TRY_LINK( - [], - [fnmatch();], - BUILD_FNMATCH=no - AC_MSG_RESULT(yes), - BUILD_FNMATCH=yes - AC_MSG_RESULT(no) -) -AM_CONDITIONAL(BUILD_FNMATCH, test "x$BUILD_FNMATCH" = "xyes") - -AC_MSG_CHECKING(for getopt_long) -AC_TRY_LINK( - [], - [getopt_long();], - BUILD_GETOPT=no - AC_MSG_RESULT(yes), - BUILD_GETOPT=yes - AC_MSG_RESULT(no) -) -AM_CONDITIONAL(BUILD_GETOPT, test "x$BUILD_GETOPT" = "xyes") - -if test "x$ac_cv_header_alloca_h" = no; then - AC_MSG_CHECKING(for alloca in stdlib.h) - AC_TRY_COMPILE( - [#include ], - [void *(*foo)(size_t) = alloca;], - have_alloca_proto=yes - AC_MSG_RESULT(yes), - have_alloca_proto=no - AC_MSG_RESULT(no) - ) -else - AC_MSG_CHECKING(for alloca in alloca.h) - AC_TRY_COMPILE( - [#include ] - [#include ], - [void *(*foo)(size_t) = alloca;], - have_alloca_proto=yes - AC_MSG_RESULT(yes), - have_alloca_proto=no - AC_MSG_RESULT(no) - ) -fi - -if test "x$have_alloca_proto" = xyes; then - AC_DEFINE(HAVE_ALLOCA_PROTO) -fi -AH_VERBATIM([HAVE_ALLOCA_PROTO], -[/* Define this if alloca is prototyped */ -#undef HAVE_ALLOCA_PROTO -#ifndef HAVE_ALLOCA_PROTO -#ifndef QFASM -void *alloca (int size); -#endif -#endif]) - -AC_MSG_CHECKING(for fnmatch in fnmatch.h) -AC_TRY_COMPILE( - [#include "fnmatch.h"], - [int (*foo)() = fnmatch;], - AC_DEFINE(HAVE_FNMATCH_PROTO, 1, [Define this if fnmatch is prototyped in fnmatch.h]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for strnlen in string.h) -AC_TRY_COMPILE( - [#include "string.h"], - [int (*foo)() = strnlen;], - AC_DEFINE(HAVE_STRNLEN_PROTO, 1, [Define this if strnlen is prototyped in string.h]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for strcasestr in string.h) -AC_TRY_COMPILE( - [#include "string.h"], - [int (*foo)() = strcasestr;], - AC_DEFINE(HAVE_STRCASESTR_PROTO, 1, [Define this if strcasestr is prototyped in string.h]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for type of fpos_t) -AC_TRY_COMPILE( - [#include ], - [fpos_t x = 0], - AC_MSG_RESULT(off_t), - AC_DEFINE(HAVE_FPOS_T_STRUCT, 1, [Define this if FPOS_T is a struct]) - AC_MSG_RESULT(struct) -) - -AC_MSG_CHECKING(for socklen_t in sys/types.h) -AC_TRY_COMPILE( - [#include ], - [ socklen_t x = 0;], - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define this if your system has socklen_t]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - dnl FreeBSD 4.0 has it in sys/socket.h - AC_MSG_CHECKING(for socklen_t in sys/socket.h) - AC_TRY_COMPILE( - [#include - #include ], - [ socklen_t x = 0;], - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define this if your system has socklen_t]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) -) - -if test "x$ac_cv_header_sys_uio_h" = xyes; then - AC_MSG_CHECKING(for struct in_pktinfo) - AC_TRY_COMPILE( - [#include - #include - #include - #include ], - [struct in_pktinfo x;], - AC_DEFINE(HAVE_IN_PKTINFO, 1, [Define this if your system has struct in_pktinfo]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) -fi - -AC_MSG_CHECKING(for underscore prefix in names) -AC_TRY_LINK( - [asm(".long _bar"); - int bar;], - [], - AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE, 1, [Define this if C symbols are prefixed with an underscore]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for size_t in sys/types.h) -AC_TRY_COMPILE( - [#include ], - [ size_t x = 0;], - AC_DEFINE(HAVE_SIZE_T, 1, [Define this if your system has size_t]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -dnl maybe these two (at least the 2nd) should be checked only if ipv6 is enabled? -AC_MSG_CHECKING(for ss_len in struct sockaddr_storage) -AC_TRY_COMPILE( - [#include - #include ], - [ void f(void) { struct sockaddr_storage ss; ss.ss_len=0; }], - AC_DEFINE(HAVE_SS_LEN, 1, [Define this if you have ss_len member in struct sockaddr_storage (BSD)]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for sin6_len in struct sockaddr_in6) -AC_TRY_COMPILE( - [#include - #include ], - [ void f(void) { struct sockaddr_in6 s6; s6.sin6_len=0; }], - AC_DEFINE(HAVE_SIN6_LEN, 1, [Define this if you have sin6_len member in struct sockaddr_in6 (BSD)]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -AC_MSG_CHECKING(for sa_len in struct sockaddr) -AC_TRY_COMPILE( - [#include - #include ], - [ void f(void) { struct sockaddr sa; sa.sa_len=0; }], - AC_DEFINE(HAVE_SA_LEN, 1, [Define this if you have sa_len member in struct sockaddr (BSD)]) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) - -dnl ================================================================== -dnl Checks for library functions. -dnl ================================================================== - -AC_FUNC_ALLOCA -AC_FUNC_MEMCMP -AC_FUNC_MMAP -AC_TYPE_SIGNAL -AC_FUNC_VPRINTF -AC_FUNC_VA_COPY -AC_FUNC__VA_COPY -AC_CHECK_FUNCS( - access _access gethostname gethostbyname connect gettimeofday getwd \ - mkdir _mkdir ftime _ftime fcntl stat putenv select socket strerror \ - strcasestr strnlen strstr snprintf _snprintf vsnprintf _vsnprintf \ - strsep dlopen getaddrinfo getnameinfo mprotect getpagesize -) - -DL_LIBS="" -if test "x$ac_cv_func_dlopen" != "xyes"; then - AC_CHECK_LIB(dl, dlopen, - AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have the dlopen function.]) DL_LIBS="-ldl" - ) -fi -AC_SUBST(DL_LIBS) - -AC_ARG_ENABLE(curses, -[ --disable-curses disable curses support] -) - -if test "x$enable_curses" != "xno"; then - AC_CHECK_HEADERS(curses.h) - AC_CHECK_LIB(ncurses, initscr, - CURSES_LIBS=-lncurses, - AC_CHECK_LIB(pdcurses, initscr, - CURSES_LIBS=-lpdcurses, - AC_CHECK_LIB(curses, initscr, - CURSES_LIBS=-lcurses, - CURSES_LIBS= - ) - ) - ) -else - CURSES_LIBS= -fi -AC_SUBST(CURSES_LIBS) - -dnl Checks for stricmp/strcasecmp -#AC_CHECK_FUNC(strcasecmp, -# , -# AC_CHECK_FUNC(stricmp, -# AC_DEFINE(strcasecmp, stricmp) -# ) -#) -AC_CHECK_FUNC(strcasecmp, strcasecmp=yes, strcasecmp=no) -if test "x$strcasecmp" = xno; then - AC_CHECK_FUNC(stricmp, - AC_DEFINE(strcasecmp, stricmp, [Define strcasecmp as stricmp if you have one but not the other]), - AC_MSG_ERROR([Neither stricmp nor strcasecmp found]) - ) -fi - -dnl Check for vsnprintf -if test "x$ac_cv_func_vsnprintf" = "xno" -a \ - "x$ac_cv_func__vsnprintf" = "xno"; then - dnl libdb may have this - AC_CHECK_LIB(db,vsnprintf) -fi +m4_include(config.d/pthread.m4) WINMM="" case "$host_os" in @@ -579,351 +53,15 @@ case "$host_os" in ;; esac -AC_ARG_ENABLE(flac, -[ --disable-flac disable flac support], -) -HAVE_FLAC=no -if test "x$enable_flac" != "xno"; then - AM_PATH_LIBFLAC(HAVE_FLAC=yes, HAVE_FLAC=no) - if test "x$HAVE_FLAC" = xyes; then - AC_DEFINE(HAVE_FLAC, 1, [define this if you have flac libs]) - fi -fi +m4_include(config.d/compression.m4) -AC_ARG_ENABLE(wildmidi, -[ --disable-wildmidi disable libWildMidi support], -) -HAVE_WILDMIDI=no -WM_LIBS= -if test "x$enable_wildmidi" != "xno"; then - AC_CHECK_LIB(WildMidi, WildMidi_GetString, HAVE_WILDMIDI=yes, HAVE_WILDMIDI=no) - if test "x$HAVE_WILDMIDI" = "xyes"; then - AC_CHECK_HEADER(wildmidi_lib.h, HAVE_WILDMIDI=yes, HAVE_WILDMIDI=no) - if test "x$HAVE_WILDMIDI" = "xyes"; then - WM_LIBS="-lWildMidi" - AC_DEFINE(HAVE_WILDMIDI, 1, [Define if you have WildMidi]) - fi - fi -fi -AC_SUBST(WM_LIBS) - -AC_ARG_ENABLE(vorbis, -[ --disable-vorbis disable ogg vorbis support], -) -HAVE_VORBIS=no -if test "x$enable_vorbis" != "xno"; then - XIPH_PATH_OGG(HAVE_OGG=yes, HAVE_OGG=no) - if test "x$HAVE_OGG" = xyes; then - XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no) - if test "x$HAVE_VORBIS" = xyes; then - AC_DEFINE(HAVE_VORBIS, 1, [define this if you have ogg/vorbis libs]) - fi - fi -fi - -AM_CONDITIONAL(HAVE_FLAC, test "x$HAVE_FLAC" = "xyes") -AM_CONDITIONAL(HAVE_MIDI, test "x$HAVE_WILDMIDI" = "xyes") -AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBIS" = "xyes") - -AC_ARG_ENABLE(zlib, -[ --disable-zlib disable zlib support], -) - -HAVE_ZLIB=no -Z_LIBS="" -if test "x$enable_zlib" != "xno"; then - dnl Check for working -lz - dnl Note - must have gztell *and* gzgets in -lz *and* zlib.h - AC_CHECK_LIB(z, gztell, HAVE_ZLIB=yes, HAVE_ZLIB=no, [$LIBS]) - if test "x$HAVE_ZLIB" = "xyes"; then - AC_CHECK_LIB(z, gzgets, HAVE_ZLIB=yes, HAVE_ZLIB=no, [$LIBS]) - if test "x$HAVE_ZLIB" = "xyes"; then - AC_CHECK_HEADER(zlib.h, HAVE_ZLIB=yes, HAVE_ZLIB=no) - if test "x$HAVE_ZLIB" = "xyes"; then - Z_LIBS="-lz" - fi - fi - fi -fi - -AC_ARG_ENABLE(png, -[ --disable-png disable png support], -) -HAVE_PNG=no -PNG_LIBS="" -if test "x$enable_png" != "xno"; then - if test "x$PKG_CONFIG" != "x"; then - PKG_CHECK_MODULES([PNG], [libpng], HAVE_PNG=yes, HAVE_PNG=no) - else - AC_CHECK_LIB(png, png_set_read_fn, HAVE_PNG=yes, HAVE_PNG=no, [$LIBS]) - if test "x$HAVE_PNG" = "xyes"; then - AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no) - if test "x$HAVE_PNG" = "xyes"; then - PNG_LIBS="-lpng" - AC_DEFINE(HAVE_PNG, 1, [Define if you have libpng]) - fi - fi - fi -fi -AC_SUBST(PNG_LIBS) - -LIBCURL_CHECK_CONFIG([], [], [CURL=yes], []) - -AC_ARG_WITH(ipv6, -[ --with-ipv6=DIR enable IPv6 support. Optional argument specifies - location of inet6 libraries.], - if test "x$withval" = xno ; then - NETTYPE_IPV6=no - else - AC_DEFINE(HAVE_IPV6, 1, [Define this if you want IPv6 support]) - NETTYPE_IPV6=yes - if test "x$withval" != xyes ; then - LIBS="$LIBS -L${withval}" - fi - fi - , - NETTYPE_IPV6=no -) -AM_CONDITIONAL(NETTYPE_IPV6, test "x$NETTYPE_IPV6" = "xyes") - -dnl Checks for MGL support -AC_ARG_WITH(mgl, -[ --with-mgl=DIR use MGL found in DIR], -HAVE_MGL=$withval, HAVE_MGL=auto) -if test "x$HAVE_MGL" != xno; then - if test "x$ac_cv_header_windows_h" != "xyes"; then - HAVE_MGL=no - else - if test "x$HAVE_MGL" != xauto; then - MGL_CFLAGS="$MGL_CFLAGS -I$withval/include" - MGL_LIBS="$MGL_LIBS -L$withval/lib" - fi - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $MGL_CFLAGS" - AC_CHECK_HEADER(mgraph.h, HAVE_MGL=yes, HAVE_MGL=no) - CPPFLAGS="$save_CPPFLAGS" - - dnl Make sure -lmgllt or -lmglfx works - if test "x$HAVE_MGL" = xyes; then - for lib in mglfx mgllt; do - MGL_LIBS="$MGL_LIBS -lgdi32 -lwinmm -ldinput -lddraw" - AC_CHECK_LIB($lib, MGL_registerDriver, - MGL_LIBS="-l$lib $MGL_LIBS" - HAVE_MGL=yes - break, - HAVE_MGL=no, - [$MGL_LIBS] - ) - done - fi - fi - if test "x$HAVE_MGL" != xyes; then - MGL_CFLAGS="" MGL_LIBS="" - fi -fi -AC_SUBST(HAVE_MGL) -AC_SUBST(MGL_CFLAGS) -AC_SUBST(MGL_LIBS) - -dnl Checks for Linux FBDev support -AC_ARG_WITH(fbdev, -[ --with-fbdev use Linux framebuffer device], -HAVE_FBDEV=$withval, HAVE_FBDEV=auto) -if test "x$HAVE_FBDEV" != xno; then - dnl We should still be able to compile it even if - dnl there is no fbdev support in the running kernel - AC_CHECK_HEADERS(linux/fb.h, HAVE_FBDEV=yes, HAVE_FBDEV=no) -fi - -AC_SUBST(HAVE_FBDEV) -if test "x$HAVE_FBDEV" = xyes; then - AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_VGA4) - AC_TRY_COMPILE( - [#include "linux/fb.h"], - [int foo = FB_AUX_VGA_PLANES_VGA4;], - AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_VGA4, 1, [Define this if you have FB_AUX_VGA_PLANES_VGA4]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_CFB4) - AC_TRY_COMPILE( - [#include "linux/fb.h"], - [int foo = FB_AUX_VGA_PLANES_CFB4;], - AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_CFB4, 1, [Define this if you have FB_AUX_VGA_PLANES_CFB4]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for FB_AUX_VGA_PLANES_CFB8) - AC_TRY_COMPILE( - [#include "linux/fb.h"], - [int foo = FB_AUX_VGA_PLANES_CFB8;], - AC_DEFINE(HAVE_FB_AUX_VGA_PLANES_CFB8, 1, [Define this if you have FB_AUX_VGA_PLANES_CFB4]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) -fi - -dnl Checks for SVGALib support -AC_ARG_WITH(svga, -[ --with-svga=DIR use SVGALib found in DIR], -HAVE_SVGA=$withval, HAVE_SVGA=auto) -if test "x$HAVE_SVGA" != xno; then - if test "x$HAVE_SVGA" != xauto; then - SVGA_CFLAGS="$SVGA_CFLAGS -I$withval/include" - SVGA_LIBS="$SVGA_LIBS -L$withval/lib" - dnl The default system location is /usr/include or /usr/local/include - dnl and we (obviously) do not need to set CFLAGS for that - fi - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS" - AC_CHECK_HEADER(vga.h, HAVE_SVGA=yes, HAVE_SVGA=no) - CPPFLAGS="$save_CPPFLAGS" - - if test "x$ASM_ARCH" = xyes; then - dnl Make sure -lvga works - if test "x$HAVE_SVGA" = xyes; then - AC_CHECK_LIB(vga, vga_getmousetype, SVGA_LIBS="$SVGA_LIBS -lvga" - HAVE_SVGA=yes, HAVE_SVGA=no, [$SVGA_LIBS] - ) - fi - if test "x$HAVE_SVGA" != xyes; then - SVGA_CFLAGS="" SVGA_LIBS="" - fi - else - HAVE_SVGA=no - SVGA_CFLAGS= - SVGA_LIBS= - fi -fi -AC_SUBST(HAVE_SVGA) -AC_SUBST(SVGA_CFLAGS) -AC_SUBST(SVGA_LIBS) - -dnl Checks for X11 and XShm -if test "x$mingw" != xyes; then - AC_PATH_XTRA - if test "x$no_x" = x; then - HAVE_X=yes - AC_CHECK_LIB(Xext, XShmQueryExtension, - X_SHM_LIB=-lXext, - HAVE_X=no, - [ $X_LIBS -lX11 $X_EXTRA_LIBS ] - ) - fi - AC_SUBST(X_SHM_LIB) -fi - -dnl Check for XFree86-VidMode support -AC_ARG_ENABLE(vidmode, -[ --disable-vidmode do not use XFree86 VidMode extension], - HAVE_VIDMODE=$enable_vidmode, HAVE_VIDMODE=auto) -if test "x$HAVE_VIDMODE" != xno; then - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$X_CFLAGS $CPPFLAGS" - AC_CHECK_HEADER(X11/extensions/xf86vmode.h, - dnl Make sure the library works - [AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode, - AC_DEFINE(HAVE_VIDMODE, 1, [Define if you have the XFree86 VIDMODE extension]) - VIDMODE_LIBS="-lXxf86vm",, - [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] - )], - [], - [#include ] - ) - CPPFLAGS="$save_CPPFLAGS" -fi -AC_SUBST(VIDMODE_LIBS) - -dnl Check for DGA support -AC_ARG_ENABLE(dga, -[ --disable-dga do not use XFree86 DGA extension], -HAVE_DGA=$enable_dga, HAVE_DGA=auto) -if test "x$HAVE_DGA" != xno; then - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$X_CFLAGS $CPPFLAGS" - AC_CHECK_HEADER(X11/extensions/Xxf86dga.h, - dnl Make sure the library works - [AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, - AC_DEFINE(HAVE_DGA, 1, [Define if you have the XFree86 DGA extension]) - DGA_LIBS="-lXxf86dga",, - [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] - )], - [AC_CHECK_HEADER(X11/extensions/xf86dga.h, - dnl Make sure the library works - [AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, - AC_DEFINE(HAVE_DGA, 1, [Define if you have the XFree86 DGA extension]) - AC_DEFINE(DGA_OLD_HEADERS, 1, [Define if DGA uses old headers]) - DGA_LIBS="-lXxf86dga",, - [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS] - )], - [], - [#include ] - )], - [#include ] - ) - CPPFLAGS="$save_CPPFLAGS" -fi -AC_SUBST(DGA_LIBS) - -dnl SDL/SDL-GL checks -AC_ARG_ENABLE(sdl, -[ --disable-sdl disable checking for SDL], -) - -if test "x$enable_sdl" != xno; then - AM_PATH_SDL(1.2.0, - HAVE_SDL=yes, - HAVE_SDL=no) - AC_SUBST(HAVE_SDL) - if test "x$HAVE_SDL" = "xyes"; then - case "$host_os" in - mingw*) - case "$build_os" in - cygwin*) - SDL_LIBS=`echo $SDL_LIBS | sed -e 's/-mwindows//'` - ;; - esac - ;; - esac - fi -fi - -dnl SDL-AUDIO checks -AC_ARG_ENABLE(sdl-audio, -[ --disable-sdl-audio disable checking for SDL-AUDIO], -) - -if test "x$enable_sdl_audio" != xno; then - if test "x$HAVE_SDL" = "xyes"; then - HAVE_SDL_AUDIO=yes - AC_SUBST(HAVE_SDL_AUDIO) - fi -fi - -dnl SDL-CD checks -AC_ARG_ENABLE(sdl-cd, -[ --disable-sdl-cd disable checking for SDL-CD], -) - -if test "x$enable_sdl_cd" != xno; then - if test "x$HAVE_SDL" = "xyes"; then - HAVE_SDL_CD=yes - AC_SUBST(HAVE_SDL_CD) - fi -fi - -dnl XMMS Checks -AC_ARG_ENABLE(xmms, -[ --disable-xmms disable checking for XMMS], -) - -if test "x$mingw" != xyes -a "x$enable_xmms" != xno; then - AM_PATH_XMMS(0.9.5.1, - HAVE_XMMS=yes, - HAVE_XMMS=no) - AC_SUBST(HAVE_XMMS) -fi +m4_include(config.d/mgl.m4) +m4_include(config.d/fbdev.m4) +m4_include(config.d/svga.m4) +m4_include(config.d/x11.m4) +m4_include(config.d/sdl.m4) +m4_include(config.d/curses.m4) dnl ================================================================== dnl Checks for system type @@ -959,593 +97,17 @@ esac AM_CONDITIONAL(SYSTYPE_WIN32, test "x$SYSTYPE" = "xWIN32") AC_SUBST(WIN32_LIBS) -dnl ================================================================== -dnl Checks for sound -dnl ================================================================== +m4_include(config.d/sound.m4) +m4_include(config.d/joystick.m4) +m4_include(config.d/cdrom.m4) -AC_CHECK_LIB(mme, waveOutOpen, HAVE_LIBMME=yes) +m4_include(config.d/networking.m4) -AC_ARG_ENABLE(alsa, - [ --disable-alsa disable checks for ALSA support]) +m4_include(config.d/paths.m4) -AC_ARG_ENABLE(oss, - [ --disable-oss disable checks for OSS support]) - -AC_ARG_ENABLE(sound, - [ --disable-sound disable sound outright]) - -unset SOUND_TYPES - -HAVE_ALSA=no -if test "x$enable_alsa" != "xno"; then - if test "x$ac_cv_header_sys_asoundlib_h" = "xyes" -o \ - "x$ac_cv_header_alsa_asoundlib_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ - defined(SND_LIB_SUBMINOR) -#if SND_LIB_MAJOR > 0 || (SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && \ - SND_LIB_SUBMINOR >= 8) -QF_maGiC_VALUE -#endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES ALSA" - ALSA_LIBS="-lasound" - HAVE_ALSA=yes, - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ - defined(SND_LIB_SUBMINOR) -#if SND_LIB_MAJOR > 0 || (SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && \ - SND_LIB_SUBMINOR >= 8) -QF_maGiC_VALUE -#endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES ALSA" - ALSA_LIBS="-lasound" - HAVE_ALSA=yes - ) - ) - fi -fi -if test "x$HAVE_ALSA" = "xno"; then - if test "x$enable_alsa" != "xno"; then - if test "x$ac_cv_header_sys_asoundlib_h" = "xyes" -o \ - "x$ac_cv_header_alsa_asoundlib_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ - defined(SND_LIB_SUBMINOR) -#if SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && SND_LIB_SUBMINOR < 8 -QF_maGiC_VALUE -#endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES ALSA0_9" - ALSA_LIBS="-lasound" - HAVE_ALSA=yes, - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#if (defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) && \ - defined(SND_LIB_SUBMINOR) -#if SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9 && SND_LIB_SUBMINOR < 8 -QF_maGiC_VALUE -#endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES ALSA0_9" - ALSA_LIBS="-lasound" - HAVE_ALSA=yes - ) - ) - fi - fi -fi -AC_SUBST(ALSA_LIBS) -AC_SUBST(HAVE_ALSA) - -AC_ARG_ENABLE(jack, -[ --disable-jack disable jack support], -) -HAVE_JACK=no -JACK_LIBS="" -if test "x$enable_jack" != "xno"; then - if test "x$PKG_CONFIG" != "x"; then - PKG_CHECK_MODULES([JACK], [jack], HAVE_JACK=yes, HAVE_JACK=no) - if test "x$HAVE_JACK" = "xyes"; then - AC_DEFINE(HAVE_JACK, 1, [Define if you have libjack]) - SOUND_TYPES="$SOUND_TYPES JACK" - fi - else - AC_CHECK_LIB(jack, jack_client_open, HAVE_JACK=yes, HAVE_JACK=no, - [$LIBS]) - if test "x$HAVE_JACK" = "xyes"; then - AC_CHECK_HEADER(jack/jack.h, HAVE_JACK=yes, HAVE_JACK=no) - if test "x$HAVE_JACK" = "xyes"; then - JACK_LIBS="-ljack" - AC_DEFINE(HAVE_JACK, 1, [Define if you have libjack]) - SOUND_TYPES="$SOUND_TYPES JACK" - fi - fi - fi -fi -AC_SUBST(JACK_LIBS) - -dnl AC_ARG_ENABLE(samplerate, -dnl [ --disable-samplerate disable libsamplerate support], -dnl ) -HAVE_SAMPLERATE=no -SAMPLERATE_LIBS="" -if test "x$enable_samplerate" != "xno"; then - if test "x$PKG_CONFIG" != "x"; then - PKG_CHECK_MODULES([SAMPLERATE], [samplerate], HAVE_SAMPLERATE=yes, - HAVE_SAMPLERATE=no) - if test "x$HAVE_SAMPLERATE" = "xyes"; then - AC_DEFINE(HAVE_SAMPLERATE, 1, [Define if you have libsamplerate]) - fi - else - AC_CHECK_LIB(samplerate, src_callback_new, HAVE_SAMPLERATE=yes, - HAVE_SAMPLERATE=no, [$LIBS]) - if test "x$HAVE_SAMPLERATE" = "xyes"; then - AC_CHECK_HEADER(samplerate.h, HAVE_SAMPLERATE=yes, - HAVE_SAMPLERATE=no) - if test "x$HAVE_SAMPLERATE" = "xyes"; then - SAMPLERATE_LIBS="-lsamplerate" - AC_DEFINE(HAVE_SAMPLERATE, 1, - [Define if you have libsamplerate]) - fi - fi - fi -fi -AC_SUBST(SAMPLERATE_LIBS) -dnl AM_CONDITIONAL(HAVE_SAMPLERATE, test "$HAVE_SAMPLERATE" = "yes") -if test "x$HAVE_SAMPLERATE" = "xno"; then - AC_MSG_ERROR(libsamplerate is required but wasn't found) -fi - -SOUND_TYPES="$SOUND_TYPES DISK" - -dnl MME -if test "x$ac_cv_header_mme_mmsystem_h" = "xyes" -a \ - "x$HAVE_LIBMME" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef WAVE_OPEN_SHAREABLE -QF_maGiC_VALUE -#endif - ], - SOUND_TYPES="$SOUND_TYPES MME" - MME_LIBS="-lmme" - ) -fi -AC_SUBST(MME_LIBS) - -dnl OSS -HAVE_OSS=no -if test "x$enable_oss" != "xno"; then - if test "x$ac_cv_header_sys_soundcard_h" = "xyes" -o \ - "x$ac_cv_header_machine_soundcard_h" = "xyes" -o \ - "x$ac_cv_header_linux_soundcard_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef SNDCTL_DSP_SETTRIGGER -QF_maGiC_VALUE -#endif - ], - SOUND_TYPES="$SOUND_TYPES OSS" - HAVE_OSS=yes - OSS_LIBS= - , - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef SNDCTL_DSP_SETTRIGGER -QF_maGiC_VALUE -#endif - ], - SOUND_TYPES="$SOUND_TYPES OSS" - HAVE_OSS=yes - OSS_LIBS= - , - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef SNDCTL_DSP_SETTRIGGER -QF_maGiC_VALUE -#endif - ], - SOUND_TYPES="$SOUND_TYPES OSS" - HAVE_OSS=yes - OSS_LIBS= - ) - ) - ) - fi -fi -AC_SUBST(HAVE_OSS) -AC_SUBST(OSS_LIBS) - -dnl SDL digital audio -if test "x$HAVE_SDL_AUDIO" = "xyes"; then - SOUND_TYPES="$SOUND_TYPES SDL" -fi - -dnl SGI -if test "x$ac_cv_header_dmedia_audio_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef AL_SAMPLE_16 -# ifdef AL_RATE -QF_maGiC_VALUE -# endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES SGI" - SGISND_LIBS="-laudio") -fi -AC_SUBST(SGISND_LIBS) - -dnl Sun -if test "x$ac_cv_header_sys_audioio_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef AUDIO_SETINFO -QF_maGiC_VALUE -#endif - ], - SOUND_TYPES="$SOUND_TYPES SUN" - ) -fi - -dnl Win32 -if test "x$ac_cv_header_windows_h" = "xyes"; then - SOUND_TYPES="$SOUND_TYPES Win32" - WINSND_LIBS="-lwinmm" - if test "x$ac_cv_header_dsound_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#include -#ifdef GMEM_MOVEABLE -# ifdef DirectSoundEnumerate -QF_maGiC_VALUE -# endif -#endif - ], - SOUND_TYPES="$SOUND_TYPES DirectX" - ) - fi -fi -AC_SUBST(WINSND_LIBS) - -if test "x$enable_sound" = "xno"; then - unset SOUND_TYPES -fi - -dnl Tests for joystick support -AC_MSG_CHECKING(for joystick support) -if test -z "$JOYTYPE" -a "x$ac_cv_header_linux_joystick_h" = "xyes"; then - AC_EGREP_CPP([QF_maGiC_VALUE],[ -#include -#ifdef JS_VERSION -QF_maGiC_VALUE -#endif - ], JOYTYPE="Linux") -fi - -if test -z "$JOYTYPE" -a "x$ac_cv_header_dinput_h" = "xyes"; then - JOYTYPE="Win32" -fi - -if test "$JOYTYPE"; then - AC_MSG_RESULT([$JOYTYPE]) -else - AC_MSG_RESULT([no, using null joystick driver]) -fi -AC_SUBST(JOY_LIBS) -AC_SUBST(JOY_CFLAGS) -AM_CONDITIONAL(JOYTYPE_LINUX, test "$JOYTYPE" = "Linux") -AM_CONDITIONAL(JOYTYPE_WIN32, test "$JOYTYPE" = "Win32") -AM_CONDITIONAL(JOYTYPE_NULL, test "$JOYTYPE" != "Linux" -a "$JOYTYPE" != "Win32") - -dnl ================================================================== -dnl Checks for CD-ROM -dnl ================================================================== - -CD_CFLAGS="" -if test "x$HAVE_VORBIS" = xyes; then - CD_PLUGIN_TARGETS="cd_file.la" -else - CD_PLUGIN_TARGETS="" -fi -unset CDTYPE - -AC_MSG_CHECKING(for CD audio support) - -dnl Linux -AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef CDROMREADTOCENTRY -QF_maGiC_VALUE -#endif - ], - CDTYPE="$CDTYPE Linux" - CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_linux.la" -) - -dnl XMMS audio -if test "x$HAVE_XMMS" = "xyes"; then - CDTYPE="$CDTYPE XMMS" - CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_xmms.la" - AC_DEFINE(HAVE_XMMS, [1], [Define if you have XMMS]) -fi - -dnl SDL CD audio -if test "x$HAVE_SDL_CD" = "xyes"; then - CDTYPE="$CDTYPE SDL" - CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_sdl.la" -fi - -dnl SGI -AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#ifdef CD_READY -QF_maGiC_VALUE -#endif - ], - CDTYPE="$CDTYPE SGI" - CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_sgi.la" - SGI_CD_LIBS="-lcdaudio -lmediad -lds" -) -AC_SUBST(SGI_CD_LIBS) - -AC_EGREP_CPP([QF_maGiC_VALUE], - [ -#include -#include -#if defined(MCI_SET_DOOR_OPEN) -QF_maGiC_VALUE -#endif - ], - CDTYPE="$CDTYPE WIN32" - CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_win.la" -) -if test "$CDTYPE"; then - AC_MSG_RESULT([$CDTYPE]) -else - AC_MSG_RESULT([no]) -fi - -AC_SUBST(CD_LIBS) -AC_SUBST(CD_CFLAGS) - -dnl ================================================================== -dnl Checks for networking -dnl ================================================================== - -if test "x$ac_cv_func_connect" != "xyes"; then - AC_CHECK_LIB(socket, connect, - NET_LIBS="$NET_LIBS -lsocket" - ac_cv_func_connect=yes - ) -fi -if test "x$ac_cv_func_gethostbyname" != "xyes"; then - AC_CHECK_LIB(nsl, gethostbyname, - NET_LIBS="$NET_LIBS -lnsl" - ac_cv_func_gethostbyname=yes - ) -fi - -AC_MSG_CHECKING([for connect in -lwsock32]) -SAVELIBS="$LIBS" -LIBS="$LIBS -lwsock32" -AC_TRY_LINK([ -#include -], -[ -connect(0, NULL, 42); -], - NET_LIBS="$NET_LIBS -lwsock32 -lwinmm" - ac_cv_func_connect=yes - ac_cv_func_gethostbyname=yes - HAVE_WSOCK=yes - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) -) -LIBS="$SAVELIBS" - -AC_MSG_CHECKING(for UDP support) -if test "x$ac_cv_func_connect" = "xyes" -a "x$ac_cv_func_gethostbyname" = "xyes"; then - HAVE_UDP=yes - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -if test "x$ac_cv_func_connect" != "xyes"; then - AC_MSG_CHECKING([for connect in -lwsock32]) - SAVELIBS="$LIBS" - LIBS="$LIBS -lwsock32" - AC_TRY_LINK([ -#include - ], - [ -connect (0, NULL, 42); - ], - NET_LIBS="$NET_LIBS -lwsock32 -lwinmm" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) - LIBS="$SAVELIBS" -fi -AC_SUBST(NET_LIBS) - - -dnl ================================================================== -dnl Misc checks -dnl ================================================================== - -if test -d $srcdir/.svn -o -d $srcdir/.git; then - cvs_def_enabled="!= xno" - cvs_def_disabled="= xyes" -else - cvs_def_enabled="= xyes" - cvs_def_disabled="!= xno" -fi - -dnl Whether to enable XDG support or not -AC_ARG_ENABLE(xdg, -[ --enable-xdg enable XDG support], - xdg=$enable_xdg, - xdg=no -) -if test "x$xdg" != xno; then - HAVE_XDG=yes -else - HAVE_XDG=no -fi - -dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set -test "x$prefix" = "xNONE" && eval prefix="${ac_default_prefix}" -test "x$exec_prefix" = "xNONE" && eval exec_prefix="${prefix}" -test "x$datarootdir" = "x" && eval exec_prefix="${prefix}/share" - -if test "x$SYSTYPE" = "xWIN32"; then - default_globalconf="~/${PACKAGE}.conf" - default_userconf="~/${PACKAGE}rc" - default_sharepath="." - default_userpath="." -else - default_globalconf="/etc/${PACKAGE}.conf" - eval foo="$datarootdir" - default_sharepath="$foo/games/$PACKAGE" - - if test "x$HAVE_XDG" = "xyes"; then - default_userconf="~/.config/${PACKAGE}/${PACKAGE}.conf" - default_userpath="~/.local/share/${PACKAGE}" - else - default_userconf="~/.${PACKAGE}rc" - default_userpath="~/.$PACKAGE" - fi -fi - -AC_ARG_WITH(global-cfg, -[ --with-global-cfg=FILE If set will change the name and location of the - global config file used by QuakeForge. Defaults to - /etc/quakeforge.conf.], -globalconf="$withval", globalconf="auto") -if test "x$globalconf" = "xauto" || test "x$globalconf" = "xyes" || \ - test "x$globalconf" = "xno"; then dnl yes/no sanity checks - globalconf="$default_globalconf" -fi -AC_DEFINE_UNQUOTED(FS_GLOBALCFG, "$globalconf", [Define this to the location of the global config file]) -AC_SUBST(globalconf) - -AC_ARG_WITH(user-cfg, -[ --with-user-cfg=FILE If set will change the name and location of the - user-specific config file used by QuakeForge. - Defaults to ~/.quakeforgerc.], -userconf="$withval", userconf="auto") -if test "x$userconf" = "xauto" || test "x$userconf" = "xyes" || \ - test "x$userconf" = "xno"; then dnl yes/no sanity checks - userconf="$default_userconf" -fi -AC_DEFINE_UNQUOTED(FS_USERCFG, "$userconf", [Define this to the location of the user config file]) -AC_SUBST(userconf) - -AC_ARG_WITH(sharepath, -[ --with-sharepath=DIR Use DIR for shared game data, defaults to - '.' or \${datarootdir}/games/quakeforge (if new style)], -sharepath=$withval, sharepath="auto") -if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then - sharepath="$default_sharepath" -elif test "x$sharepath" = xno; then - sharepath="." -fi -AC_DEFINE_UNQUOTED(FS_SHAREPATH, "$sharepath", [Define this to the shared game directory root]) -AC_SUBST(sharepath) - -AC_ARG_WITH(userpath, -[ --with-userpath=DIR Use DIR for unshared game data, defaults to - '.' or ~/.quakeforge (if new style)], -userpath=$withval, userpath="auto") -if test "x$userpath" = "xauto" -o "x$userpath" = "xyes" -o "x$userpath" = "x"; then - userpath="$default_userpath" -elif test "x$userpath" = xno; then - userpath="." -fi -AC_DEFINE_UNQUOTED(FS_USERPATH, "$userpath", [Define this to the unshared game directory root]) -AC_SUBST(userpath) - -AC_ARG_WITH(plugin-path, -[ --with-plugin-path=DIR Use DIR for loading plugins, defaults to - \${libdir}/quakeforge], -plugindir=$withval, plugindir="auto") - -PLUGINDIR="\${libdir}/quakeforge" -if test "x$plugindir" = "xauto" -o "x$plugindir" = "xyes" -o "x$plugindir" = "x"; then - plugindir="$PLUGINDIR" -elif test "x$plugindir" = xno; then - plugindir="." -else - PLUGINDIR="$plugindir" -fi -eval expanded_plugindir="$plugindir" -eval expanded_plugindir="$expanded_plugindir" -AC_DEFINE_UNQUOTED(FS_PLUGINPATH, "$expanded_plugindir", [Define this to the path from which to load plugins]) -AC_SUBST(plugindir) -AC_SUBST(PLUGINDIR) - -AC_ARG_WITH(gl-driver, - [ --with-gl-driver=NAME Name of OpenGL driver DLL/DSO], - gl_driver=$withval, - gl_driver=auto -) -if test "x$gl_driver" = xauto -o "x$gl_driver" = xyes; then - if test "$SYSTYPE" = WIN32; then - gl_driver="OPENGL32.DLL" - else - gl_driver="libGL.so.1" - fi -fi -AC_DEFINE_UNQUOTED(GL_DRIVER, "$gl_driver", [Define this to the default GL dynamic lib]) - -dnl CFLAGS for release and devel versions -AC_ARG_WITH(efence, - [ --with-efence link with -lefence], - AC_CHECK_LIB(efence,malloc) -) - -AC_ARG_ENABLE(debug, - [ --disable-debug compile without debugging], - debug=$enable_debug -) -AC_MSG_CHECKING(for debugging) -if test "x$debug" != xno; then - AC_MSG_RESULT(yes) - BUILD_TYPE="$BUILD_TYPE Debug" - CFLAGS="$CFLAGS -g" -else - AC_MSG_RESULT(no) -fi - -AC_ARG_ENABLE(optimize, - [ --disable-optimize compile without optimizations (for development)], - optimize=$enable_optimize, - optimize=yes -) +m4_include(config.d/build_control.m4) +m4_include(config.d/qfcc.m4) +m4_include(config.d/compiling.m4) AC_ARG_ENABLE(typecheck-progs, [ --enable-typecheck-progs Enable type checking on progs field access]) @@ -1553,231 +115,6 @@ if test "x$enable_typecheck_progs" = xyes; then AC_DEFINE(TYPECHECK_PROGS, 1, [Define this if you want progs typechecking]) fi -AC_MSG_CHECKING(for optimization) -if test "x$optimize" = xyes; then - AC_MSG_RESULT(yes) - BUILD_TYPE="$BUILD_TYPE Optimize" - if test "x$GCC" = xyes; then - set $CC - shift - args="$*" - AC_MSG_CHECKING(for gcc version) - CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*(GCC)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" - set $CCVER - save_IFS="$IFS" - IFS="." - set $2 - CC_MAJ=$1 - CC_MIN=$2 - CC_SUB=$3 - IFS="$save_IFS" - AC_MSG_RESULT($CCVER) - saved_cflags="$CFLAGS" - CFLAGS="" - QF_CC_OPTION(-frename-registers) - if test "$CC_MAJ" -ge 4; then - QF_CC_OPTION(-finline-limit=32000 -Winline) - fi - heavy="-O2 $CFLAGS -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations" - CFLAGS="$saved_cflags" - light="-O2" - AC_ARG_ENABLE(strict-aliasing, - [ --enable-strict-aliasing enable the -fstrict-aliasing option of gcc]) - if test "x$enable_strict_aliasing" = "xyes"; then - heavy="$heavy -fstrict-aliasing" - light="$light -fstrict-aliasing" - else - if test "x$enable_strict_aliasing" != "xno"; then - if test $CC_MAJ -ge 3; then - heavy="$heavy -fstrict-aliasing" - else - if test $CC_MAJ = 2 -a $CC_MIN = 96; then - light="$light -fno-strict-aliasing" - fi - fi - else - if test $CC_MAJ = 2 -a $CC_MIN = 96; then - light="$light -fno-strict-aliasing" - fi - fi - fi - AC_MSG_CHECKING(for special compiler settings) - AC_ARG_WITH(arch, - [ --with-arch=ARCH control compiler architecture directly], - arch="$withval", arch=auto - ) - case "$arch" in - auto) - case "${host_cpu}" in - i?86) - MORE_CFLAGS="-march=${host_cpu}" - ;; - *) - MORE_CFLAGS="" - ;; - esac - ;; - no|"") - MORE_CFLAGS="" - ;; - *) - MORE_CFLAGS="-march=$arch" - ;; - esac - if test "x$MORE_CFLAGS" = x; then - AC_MSG_RESULT(no) - else - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $MORE_CFLAGS" - AC_TRY_COMPILE( - [], - [], - AC_MSG_RESULT(yes), - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT(no) - ) - fi - if test $CC_MAJ = 2 -a $CC_MIN = 96; then - AC_MSG_CHECKING(if align options work) - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2" - AC_TRY_COMPILE( - [], - [], - light="$light -malign-loops=2 -malign-jumps=2 -malign-functions=2" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) - CFLAGS="$save_CFLAGS" - CFLAGS="$CFLAGS $light" - else - CFLAGS="$CFLAGS $heavy" - fi - else - CFLAGS=-O2 - fi -else - AC_MSG_RESULT(no) -fi - -dnl CFLAGS for release and devel versions -AC_ARG_ENABLE(profile, - [ --enable-profile compile with profiling (for development)], - profile=$enable_profile -) -if test "x$profile" = xyes; then - BUILD_TYPE="$BUILD_TYPE Profile" - if test "x$GCC" = xyes; then - CFLAGS="`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'` -pg" - LDFLAGS="$LDFLAGS -pg" - else - CFLAGS="$CFLAGS -p" - fi -fi - -check_pipe=no -if test "x$GCC" = xyes; then - dnl Check for -pipe vs -save-temps. - AC_MSG_CHECKING(for -pipe vs -save-temps) - AC_ARG_ENABLE(save-temps, - [ --enable-save-temps save temporary files], - AC_MSG_RESULT(-save-temps) - CFLAGS="$CFLAGS -save-temps" - BUILD_TYPE="$BUILD_TYPE Save-temps" - , - AC_MSG_RESULT(-pipe) - check_pipe=yes - ) -fi -if test "x$check_pipe" = xyes; then - QF_CC_OPTION(-pipe) -fi -QF_CC_OPTION(-Wsign-compare) -QF_CC_OPTION_TEST([-fvisibility=hidden], [VISIBILITY=-fvisibility=hidden]) - -dnl QuakeForge uses lots of BCPL-style (//) comments, which can cause problems -dnl with many compilers that don't support the latest ISO standards. Well, -dnl that is our cover story -- the reality is that we like them and don't want -dnl to give them up. :) -dnl Make the compiler swallow its pride... -if test "x$GCC" != xyes; then - AC_MSG_CHECKING(for how to deal with BCPL-style comments) - case "${host}" in - *-aix*) - CFLAGS="$CFLAGS -qcpluscmt" - AC_MSG_RESULT([-qcpluscmt]) - ;; - *-irix6*) - CFLAGS="$CFLAGS -Xcpluscomm" - AC_MSG_RESULT([-Xcpluscomm]) - ;; - *-solaris*) - CFLAGS="$CFLAGS -xCC" - AC_MSG_RESULT([-xCC]) - ;; - *) - AC_MSG_RESULT(nothing needed or no switch known) - ;; - esac -fi - -AC_ARG_ENABLE(Werror, -[ --disable-Werror Do not treat warnings as errors] -) -dnl We want warnings, lots of warnings... -dnl The help text should be INVERTED before release! -dnl when in svn, this test defaults to ENABLED. -dnl In a release, this test defaults to DISABLED. -if test "x$GCC" = "xyes"; then - if test "x$enable_Werror" $cvs_def_enabled; then - CFLAGS="$CFLAGS -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations" - else - CFLAGS="$CFLAGS -Wall" - fi - CFLAGS="$CFLAGS -fno-common" -fi - -AS="$CC" -if test "x$SYSTYPE" = "xWIN32"; then - ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES) -D_WIN32" - plugin_ldflags="-no-undefined" - plugin_libadd="-luser32 -lgdi32 -lwinmm" - case "$host_os" in - mingw*) - if test "x$host" != "x$build"; then - case "$build_os" in - cygwin*) - plugin_libadd=" -L/usr/lib/w32api $plugin_libadd" - ;; - esac - fi - ;; - esac - -else - ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)" - plugin_ldflags= - plugin_libadd= -fi -ASFLAGS="$ASFLAGS -DQFASM" -CCASFLAGS="$ASFLAGS" -CCAS="$AS" -AC_SUBST(AS) -AC_SUBST(ASFLAGS) -AC_SUBST(CCAS) -AC_SUBST(CCASFLAGS) - -dnl silence automake about .r files -F77=touch -AC_SUBST(F77) - -if test "x$HAVE_ZLIB" = xyes; then - AC_DEFINE(HAVE_ZLIB, 1, [Define if you have zlib]) -fi -AC_SUBST(Z_LIBS) -AM_CONDITIONAL(HAVE_ZLIB, test "$HAVE_ZLIB" = "yes") -AM_CONDITIONAL(HAVE_XDG, test "$HAVE_XDG" = "yes") - AC_ARG_ENABLE(boxclip, [ --enable-boxclip enable box clipping], boxclip=$enable_boxclip, @@ -1789,752 +126,10 @@ else AC_DEFINE(ENABLE_BOXCLIP, 0, [Define if you want boxclipping]) fi -dnl ================================================================== -dnl Find out what to build -dnl ================================================================== - -QF_WITH_TARGETS( - clients, - [ --with-clients= compile clients in :], - [3dfx,fbdev,glx,mgl,sdl,sdl32,sgl,svga,wgl,x11],dummy -) -QF_WITH_TARGETS( - servers, - [ --with-servers= compile dedicated server:], - [master,nq,qw,qtv],dummy -) -QF_WITH_TARGETS( - tools, - [ --with-tools= compile qf tools:], - [bsp2img,carne,gsc,pak,qfbsp,qfcc,qflight,qfmodelgen,qfvis,qwaq,wad,wav],dummy -) - -unset CL_TARGETS -HW_TARGETS="" -QTV_TARGETS="" -QW_TARGETS="" -NQ_TARGETS="" -QW_DESKTOP_DATA="" -NQ_DESKTOP_DATA="" - -BUILD_GL=no -BUILD_SW32=no -BUILD_SW=no -CAN_BUILD_GL=no -CAN_BUILD_SW32=no -CAN_BUILD_SW=no - -CD_TARGETS="" -SND_PLUGIN_TARGETS="snd_output_disk.la" -SND_REND_TARGETS="" -SND_TARGETS="" -VID_MODEL_TARGETS="" -VID_REND_TARGETS="" -VID_REND_NOINST_TARGETS="" -VID_TARGETS="" - -if test "x$HAVE_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" - VID_TARGETS="$VID_TARGETS libQFfbdev.la" - BUILD_SW=yes - QF_NEED(vid, [common sw]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - CAN_BUILD_SW=yes -fi -if test "x$HAVE_X" = xyes; then - CAN_BUILD_GL=yes - CAN_BUILD_SW=yes - if test "x$ENABLE_clients_glx" = xyes; then - QW_TARGETS="$QW_TARGETS qw-client-glx\$(EXEEXT)" - NQ_TARGETS="$NQ_TARGETS nq-glx\$(EXEEXT)" - QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-glx.desktop" - NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-glx.desktop" - CL_TARGETS="$CL_TARGETS GLX" - VID_TARGETS="$VID_TARGETS libQFglx.la" - BUILD_GL=yes - QF_NEED(vid, [common gl x11]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - if test "x$ENABLE_clients_x11" = xyes; then - QW_TARGETS="$QW_TARGETS qw-client-x11\$(EXEEXT)" - NQ_TARGETS="$NQ_TARGETS nq-x11\$(EXEEXT)" - QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-x11.desktop" - NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-x11.desktop" - CL_TARGETS="$CL_TARGETS X11" - VID_TARGETS="$VID_TARGETS libQFx11.la" - BUILD_SW=yes - QF_NEED(vid, [common sw x11]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi -fi -if test "x$HAVE_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" - VID_TARGETS="$VID_TARGETS libQFwgl.la" - BUILD_SW=yes - QF_NEED(vid, [common sw]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - CAN_BUILD_SW=yes -fi -if test "x$HAVE_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)" - QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sdl.desktop" - NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl.desktop" - CL_TARGETS="$CL_TARGETS SDL" - VID_TARGETS="$VID_TARGETS libQFsdl.la" - BUILD_SW=yes - QF_NEED(vid, [common sdl sw]) - QF_NEED(qw, [client common sdl]) - QF_NEED(nq, [client common sdl]) - QF_NEED(console, [client]) - fi - CAN_BUILD_SW=yes - if test "x$ENABLE_clients_sdl32" = xyes; then - QW_TARGETS="$QW_TARGETS qw-client-sdl32\$(EXEEXT)" - NQ_TARGETS="$NQ_TARGETS nq-sdl32\$(EXEEXT)" - QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sdl32.desktop" - NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl32.desktop" - CL_TARGETS="$CL_TARGETS SDL32" - VID_TARGETS="$VID_TARGETS libQFsdl32.la" - BUILD_SW32=yes - QF_NEED(vid, [common sdl sw32]) - QF_NEED(qw, [client common sdl]) - QF_NEED(nq, [client common sdl]) - QF_NEED(console, [client]) - fi - CAN_BUILD_SW32=yes - if test "x$ENABLE_clients_sgl" = xyes; then - QW_TARGETS="$QW_TARGETS qw-client-sgl\$(EXEEXT)" - NQ_TARGETS="$NQ_TARGETS nq-sgl\$(EXEEXT)" - QW_DESKTOP_DATA="$QW_DESKTOP_DATA quakeforge-qw-sgl.desktop" - NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sgl.desktop" - CL_TARGETS="$CL_TARGETS SDL-GL" - VID_TARGETS="$VID_TARGETS libQFsgl.la" - BUILD_GL=yes - CAN_BUILD_GL=yes - QF_NEED(vid, [common sdl gl]) - QF_NEED(qw, [client common sdl]) - QF_NEED(nq, [client common sdl]) - QF_NEED(console, [client]) - fi -fi -if test "x$HAVE_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" - VID_TARGETS="$VID_TARGETS libQFsvga.la" - BUILD_SW=yes - QF_NEED(vid, [asm common svga sw]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - CAN_BUILD_SW=yes - 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" - VID_TARGETS="$VID_TARGETS libQFtdfx.la" - BUILD_GL=yes - QF_NEED(vid, [asm common gl svga]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - CAN_BUILD_GL=yes -fi -if test "x$mingw" = 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" - VID_TARGETS="$VID_TARGETS libQFwgl.la" - BUILD_GL=yes - QF_NEED(vid, [common gl]) - QF_NEED(qw, [client common]) - QF_NEED(nq, [client common]) - QF_NEED(console, [client]) - fi - CAN_BUILD_GL=yes -fi - -unset SV_TARGETS -if test "x$ENABLE_servers_nq" = xyes; then - NQ_TARGETS="nq-server\$(EXEEXT) $NQ_TARGETS" - SV_TARGETS="$SV_TARGETS nq" - QF_NEED(nq, [common server]) - QF_NEED(console, [server]) -fi -if test "x$ENABLE_servers_qtv" = xyes; then - QTV_TARGETS="qtv\$(EXEEXT) $QTV_TARGETS" - SV_TARGETS="$SV_TARGETS qtv" -# QF_NEED(qtv, [common server]) - QF_NEED(console, [server]) -fi -if test "x$ENABLE_servers_master" = xyes; then - HW_TARGETS="hw-master\$(EXEEXT) $HW_TARGETS" - QW_TARGETS="qw-master\$(EXEEXT) $QW_TARGETS" - SV_TARGETS="$SV_TARGETS master" -fi -if test "x$ENABLE_servers_qw" = xyes; then - QW_TARGETS="qw-server\$(EXEEXT) $QW_TARGETS" - SV_TARGETS="$SV_TARGETS qw" - QF_NEED(qw, [common server]) - QF_NEED(console, [server]) -fi - -unset TOOLS_TARGETS -if test "x$ENABLE_tools_bsp2img" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS bsp2img" -fi -if test "x$ENABLE_tools_carne" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS carne" -fi -if test "x$ENABLE_tools_gsc" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS gsc" -fi -if test "x$ENABLE_tools_pak" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS pak" -fi -if test "x$ENABLE_tools_qfbsp" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS qfbsp" -fi -if test "x$ENABLE_tools_qfcc" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS qfcc" -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_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_wad" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS wad" -fi -if test "x$ENABLE_tools_wav" = xyes; then - TOOLS_TARGETS="$TOOLS_TARGETS wav" -fi - -AM_CONDITIONAL(BUILD_BSP2IMG, test "$ENABLE_tools_bsp2img" = "yes") -AM_CONDITIONAL(BUILD_CARNE, test "$ENABLE_tools_carne" = "yes") -AM_CONDITIONAL(BUILD_GSC, test "$ENABLE_tools_gsc" = "yes") -AM_CONDITIONAL(BUILD_PAK, test "$ENABLE_tools_pak" = "yes") -AM_CONDITIONAL(BUILD_QFBSP, test "$ENABLE_tools_qfbsp" = "yes") -AM_CONDITIONAL(BUILD_QFCC, test "$ENABLE_tools_qfcc" = "yes") -AM_CONDITIONAL(BUILD_QFLIGHT, test "$ENABLE_tools_qflight" = "yes") -AM_CONDITIONAL(BUILD_QFMODELGEN, test "$ENABLE_tools_qfmodelgen" = "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_WAD, test "$ENABLE_tools_wad" = "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" -fi -if test "x$BUILD_SW32" = xyes; then - VID_REND_TARGETS="$VID_REND_TARGETS libQFrenderer_sw32.la" - if test "x$BUILD_SW" != xyes; then - VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_sw.la" - fi -fi -if test "x$BUILD_GL" = xyes; then - VID_REND_TARGETS="$VID_REND_TARGETS libQFrenderer_gl.la" - VID_MODEL_TARGETS="$VID_MODEL_TARGETS libQFmodels_gl.la" -fi - -QF_PROCESS_NEED(vid, [asm common gl sdl sw sw32 svga x11]) -QF_PROCESS_NEED(qw, [client common sdl server], a) -QF_PROCESS_NEED(nq, [client common sdl server], a) - -AC_SUBST(CAN_BUILD_GL) -AC_SUBST(CAN_BUILD_SW) -AC_SUBST(CAN_BUILD_SW32) - -AC_SUBST(HAVE_FBDEV) -AC_SUBST(HAVE_SDL) -AC_SUBST(HAVE_SVGA) -AC_SUBST(HAVE_X) - -ALSA_PLUGIN="alsa" -if test "`echo $SOUND_TYPES | grep ALSA0_9`"; then - ALSA_PLUGIN="alsa0_9" -fi - -if test -n "$CL_TARGETS"; then - CD_TARGETS="libQFcd.la" - SND_TARGETS="libQFsound.la" - JOY_TARGETS="libQFjs.la" - # the following will catch both ALSA and ALSA0_9 - if test "`echo $SOUND_TYPES | grep ALSA`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_$ALSA_PLUGIN.la" - fi - if test "`echo $SOUND_TYPES | grep MME`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_mme.la" - fi - if test "`echo $SOUND_TYPES | grep OSS`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_oss.la" - fi - if test "`echo $SOUND_TYPES | grep SDL`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sdl.la" - fi - if test "`echo $SOUND_TYPES | grep SGI`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sgi.la" - fi - if test "`echo $SOUND_TYPES | grep SUN`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_sun.la" - fi - if test "`echo $SOUND_TYPES | grep Win32`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_win.la" - fi - if test "`echo $SOUND_TYPES | grep DirectX`"; then - SND_PLUGIN_TARGETS="$SND_PLUGIN_TARGETS snd_output_dx.la" - fi - if test "$SOUND_TYPES"; then - SND_REND_TARGETS="$SND_REND_TARGETS snd_render_default.la" - if test "`echo $SOUND_TYPES | grep JACK`"; then - SND_REND_TARGETS="$SND_REND_TARGETS snd_render_jack.la" - fi - fi - - # priority sorted list for default sound driver in order of increasing - # priority. default is no driver. - SND_OUTPUT_DEFAULT="" - if test "`echo $SOUND_TYPES | grep SDL`"; then - SND_OUTPUT_DEFAULT="sdl" - fi - if test "`echo $SOUND_TYPES | grep MME`"; then - SND_OUTPUT_DEFAULT="mme" - fi - if test "`echo $SOUND_TYPES | grep SGI`"; then - SND_OUTPUT_DEFAULT="sgi" - fi - if test "`echo $SOUND_TYPES | grep SUN`"; then - SND_OUTPUT_DEFAULT="sun" - fi - if test "`echo $SOUND_TYPES | grep Win32`"; then - SND_OUTPUT_DEFAULT="win" - fi - if test "`echo $SOUND_TYPES | grep DirectX`"; then - SND_OUTPUT_DEFAULT="dx" - fi - if test "`echo $SOUND_TYPES | grep OSS`"; then - SND_OUTPUT_DEFAULT="oss" - fi - if test "`echo $SOUND_TYPES | grep ALSA`"; then - SND_OUTPUT_DEFAULT="$ALSA_PLUGIN" - fi - AC_DEFINE_UNQUOTED(SND_OUTPUT_DEFAULT, "$SND_OUTPUT_DEFAULT", [Define this to the default sound output driver.]) -else - unset CDTYPE - CD_PLUGIN_TARGETS="" - CD_TARGETS="" - JOY_TARGETS="" - SND_PLUGIN_TARGETS="" - SND_REND_TARGETS="" - SND_TARGETS="" - unset SOUND_TYPES -fi -AC_SUBST(ALSA_PLUGIN) - -SERVER_PLUGIN_TARGETS="" -if test x$console_need_server = xyes; then - SERVER_PLUGIN_TARGETS="console_server.la" -fi -SERVER_PLUGIN_STATIC="" -CLIENT_PLUGIN_TARGETS="" -if test x$console_need_client = xyes; then - CLIENT_PLUGIN_TARGETS="console_client.la" -fi -CLIENT_PLUGIN_STATIC="" -CD_PLUGIN_STATIC="" -SND_PLUGIN_STATIC="" -SND_REND_STATIC="" - -if test "x$enable_shared" = xno; then - PREFER_PIC= - PREFER_NON_PIC= -else - PREFER_PIC="-prefer-pic ${VISIBILITY}" - PREFER_NON_PIC="-prefer-non-pic ${VISIBILITY}" -fi -if test "x$enable_static" = xno; then - STATIC= -else - STATIC=-static -fi -AC_SUBST(PREFER_PIC) -AC_SUBST(PREFER_NON_PIC) -AC_SUBST(STATIC) - -AC_ARG_WITH(static-plugins, -[ --with-static-plugins build plugins into executable rather than separate], - static_plugins="$withval", static_plugins=auto) -if test "x$static_plugins" = xauto; then - if test "x$enable_shared" = xno -o "x$SYSTYPE" = xWIN32; then - static_plugins=yes - fi -fi -if test "x$static_plugins" = xyes; then - AC_DEFINE(STATIC_PLUGINS, 1, [Define this if you are building static plugins]) - SERVER_PLUGIN_STATIC="$SERVER_PLUGIN_TARGETS" - SERVER_PLUGIN_TARGETS="" - CLIENT_PLUGIN_STATIC="$CLIENT_PLUGIN_TARGETS" - CLIENT_PLUGIN_TARGETS="" - CD_PLUGIN_STATIC="$CD_PLUGIN_TARGETS" - CD_PLUGIN_TARGETS="" - SND_PLUGIN_STATIC="$SND_PLUGIN_TARGETS" - SND_PLUGIN_TARGETS="" - SND_REND_STATIC="$SND_REND_TARGETS" - SND_REND_TARGETS="" - if test -n "$SOUND_TYPES"; then - SOUND_TYPES="$SOUND_TYPES (static)" - CDTYPE="$CDTYPE (static)" - fi - plugin_ldflags="$plugin_ldflags" -else - plugin_ldflags="$plugin_ldflags"' -version-info $(plugin_version) -rpath $(plugindir)' -fi - -dnl Don't use -module here, it belongs in makefile.am due to automake -dnl needing it there to work correctly -plugin_ldflags="$plugin_ldflags -avoid-version" -SERVER_PLUGIN_STATIC_LIBS="" -CLIENT_PLUGIN_STATIC_LIBS="" -CD_PLUGIN_STATIC_LIBS="" -SND_PLUGIN_STATIC_LIBS="" -SND_REND_STATIC_LIBS="" -SERVER_PLUGIN_LIST="{0, 0}" -CLIENT_PLUGIN_LIST="{0, 0}" -CD_PLUGIN_LIST="{0, 0}" -SND_OUTPUT_LIST="{0, 0}" -SND_RENDER_LIST="{0, 0}" -SERVER_PLUGIN_PROTOS="" -CLIENT_PLUGIN_PROTOS="" -CD_PLUGIN_PROTOS="" -SND_OUTPUT_PROTOS="" -SND_RENDER_PROTOS="" -for l in $SERVER_PLUGIN_STATIC; do - SERVER_PLUGIN_STATIC_LIBS="$SERVER_PLUGIN_STATIC_LIBS "'$(top_builddir)'"/libs/console/$l" - n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" - SERVER_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SERVER_PLUGIN_LIST" - SERVER_PLUGIN_PROTOS="$SERVER_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" -done -for l in $CLIENT_PLUGIN_STATIC; do - CLIENT_PLUGIN_STATIC_LIBS="$CLIENT_PLUGIN_STATIC_LIBS "'$(top_builddir)'"/libs/console/$l" - n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" - CLIENT_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$CLIENT_PLUGIN_LIST" - CLIENT_PLUGIN_PROTOS="$CLIENT_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" -done -for l in $CD_PLUGIN_STATIC; do - CD_PLUGIN_STATIC_LIBS="$CD_PLUGIN_STATIC_LIBS $l" - n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" - CD_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$CD_PLUGIN_LIST" - CD_PLUGIN_PROTOS="$CD_PLUGIN_PROTOS extern plugin_t *${n}_PluginInfo (void);" -done -for l in $SND_PLUGIN_STATIC; do - SND_PLUGIN_STATIC_LIBS="$SND_PLUGIN_STATIC_LIBS targets/$l" - n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" - SND_OUTPUT_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_OUTPUT_LIST" - SND_OUTPUT_PROTOS="$SND_OUTPUT_PROTOS extern plugin_t *${n}_PluginInfo (void);" -done -for l in $SND_REND_STATIC; do - SND_REND_STATIC_LIBS="$SND_REND_STATIC_LIBS renderer/$l" - n="`echo $l | sed -e 's/\(.*\)\.la/\1/'`" - SND_RENDER_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_RENDER_LIST" - SND_RENDER_PROTOS="$SND_RENDER_PROTOS extern plugin_t *${n}_PluginInfo (void);" -done -AC_DEFINE_UNQUOTED(SERVER_PLUGIN_LIST, $SERVER_PLUGIN_LIST, [list of server plugins]) -AC_DEFINE_UNQUOTED(SERVER_PLUGIN_PROTOS, $SERVER_PLUGIN_PROTOS, [list of server prototypes]) -AC_DEFINE_UNQUOTED(CLIENT_PLUGIN_LIST, $CLIENT_PLUGIN_LIST, [list of client plugins]) -AC_DEFINE_UNQUOTED(CLIENT_PLUGIN_PROTOS, $CLIENT_PLUGIN_PROTOS, [list of client prototypes]) -AC_DEFINE_UNQUOTED(CD_PLUGIN_LIST, $CD_PLUGIN_LIST, [list of cd plugins]) -AC_DEFINE_UNQUOTED(CD_PLUGIN_PROTOS, $CD_PLUGIN_PROTOS, [list of cd prototypes]) -AC_DEFINE_UNQUOTED(SND_OUTPUT_LIST, $SND_OUTPUT_LIST, [list of sound output plugins]) -AC_DEFINE_UNQUOTED(SND_OUTPUT_PROTOS, $SND_OUTPUT_PROTOS, [list of sound output prototypes]) -AC_DEFINE_UNQUOTED(SND_RENDER_LIST, $SND_RENDER_LIST, [list of sound render plugins]) -AC_DEFINE_UNQUOTED(SND_RENDER_PROTOS, $SND_RENDER_PROTOS, [list of sound render prototypes]) - -AC_SUBST(HW_TARGETS) -AC_SUBST(NQ_TARGETS) -AC_SUBST(NQ_DESKTOP_DATA) -AC_SUBST(QTV_TARGETS) -AC_SUBST(QW_TARGETS) -AC_SUBST(QW_DESKTOP_DATA) -AC_SUBST(SERVER_PLUGIN_STATIC) -AC_SUBST(SERVER_PLUGIN_STATIC_LIBS) -AC_SUBST(SERVER_PLUGIN_TARGETS) -AC_SUBST(CLIENT_PLUGIN_STATIC) -AC_SUBST(CLIENT_PLUGIN_STATIC_LIBS) -AC_SUBST(CLIENT_PLUGIN_TARGETS) -AC_SUBST(CD_PLUGIN_STATIC) -AC_SUBST(CD_PLUGIN_STATIC_LIBS) -AC_SUBST(CD_PLUGIN_TARGETS) -AC_SUBST(CD_TARGETS) -AC_SUBST(JOY_TARGETS) -AC_SUBST(SND_PLUGIN_STATIC) -AC_SUBST(SND_PLUGIN_STATIC_LIBS) -AC_SUBST(SND_PLUGIN_TARGETS) -AC_SUBST(SND_REND_STATIC) -AC_SUBST(SND_REND_STATIC_LIBS) -AC_SUBST(SND_REND_TARGETS) -AC_SUBST(SND_TARGETS) -AC_SUBST(VID_MODEL_TARGETS) -AC_SUBST(VID_REND_TARGETS) -AC_SUBST(VID_REND_NOINST_TARGETS) -AC_SUBST(VID_TARGETS) -AC_SUBST(plugin_ldflags) -AC_SUBST(plugin_libadd) - -QF_DEPS(BSP2IMG, - [], - [$(top_builddir)/libs/image/libQFimage.la $(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QFBSP, - [-I$(top_srcdir)/tools/qfbsp/include], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QFCC, - [-I$(top_srcdir)/tools/qfcc/include], - [$(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QFLIGHT, - [-I$(top_srcdir)/tools/qflight/include], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QFMODELGEN, - [-I$(top_srcdir)/tools/qfmodelgen/include], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QFVIS, - [-I$(top_srcdir)/tools/qfvis/include], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(QWAQ, - [], - [$(top_builddir)/libs/ruamoko/libQFruamoko.la $(top_builddir)/libs/gamecode/engine/libQFgamecode.la $(top_builddir)/libs/util/libQFutil.la $(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la], - [$(WIN32_LIBS)], -) -QF_DEPS(CARNE, - [], - [$(top_builddir)/libs/gib/libQFgib.la $(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(GSC, - [], - [$(top_builddir)/libs/gibscript/libQFgibscript.la $(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(PAK, - [], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(WAD, - [], - [$(top_builddir)/libs/image/libQFimage.la $(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) -QF_DEPS(WAV, - [], - [$(top_builddir)/libs/util/libQFutil.la], - [$(WIN32_LIBS)], -) - -AC_DEFINE_UNQUOTED(PATH_SEPARATOR, '/', [Define this to your operating system path separator character]) -AC_DEFINE_UNQUOTED(CPP_NAME, "$CPP_NAME", [Define this to the command line for the C preprocessor]) -AC_DEFINE_UNQUOTED(QFCC_INCLUDE_PATH, "${prefix}/include/QF/ruamoko", [Define this to where qfcc should look for header files]) -eval expanded_libdir="${libdir}/ruamoko" -eval expanded_libdir="${expanded_libdir}" -AC_DEFINE_UNQUOTED(QFCC_LIB_PATH, "${expanded_libdir}", [Define this to where qfcc should look for lib files]) - -AM_CONDITIONAL(BUILD_GL, test "$BUILD_GL" = "yes") -AM_CONDITIONAL(BUILD_SW, test "$BUILD_SW" = "yes") -AM_CONDITIONAL(BUILD_SW_ASM, test "$BUILD_SW" = "yes" -a "$ASM_ARCH" = "yes") -AM_CONDITIONAL(BUILD_SW_MOD, test "$BUILD_SW" = "yes" -o "$BUILD_SW32" = "yes") -AM_CONDITIONAL(BUILD_SW32, test "$BUILD_SW32" = "yes") - -dnl Finalization of CFLAGS, LDFLAGS, and LIBS -AC_SUBST(CFLAGS) -AC_SUBST(LDFLAGS) -AC_SUBST(LIBS) - -AC_SUBST(AS) -AC_SUBST(AR) -AC_SUBST(RANLIB) dnl Output files -AC_OUTPUT( - Makefile - quakeforge.lsm +m4_include(config.d/rpm.m4) +AC_CONFIG_FILES(m4_include(config.d/ac_config_files.m4)) +AC_OUTPUT - include/Makefile - include/QF/Makefile - - libs/Makefile - libs/audio/Makefile - libs/audio/targets/Makefile - libs/audio/renderer/Makefile - libs/console/Makefile - libs/gamecode/Makefile - libs/gamecode/engine/Makefile - libs/gamecode/builtins/Makefile - libs/gib/Makefile - libs/image/Makefile - libs/models/Makefile - libs/models/alias/Makefile - libs/models/brush/Makefile - libs/models/sprite/Makefile - libs/net/Makefile - libs/net/nc/Makefile - libs/net/nm/Makefile - libs/qw/Makefile - libs/ruamoko/Makefile - libs/util/Makefile - libs/video/Makefile - libs/video/renderer/Makefile - libs/video/renderer/gl/Makefile - libs/video/renderer/sw/Makefile - libs/video/renderer/sw32/Makefile - libs/video/targets/Makefile - - hw/Makefile - hw/include/Makefile - hw/source/Makefile - - nq/Makefile - nq/include/Makefile - nq/source/Makefile - - qtv/Makefile - qtv/include/Makefile - qtv/source/Makefile - - qw/Makefile - qw/include/Makefile - qw/source/Makefile - - tools/Makefile - tools/bsp2img/Makefile - tools/carne/Makefile - tools/pak/Makefile - tools/qfbsp/Makefile - tools/qfbsp/include/Makefile - tools/qfbsp/source/Makefile - tools/qfcc/Makefile - tools/qfcc/doc/Makefile - tools/qfcc/doc/man/Makefile - tools/qfcc/include/Makefile - tools/qfcc/source/Makefile - tools/qflight/Makefile - tools/qflight/include/Makefile - tools/qflight/source/Makefile - tools/qfmodelgen/Makefile - tools/qfmodelgen/include/Makefile - tools/qfmodelgen/source/Makefile - tools/qfvis/Makefile - tools/qfvis/include/Makefile - tools/qfvis/source/Makefile - tools/qwaq/Makefile - tools/qwaq/progs.src - tools/wad/Makefile - tools/wav/Makefile - - ruamoko/Makefile - ruamoko/include/Makefile - ruamoko/lib/Makefile - ruamoko/game/Makefile - ruamoko/gui/Makefile - ruamoko/cl_menu/Makefile - ruamoko/scheme/Makefile - - pkg-config/Makefile - pkg-config/qfcc.pc - pkg-config/quakeforge.pc - - doc/Makefile - doc/quakeforge.dox - doc/man/Makefile - - debian/Makefile - - RPM/Makefile - RPM/build_rpm - RPM/quakeforge.conf - RPM/quakeforge.spec, - - chmod +x RPM/build_rpm -) - -if test "x$CCVER" = "x"; then - CCVER=$CC -else - if test "x$CCVER" = "xgcc 2.96"; then - CCVER="$CCVER -(Note: You might need CC=kgcc ./configure on some systems)" - fi -fi - -AC_MSG_RESULT([ - QuakeForge has been configured successfully. - - Build type :$BUILD_TYPE - Server support :${SV_TARGETS- no} - Client support :${CL_TARGETS- no} - Tools support :${TOOLS_TARGETS- no} - Sound support :${SOUND_TYPES- no} ${SND_OUTPUT_DEFAULT} - CD Audio system :${CDTYPE- no} - IPv6 networking : $NETTYPE_IPV6 - Compression support: gz=$HAVE_ZLIB ogg=$HAVE_VORBIS flac=$HAVE_FLAC png=$HAVE_PNG - HTTP support : ${CURL-no} - Compiler version : $CCVER - Compiler flags : $CFLAGS - qfcc cpp invocation: $CPP_NAME - - Shared game data directory : $sharepath - Per-user game data directory: $userpath - Plugin load directory : $expanded_plugindir - Global configuration file : $globalconf - User configuration file : $userconf - OpenGL dynamic lib : $gl_driver - libWildMidi Support : $HAVE_WILDMIDI - XDG support : $HAVE_XDG -]) - -if test -d $srcdir/.svn; then - echo "WARNING: Hackers at work, watch for falling bits of code." - echo "(This is from a development subversion tree. Expect problems)" - echo -fi +m4_include(config.d/result.m4) diff --git a/libs/util/zone.c b/libs/util/zone.c index 27f52188a..3317cbe38 100644 --- a/libs/util/zone.c +++ b/libs/util/zone.c @@ -453,7 +453,7 @@ Hunk_AllocName (int size, const char *name) Sys_Error ("Not enough RAM allocated. Try starting using \"-mem 16\" on " "the %s command line. (%d - %d - %d < %d)", - PROGRAM, hunk_size, hunk_low_used, hunk_high_used, size); + PACKAGE_NAME, hunk_size, hunk_low_used, hunk_high_used, size); } h = (hunk_t *) (hunk_base + hunk_low_used); diff --git a/libs/video/renderer/r_cvar.c b/libs/video/renderer/r_cvar.c index 66137c8ff..21a8ff92e 100644 --- a/libs/video/renderer/r_cvar.c +++ b/libs/video/renderer/r_cvar.c @@ -237,7 +237,7 @@ R_Init_Cvars (void) "Sets the position of the crosshair on the X-axis."); cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); - cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, + cl_verstring = Cvar_Get ("cl_verstring", PACKAGE_VERSION, CVAR_NONE, NULL, "Client version string"); crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair " "type. 0 off, 1 old white, 2 new with colors"); diff --git a/libs/video/targets/context_sdl.c b/libs/video/targets/context_sdl.c index 72587ea09..286fd8d7d 100644 --- a/libs/video/targets/context_sdl.c +++ b/libs/video/targets/context_sdl.c @@ -45,10 +45,10 @@ VID_SetCaption (const char *text) if (text && *text) { char *temp = strdup (text); - SDL_WM_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp), NULL); + SDL_WM_SetCaption (va ("%s: %s", PACKAGE_STRING, temp), NULL); free (temp); } else { - SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL); + SDL_WM_SetCaption (va ("%s", PACKAGE_STRING), NULL); } } diff --git a/libs/video/targets/context_x11.c b/libs/video/targets/context_x11.c index a5088b892..6ddfd9e0a 100644 --- a/libs/video/targets/context_x11.c +++ b/libs/video/targets/context_x11.c @@ -523,10 +523,10 @@ X11_CreateWindow (int width, int height) XFree (SizeHints); } // Set window title - X11_SetCaption (va ("%s %s", PROGRAM, VERSION)); + X11_SetCaption (va ("%s", PACKAGE_STRING)); // Set icon name - XSetIconName (x_disp, x_win, PROGRAM); + XSetIconName (x_disp, x_win, PACKAGE_NAME); // Set window class ClassHint = XAllocClassHint (); diff --git a/libs/video/targets/keys.c b/libs/video/targets/keys.c index 84e5ba0c0..318583964 100644 --- a/libs/video/targets/keys.c +++ b/libs/video/targets/keys.c @@ -881,7 +881,7 @@ Key_Init (cbuf_t *cb) Cmd_AddCommand ("bindlist", Key_Bindlist_f, "list all of the key bindings"); Cmd_AddCommand ("keyhelp", keyhelp_f, "display the keyname for the next " "RECOGNIZED key-press. If the key pressed produces no " - "output, " PROGRAM " does not recognise that key."); + "output, " PACKAGE_NAME " does not recognise that key."); GIB_Builtin_Add ("bind::get", Key_GIB_Bind_Get_f); diff --git a/libs/video/targets/vid_glx.c b/libs/video/targets/vid_glx.c index 9b28459c3..e1cfe4ab4 100644 --- a/libs/video/targets/vid_glx.c +++ b/libs/video/targets/vid_glx.c @@ -261,10 +261,10 @@ VID_SetCaption (const char *text) if (text && *text) { char *temp = strdup (text); - X11_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp)); + X11_SetCaption (va ("%s: %s", PACKAGE_STRING, temp)); free (temp); } else { - X11_SetCaption (va ("%s %s", PROGRAM, VERSION)); + X11_SetCaption (va ("%s", PACKAGE_STRING)); } } diff --git a/libs/video/targets/vid_wgl.c b/libs/video/targets/vid_wgl.c index 45539a0d4..03a5b7633 100644 --- a/libs/video/targets/vid_wgl.c +++ b/libs/video/targets/vid_wgl.c @@ -596,10 +596,10 @@ VID_SetCaption (const char *text) char *temp = strdup (text); SetWindowText (mainwindow, - (LPSTR) va ("%s %s: %s", PROGRAM, VERSION, temp)); + (LPSTR) va ("%s: %s", PACKAGE_STRING, temp)); free (temp); } else { - SetWindowText (mainwindow, (LPSTR) va ("%s %s", PROGRAM, VERSION)); + SetWindowText (mainwindow, (LPSTR) va ("%s", PACKAGE_STRING)); } } diff --git a/libs/video/targets/vid_x11.c b/libs/video/targets/vid_x11.c index 77e59545c..ec616b405 100644 --- a/libs/video/targets/vid_x11.c +++ b/libs/video/targets/vid_x11.c @@ -658,10 +658,10 @@ VID_SetCaption (const char *text) if (text && *text) { char *temp = strdup (text); - X11_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp)); + X11_SetCaption (va ("%s: %s", PACKAGE_STRING, temp)); free (temp); } else { - X11_SetCaption (va ("%s %s", PROGRAM, VERSION)); + X11_SetCaption (va ("%s", PACKAGE_STRING)); } } diff --git a/nq/source/host.c b/nq/source/host.c index 5c702596f..c51872026 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -838,7 +838,7 @@ CL_Init_Memory (void) host_mem_size = Cvar_Get ("host_mem_size", "32", CVAR_NONE, NULL, "Amount of memory (in MB) to allocate for the " - PROGRAM " heap"); + PACKAGE_NAME " heap"); if (mem_parm) Cvar_Set (host_mem_size, com_argv[mem_parm + 1]); @@ -1001,10 +1001,11 @@ Host_Init (void) Hunk_AllocName (0, "-HOST_HUNKLEVEL-"); host_hunklevel = Hunk_LowMark (); - Sys_Printf ("\nVersion %s (build %04d)\n\n", VERSION, + Sys_Printf ("\nVersion %s (build %04d)\n\n", PACKAGE_VERSION, build_number ()); - Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", PROGRAM); + Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", + PACKAGE_NAME); host_initialized = true; diff --git a/nq/source/host_cmd.c b/nq/source/host_cmd.c index f81af42e5..6f10e710e 100644 --- a/nq/source/host_cmd.c +++ b/nq/source/host_cmd.c @@ -97,7 +97,7 @@ Host_Status_f (void) print = SV_ClientPrintf; print ("host: %s\n", Cvar_VariableString ("hostname")); - print ("version: %4.2f\n", VERSION); + print ("version: %4.2f\n", PACKAGE_VERSION); if (tcpipAvailable) print ("tcp/ip: %s\n", my_tcpip_address); if (ipxAvailable) @@ -586,7 +586,7 @@ Host_Savegame_f (void) } save_text = PL_WritePropertyList (game_dict ()); - Qprintf (f, "%s\n%s", PROGRAM, save_text); + Qprintf (f, "%s\n%s", PACKAGE_NAME, save_text); free (save_text); Qclose (f); @@ -646,7 +646,7 @@ Host_Loadgame_f (void) Script_Start (script, name->str, script_data); Script_GetToken (script, 1); - if (strequal (script->token->str, PROGRAM)) { + if (strequal (script->token->str, PACKAGE_NAME)) { if (!Script_TokenAvailable (script, 1)) { Sys_Printf ("Unexpected EOF reading %s\n", name->str); goto end; @@ -776,7 +776,7 @@ Host_Name_f (void) static void Host_Version_f (void) { - Sys_Printf ("Version %s\n", VERSION); + Sys_Printf ("Version %s\n", PACKAGE_VERSION); Sys_Printf ("Exe: " __TIME__ " " __DATE__ "\n"); } diff --git a/qtv/source/qtv.c b/qtv/source/qtv.c index 37089a8b0..2eae1cdac 100644 --- a/qtv/source/qtv.c +++ b/qtv/source/qtv.c @@ -209,7 +209,7 @@ qtv_memory_init (void) qtv_mem_size = Cvar_Get ("qtv_mem_size", "8", CVAR_NONE, NULL, "Amount of memory (in MB) to allocate for the " - PROGRAM " heap"); + PACKAGE_NAME " heap"); Cvar_SetFlags (qtv_mem_size, qtv_mem_size->flags | CVAR_ROM); mem_size = (int) (qtv_mem_size->value * 1024 * 1024); @@ -322,7 +322,7 @@ static void qtv_status (void) { qtv_begin_redirect (RD_PACKET, 0); - Sys_Printf ("\\*version\\%s qtv %s", QW_VERSION, VERSION); + Sys_Printf ("\\*version\\%s qtv %s", QW_VERSION, PACKAGE_VERSION); qtv_end_redirect (); } diff --git a/qtv/source/server.c b/qtv/source/server.c index 41d7fa73f..72c55880f 100644 --- a/qtv/source/server.c +++ b/qtv/source/server.c @@ -452,7 +452,7 @@ sv_new_f (void) sv->qport = qport->int_val; sv->info = Info_ParseString ("", MAX_INFO_STRING, 0); Info_SetValueForStarKey (sv->info, "*ver", - va ("%s QTV %s", QW_VERSION, VERSION), 0); + va ("%s QTV %s", QW_VERSION, PACKAGE_VERSION), 0); Info_SetValueForStarKey (sv->info, "*qsg_version", QW_QSG_VERSION, 0); Info_SetValueForKey (sv->info, "name", "QTV Proxy", 0); Hash_Add (server_hash, sv); diff --git a/quakeforge.lsm.in b/quakeforge.lsm.in deleted file mode 100644 index 351b1d858..000000000 --- a/quakeforge.lsm.in +++ /dev/null @@ -1,18 +0,0 @@ -Begin3 -Title: @PROGRAM@ -Version: @VERSION@ -Entered-date: @ISODATE@ -Description: 3D game engine based on id Software's Quake engine -Keywords: 3D, game, engine, quake -Author: quakeforge-devel@lists.quakeforge.net (The QuakeForge Project) -Maintained-by: quakeforge-devel@lists.quakeforge.net (The QuakeForge Project) -Primary-site: http://www.quakeforge.net/ - 604k @PACKAGE@-@VERSION@.tar.bz2 - 730k @PACKAGE@-@VERSION@.tar.gz - 1007k @PACKAGE@-@VERSION@.zip - 550 @PACKAGE@.lsm -Alternate-site: http://sourceforge.net/projects/quake/ -Original-site: http://www.quakeforge.net/ -Platforms: any -Copying-policy: GPL v2 -End diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index b03b20c64..c8fb6ebdc 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -250,7 +250,7 @@ CL_Quit_f (void) static void CL_Version_f (void) { - Sys_Printf ("%s Version %s\n", PROGRAM, VERSION); + Sys_Printf ("%s Version %s\n", PACKAGE_NAME, PACKAGE_VERSION); Sys_Printf ("Binary: " __TIME__ " " __DATE__ "\n"); } @@ -675,7 +675,7 @@ CL_AddQFInfoKeys (void) ; Info_SetValueForStarKey (cls.userinfo, "*cap", cap, 0); - Info_SetValueForStarKey (cls.userinfo, "*qf_version", VERSION, 0); + Info_SetValueForStarKey (cls.userinfo, "*qf_version", PACKAGE_VERSION, 0); Info_SetValueForStarKey (cls.userinfo, "*qsg_version", QW_QSG_VERSION, 0); } @@ -932,7 +932,7 @@ CL_ConnectionlessPacket (void) ("Invalid localid on command packet received from local host. " "\n|%s| != |%s|\n" "You may need to reload your server browser and %s.\n", s, - localid->string, PROGRAM); + localid->string, PACKAGE_NAME); Sys_Printf ("===========================\n"); Cvar_Set (localid, ""); return; @@ -1673,7 +1673,7 @@ CL_Init_Memory (void) cl_mem_size = Cvar_Get ("cl_mem_size", "16", CVAR_NONE, NULL, "Amount of memory (in MB) to allocate for the " - PROGRAM " heap"); + PACKAGE_NAME " heap"); if (mem_parm) Cvar_Set (cl_mem_size, com_argv[mem_parm + 1]); @@ -1869,9 +1869,10 @@ Host_Init (void) Hunk_AllocName (0, "-HOST_HUNKLEVEL-"); host_hunklevel = Hunk_LowMark (); - Sys_Printf ("\nClient version %s (build %04d)\n\n", VERSION, + Sys_Printf ("\nClient version %s (build %04d)\n\n", PACKAGE_VERSION, build_number ()); - Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", PROGRAM); + Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", + PACKAGE_NAME); // make sure all + commands have been executed Cbuf_Execute_Stack (cl_cbuf); diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 5c7883886..542130f40 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -2228,7 +2228,7 @@ SV_InitLocal (void) !sv_highchars->int_val); // Brand server as QF, with appropriate QSG standards version --KB - Info_SetValueForStarKey (svs.info, "*qf_version", VERSION, + Info_SetValueForStarKey (svs.info, "*qf_version", PACKAGE_VERSION, !sv_highchars->int_val); Info_SetValueForStarKey (svs.info, "*qsg_version", QW_QSG_VERSION, !sv_highchars->int_val); @@ -2448,7 +2448,7 @@ SV_Init_Memory (void) sv_mem_size = Cvar_Get ("sv_mem_size", "8", CVAR_NONE, NULL, "Amount of memory (in MB) to allocate for the " - PROGRAM " heap"); + PACKAGE_NAME " heap"); if (mem_parm) Cvar_Set (sv_mem_size, com_argv[mem_parm + 1]); @@ -2581,11 +2581,12 @@ SV_Init (void) SV_Printf ("%4.1f megabyte heap\n", sv_mem_size->value); SV_Printf ("\n"); - SV_Printf ("%s server, Version %s (build %04d)\n", PROGRAM, VERSION, - build_number ()); + SV_Printf ("%s server, Version %s (build %04d)\n", + PACKAGE_NAME, PACKAGE_VERSION, + build_number ()); SV_Printf ("\n"); - SV_Printf ("<==> %s initialized <==>\n", PROGRAM); + SV_Printf ("<==> %s initialized <==>\n", PACKAGE_NAME); // process command line arguments Cmd_Exec_File (sv_cbuf, fs_usercfg->string, 0); diff --git a/qw/source/teamplay.c b/qw/source/teamplay.c index 325f8a928..44294de8c 100644 --- a/qw/source/teamplay.c +++ b/qw/source/teamplay.c @@ -431,7 +431,7 @@ Locs_Init (void) static const char * Team_F_Version (char *args) { - return va ("say %s %s", PROGRAM, VERSION); + return va ("say %s", PACKAGE_STRING); } static const char * diff --git a/tools/pak/pak.c b/tools/pak/pak.c index 3ed57fe3f..94aa256df 100644 --- a/tools/pak/pak.c +++ b/tools/pak/pak.c @@ -112,7 +112,7 @@ decode_args (int argc, char **argv) usage (0); break; case 'V': // version - printf ("pak version %s\n", VERSION); + printf ("pak version %s\n", PACKAGE_VERSION); exit (0); break; case 'c': // create diff --git a/tools/qfbsp/source/options.c b/tools/qfbsp/source/options.c index 7b908bb9e..2a10a5c92 100644 --- a/tools/qfbsp/source/options.c +++ b/tools/qfbsp/source/options.c @@ -139,7 +139,7 @@ DecodeArgs (int argc, char **argv) usage (0); break; case 'V': // version - printf ("%s version %s\n", PACKAGE, VERSION); + printf ("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit (0); break; case 'd': // draw diff --git a/tools/qfcc/qfcc.lsm.in b/tools/qfcc/qfcc.lsm.in deleted file mode 100644 index 63724bba1..000000000 --- a/tools/qfcc/qfcc.lsm.in +++ /dev/null @@ -1,19 +0,0 @@ -Begin3 -Title: qfcc -Version: @VERSION@ -Entered-date: @ISODATE@ -Description: The QuakeForge Code Compiler - @configure_input@ - qfcc is a compiler for the GameC (formerly QuakeC) language. - It is intended to replace the original QuakeC compiler. -Keywords: Quake, QuakeC, QuakeForge, GameC, compiler -Author: quakeforge-devel@lists.quakeforge.net (The QuakeForge Project) -Maintained-by: quakeforge-devel@lists.quakeforge.net (The QuakeForge Project) -Primary-site: http://www.quakeforge.net/ - 31k qfcc-@VERSION@.tar.gz - 500 qfcc.lsm -Alternate-site: -Original-site: -Platforms: -Copying-policy: GNU copyleft -End diff --git a/tools/qfcc/source/options.c b/tools/qfcc/source/options.c index 890ce5f2b..96ca08a67 100644 --- a/tools/qfcc/source/options.c +++ b/tools/qfcc/source/options.c @@ -312,7 +312,7 @@ DecodeArgs (int argc, char **argv) usage (0); break; case 'V': // version - printf ("%s version %s\n", PACKAGE, VERSION); + printf ("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit (0); break; case 's': // src dir diff --git a/tools/qflight/source/options.c b/tools/qflight/source/options.c index 4612f58e8..916845aa1 100644 --- a/tools/qflight/source/options.c +++ b/tools/qflight/source/options.c @@ -143,7 +143,7 @@ DecodeArgs (int argc, char **argv) options.novis = 1; break; case 'V': // version - printf ("%s version %s\n", PACKAGE, VERSION); + printf ("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit (0); break; case 't': // threads diff --git a/tools/qfvis/source/options.c b/tools/qfvis/source/options.c index ebb93ee79..d0f6c8a4a 100644 --- a/tools/qfvis/source/options.c +++ b/tools/qfvis/source/options.c @@ -109,7 +109,7 @@ DecodeArgs (int argc, char **argv) usage (0); break; case 'V': // version - printf ("%s version %s\n", PACKAGE, VERSION); + printf ("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit (0); break; case 't': // threads diff --git a/tools/texpaint/texturepaint.c b/tools/texpaint/texturepaint.c index a9b97b6e1..90c5b4497 100644 --- a/tools/texpaint/texturepaint.c +++ b/tools/texpaint/texturepaint.c @@ -1056,7 +1056,7 @@ void init_dialog(void) add_anim_button(w,3,begin_xpm); add_anim_button(w,4,end_xpm); - sprintf(version,"Texture Paint %s",VERSION); + sprintf(version,"Texture Paint %s",PACKAGE_VERSION); gtk_label_set(GTK_LABEL(get_widget(dialog->widget,"version")),version); dialog->paint_image=-1; dialog->texture_drawable=-1; diff --git a/tools/wad/wad.c b/tools/wad/wad.c index 40193ca38..578d56ddf 100644 --- a/tools/wad/wad.c +++ b/tools/wad/wad.c @@ -124,7 +124,7 @@ decode_args (int argc, char **argv) usage (0); break; case 'V': // version - printf ("wad version %s\n", VERSION); + printf ("wad version %s\n", PACKAGE_VERSION); exit (0); break; case 'c': // create