From 9743e9dcce5a282d3e7450f4cb9d344b9506d501 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Mon, 1 Jul 2002 04:53:50 +0000 Subject: [PATCH] - Added library detection to configure.in, to detect SVGAlib, X, GL, SDL, and GLIDE. Modified the Makefile.am's to match the new configure variables. Now people don't have to manually hack src/Makefile.am to build their targets. - Fixed a typo in src/qgl.h with the #define - Added new automake generated files to bootstrap's clean command. - Added build requirements to HACKING, as we now need automake 1.6. - Removed note in README about the asm FPE bug, as I seem to have inadvertently fixed this without meaning to. --- HACKING | 5 + README | 3 - acinclude.m4 | 170 ++++++++++++++++++++++++++++++ bootstrap | 3 +- configure.in | 233 ++++++++++++++++++++++++++++++++++++++--- src/Makefile.am | 183 +++++++++++++++----------------- src/qgl.h | 2 +- src/rogue/Makefile.am | 86 ++++----------- src/xatrix/Makefile.am | 73 +++---------- 9 files changed, 513 insertions(+), 245 deletions(-) diff --git a/HACKING b/HACKING index b1a7c9b..d347dae 100644 --- a/HACKING +++ b/HACKING @@ -1,6 +1,11 @@ HACKING on quake2 ================= +To build quake2 from CVS, you will need the following software: + - automake, 1.6 + - autoconf, 2.50 or higher + - GNU make + Note to developers: bsd/, irix/ and solaris/ are NO LONGER PERTINENT! linux/ was renamed src/, so hack in there. As we port to more arch/os's, diff --git a/README b/README index 931f64b..f8b5f40 100644 --- a/README +++ b/README @@ -7,9 +7,6 @@ Compiling If you are checking this out from CVS, run the bootstrap command first to set up configure. Then follow the instructions in INSTALL. -Use --disable-asm on the configure line if you want to use the software -refreshers on i386, or better yet, fix the bug in the asm! - Save Games ---------- diff --git a/acinclude.m4 b/acinclude.m4 index 360d58d..caf64d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -58,3 +58,173 @@ AC_DEFUN(AC_TYPE_VA_LIST, if test $ac_cv_type_va_list_array = yes; then AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if va_list is an array]) fi]) + +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor +# Jaq borrowed this from Quakeforge + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN(AM_PATH_SDL, +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) diff --git a/bootstrap b/bootstrap index 0df28ad..22bc498 100755 --- a/bootstrap +++ b/bootstrap @@ -17,7 +17,8 @@ if [ "$1" = "clean" ]; then fi find . -name Makefile.in -print | xargs rm -f rm -f aclocal.m4 install-sh missing mkinstalldirs \ - stamp-h.in tags configure config.* + stamp-h.in tags configure config.* \ + compile depcomp stamp-h rm -rf autom4te.cache else diff --git a/configure.in b/configure.in index 03a1a09..ffd7e53 100644 --- a/configure.in +++ b/configure.in @@ -42,6 +42,159 @@ dnl -------------------- dnl Checks for libraries dnl -------------------- +dnl Check for SVGAlib +AC_ARG_WITH(svgalib, + [ --with-svgalib=DIR use SVGAlib found in DIR], + HAVE_SVGALIB=$withval, HAVE_SVGALIB=auto) +if test "x$HAVE_SVGALIB" != xno; then + if test "x$HAVE_SVGALIB" != xauto; then + SVGALIB_CFLAGS="$SVGALIB_CFLAGS -I$withval/include" + SVGALIB_LIBS="$SVGALIB_LIBS -L$withval/lib" + dnl The default system location is /usr/include or + dnl /usr/local/include and we don't need to set CFLAGS + dnl for that + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVGALIB_CFLAGS" + AC_CHECK_HEADER(vga.h, HAVE_SVGALIB=yes, HAVE_SVGALIB=no) + CPPFLAGS="$save_CPPFLAGS" + dnl make sure -lvga works + if test "x$HAVE_SVGALIB" = xyes; then + AC_CHECK_LIB(vga, vga_getmousetype, + SVGALIB_LIBS="$SVGALIB_LIBS -lvga" + HAVE_SVGALIB=yes, + HAVE_SVGALIB=no, + [$SVGALIB_LIBS] + ) + fi + if test "x$HAVE_SVGALIB" != xyes; then + SVGALIB_CFLAGS="" SVGALIB_LIBS="" + fi +fi +AC_SUBST(HAVE_SVGALIB) +AC_SUBST(SVGALIB_CFLAGS) +AC_SUBST(SVGALIB_LIBS) + +dnl Check for GLIDE +AC_ARG_WITH(glide, + [ --with-glide=DIR use GLIDE 2.x found in DIR], + HAVE_GLIDE=$withval, + HAVE_GLIDE=auto) +if test "x$HAVE_GLIDE" != xno; then + AC_CHECK_LIB(glide, grGammaCorrectionValue, + GLIDE_LIBS="-lglide", + AC_CHECK_LIB(glide2x, grGammaCorrectionValue, + GLIDE_LIBS="-lglide2x", + GLIDE_LIBS="" + ) + ) + if test "x$HAVE_GLIDE" != xauto; then + GLIDE_CFLAGS="$GLIDE_CFLAGS -I$withval/include" + GLIDE_LIBS="$GLIDE_LIBS -L$withval/lib" + else + GLIDE_CFLAGS="$GLIDE_CFLAGS -I/usr/include/glide -I/usr/local/include/glide" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLIDE_CFLAGS" + AC_CHECK_HEADER(glide.h, HAVE_GLIDE=yes, HAVE_GLIDE=no) + if test "x$HAVE_GLIDE" != xyes; then + HAVE_GLIDE=no + else + AC_DEFINE(HAVE_GLIDE, 1, [Define this if you have Glide]) + fi + CPPFLAGS="$save_CPPFLAGS" +fi +AC_SUBST(GLIDE_CFLAGS) +AC_SUBST(GLIDE_LIBS) + +dnl Check for X11 +AC_PATH_XTRA +if test "x$no_x" = x; then + HAVE_X=yes + XTRA_LIBS="-lX11" + AC_CHECK_LIB(Xext, XShmQueryExtension, + XTRA_LIBS="$XTRA_LIBS -lXext", + HAVE_X=no, + [ $X_LIBS $XTRA_LIBS $X_EXTRA_LIBS ] + ) + if test "x$HAVE_X" = xyes; then + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADER(X11/extensions/xf86vmode.h, + dnl Make sure the library works + AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode, + XTRA_LIBS="$XTRA_LIBS -lXxf86vm", + HAVE_X=no, + [$X_LIBS $XTRA_LIBS $X_EXTRA_LIBS] + ), + HAVE_X=no, + [#include ] + ) + CPPFLAGS="$save_CPPFLAGS" + fi + if test "x$HAVE_X" = xyes; then + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADER(X11/extensions/xf86dga.h, + AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, + XTRA_LIBS="$XTRA_LIBS -lXxf86dga", + HAVE_X=no, + [$X_LIBS $XTRA_LIBS $X_EXTRA_LIBS] + ), + HAVE_X=no, + [#include ] + ) + CPPFLAGS="$save_CPPFLAGS" + fi + if test "x$HAVE_X" != xyes; then + XTRA_LIBS="" + fi +fi +AC_SUBST(HAVE_X) +AC_SUBST(XTRA_LIBS) + +dnl Check for OpenGL +AC_ARG_WITH(gl, + [ --with-opengl=DIR use OpenGL in DIR ], + HAVE_OPENGL=$withval, + HAVE_OPENGL=auto) +if test "x$HAVE_OPENGL" != xno; then + if test "x$HAVE_OPENGL" != xauto; then + OPENGL_CFLAGS="$OPENGL_CFLAGS -I$withval/include" + OPENGL_LIBS="$OPENGL_LIBS -L$withval/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $OPENGL_CFLAGS" + AC_CHECK_HEADER(GL/gl.h, HAVE_OPENGL=yes, HAVE_OPENGL=no) + CPPFLAGS="$save_CPPFLAGS" + if test "x$HAVE_OPENGL" = xyes; then + AC_CHECK_LIB(GL, glBegin, + OPENGL_LIBS="$OPENGL_LIBS -lGL" + HAVE_OPENGL=yes, + HAVE_OPENGL=no, + [$OPENGL_LIBS] + ) + fi + if test "x$HAVE_OPENGL" != xyes; then + OPENGL_CFLAGS="" + OPENGL_LIBS="" + fi +fi +AC_SUBST(HAVE_OPENGL) +AC_SUBST(OPENGL_LIBS) +AC_SUBST(OPENGL_CFLAGS) + +dnl Check for SDL +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) +fi + #AC_CHECK_LIB(GL, glBegin) # FIXME: Replace `main' with a function in `-lX11': #AC_CHECK_LIB(X11, [main]) @@ -51,14 +204,9 @@ dnl -------------------- #AC_CHECK_LIB([Xxf86dga], [main]) # FIXME: Replace `main' with a function in `-lXxf86vm': #AC_CHECK_LIB([Xxf86vm], [main]) -#AC_CHECK_LIB(dl, dlopen) -#AC_CHECK_LIB(m, sin) -# FIXME: Replace `main' with a function in `-lossaudio': #AC_CHECK_LIB([ossaudio], [main]) # FIXME: Replace `main' with a function in `-lpthread': #AC_CHECK_LIB([pthread], [main]) -# FIXME: Replace `main' with a function in `-lvga': -#AC_CHECK_LIB([vga], [main]) dnl ----------------------- dnl Checks for header files @@ -134,18 +282,18 @@ if test "x$ac_cv_func_dlopen" != "xyes"; then fi AC_SUBST(DL_LIBS) -SDL_FLAGS=`sdl-config --libs` -AC_SUBST(SDL_FLAGS) +#SDL_FLAGS=`sdl-config --libs` +#AC_SUBST(SDL_FLAGS) dnl ------------------- dnl Checks for asm junk dnl ------------------- -AC_MSG_CHECKING(to see if assembler can be used) +AC_MSG_CHECKING(if assembler can be used) case "${host}" in i?86-*-*) AC_MSG_RESULT(yes) - AC_MSG_CHECKING(to see if asm is disabled) + AC_MSG_CHECKING(if asm is disabled) AC_ARG_ENABLE(asm, [ --disable-asm disable assembler optimisation ], AC_MSG_RESULT(yes), @@ -164,7 +312,7 @@ dnl --------------------------------------------------- dnl Check if the xatrix and rogue sources are available dnl --------------------------------------------------- -AC_MSG_CHECKING(to see if xatrix source is available) +AC_MSG_CHECKING(if Xatrix missionpack source is available) if test -f src/xatrix/g_main.c; then AC_MSG_RESULT(yes) DO_XATRIX=yes @@ -172,7 +320,7 @@ else AC_MSG_RESULT(no) fi -AC_MSG_CHECKING(to see if rogue source is available) +AC_MSG_CHECKING(if Rogue missionpack source is available) if test -f src/rogue/g_main.c; then AC_MSG_RESULT(yes) DO_ROGUE=yes @@ -183,14 +331,65 @@ fi AM_CONDITIONAL(DO_XATRIX, test "$DO_XATRIX" = "yes") AM_CONDITIONAL(DO_ROGUE, test "$DO_ROGUE" = "yes") +dnl --------------------------------- +dnl Work out what refreshers to build +dnl --------------------------------- + +VID_REFS="" + +if test "x$HAVE_SVGALIB" = xyes; then + VID_REFS="$VID_REFS ref_soft.so" + BUILD_SOFT="yes" +fi + +if test "x$HAVE_X" = xyes; then + VID_REFS="$VID_REFS ref_softx.so" + BUILD_SOFTX="yes" +fi + +if test "x$HAVE_SDL" = xyes; then + VID_REFS="$VID_REFS ref_softsdl.so" + BUILD_SOFTSDL="yes" +fi + +if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes; then + VID_REFS="$VID_REFS ref_glx.so" + BUILD_GLX="yes" +fi + +if test "x$HAVE_X" = xyes -a "x$HAVE_GLIDE" = xyes -a "x$HAVE_SVGALIB" = xyes; then + VIDREFS="$VID_REFS ref_fxgl.so" + BUILD_FXGL="yes" +fi + +if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes -a "x$HAVE_SDL" = xyes; then + VID_REFS="$VID_REFS ref_sdlgl.so" + BUILD_SDLGL="yes" +fi + +AM_CONDITIONAL(BUILD_SOFT, test "x$BUILD_SOFT" = xyes) +AM_CONDITIONAL(BUILD_SOFTX, test "x$BUILD_SOFTX" = xyes) +AM_CONDITIONAL(BUILD_SOFTSDL, test "x$BUILD_SOFTSDL" = xyes) +AM_CONDITIONAL(BUILD_GLX, test "x$BUILD_GLX" = xyes) +AM_CONDITIONAL(BUILD_FXGL, test "x$BUILD_FXGL" = xyes) +AM_CONDITIONAL(BUILD_SDLGL, test "x$BUILD_SDLGL" = xyes) + +AC_SUBST(VID_REFS) + dnl ----------- dnl Dump it out dnl ----------- -AC_CONFIG_FILES([Makefile - src/Makefile - src/baseq2/Makefile - src/ctf/Makefile - src/xatrix/Makefile - src/rogue/Makefile]) +AC_CONFIG_FILES([ + Makefile + src/Makefile + src/baseq2/Makefile + src/ctf/Makefile + src/xatrix/Makefile + src/rogue/Makefile +]) AC_OUTPUT + +AC_MSG_RESULT([ + Video refreshers: ${VID_REFS- no} +]) diff --git a/src/Makefile.am b/src/Makefile.am index 913e433..567ace1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,127 +2,112 @@ SUBDIRS = . baseq2 ctf xatrix rogue -bin_PROGRAMS = quake2 \ - ref_soft.so ref_softx.so ref_softsdl.so \ - ref_glx.so ref_sdlgl.so -# ref_fxgl.so +bin_PROGRAMS = quake2 @VID_REFS@ -quake2_SOURCES = main.c q_sh.c vid_menu.c vid_so.c glob.c net_udp.c \ - \ - cl_cin.c cl_ents.c cl_fx.c cl_input.c cl_inv.c \ - cl_main.c cl_parse.c cl_pred.c cl_tent.c cl_scrn.c cl_view.c \ - cl_newfx.c console.c keys.c menu.c qmenu.c \ - \ - snd_dma.c snd_mix.c snd_mem.c \ - \ - checksum.c cmd.c cmodel.c common.c crc.c cvar.c files.c \ - mdfour.c net_chan.c \ - \ - sv_ccmds.c sv_ents.c sv_game.c sv_init.c sv_main.c \ - sv_send.c sv_user.c sv_world.c \ - \ - cd.c snd.c \ - \ - q_shared.c pmove.c \ - \ - m_flash.c \ - \ - #snd_mixa.S +EXTRA_PROGRAMS = ref_soft.so ref_softx.so ref_softsdl.so \ + ref_glx.so ref_sdlgl.so ref_fxgl.so -REF_GL_COMMON = q_sh.c q_shared.c glob.c \ - qgl.c \ - \ - gl_draw.c \ - gl_image.c \ - gl_light.c \ - gl_mesh.c \ - gl_model.c \ - gl_rmain.c \ - gl_rmisc.c \ - gl_rsurf.c \ +# Common source files +REF_GL_COMMON = q_sh.c q_shared.c glob.c qgl.c \ + gl_draw.c gl_image.c gl_light.c gl_mesh.c \ + gl_model.c gl_rmain.c gl_rmisc.c gl_rsurf.c \ gl_warp.c -# GLX -ref_glx_so_SOURCES = $(REF_GL_COMMON) gl_glx.c - -# 3dFX -#ref_fxgl_so_SOURCES = $(REF_GL_COMMON) rw_in_svgalib.c gl_fxmesa.c - -# SDL -ref_sdlgl_so_SOURCES = $(REF_GL_COMMON) rw_sdl.c - -REF_SOFT_COMMON = \ - r_aclip.c \ - r_alias.c \ - r_bsp.c \ - r_draw.c \ - r_edge.c \ - r_image.c \ - r_light.c \ - r_main.c \ - r_misc.c \ - r_model.c \ - r_part.c \ - r_poly.c \ - r_polyse.c \ - r_rast.c \ - r_scan.c \ - r_sprite.c \ - r_surf.c \ - q_shared.c \ - q_sh.c \ - glob.c +REF_SOFT_COMMON = r_aclip.c r_alias.c r_bsp.c r_draw.c r_edge.c \ + r_image.c r_light.c r_main.c r_misc.c r_model.c \ + r_part.c r_poly.c r_polyse.c r_rast.c r_scan.c \ + r_sprite.c r_surf.c \ + q_shared.c q_sh.c glob.c if ASM_ARCH -REF_SOFT_ASM = \ - r_aclipa.S \ - r_draw16.S \ - r_drawa.S \ - r_edgea.S \ - r_scana.S \ - r_spr8.S\ - r_surf8.S \ - math.S \ - d_polysa.S \ - r_varsa.S \ +REF_SOFT_ASM = r_aclipa.S r_draw16.S r_drawa.S r_edgea.S r_scana.S \ + r_spr8.S r_surf8.S math.S d_polysa.S r_varsa.S \ sys_dosa.S else REF_SOFT_ASM = endif -# SVGAlib -if ASM_ARCH -ref_soft_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_svgalib.c rw_in_svgalib.c d_copy.S -else -ref_soft_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_svgalib.c rw_in_svgalib.c -endif - -# X11 -ref_softx_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_x11.c - -# SDL -ref_softsdl_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_sdl.c - -AM_CFLAGS = -Wall -Werror -pipe -I/usr/X11R6/include $(shell sdl-config --cflags) -DOPENGL -fPIC +quake2_SOURCES = main.c q_sh.c vid_menu.c vid_so.c glob.c net_udp.c \ + \ + cl_cin.c cl_ents.c cl_fx.c cl_input.c cl_inv.c \ + cl_main.c cl_parse.c cl_pred.c cl_tent.c cl_scrn.c \ + cl_view.c cl_newfx.c console.c keys.c menu.c qmenu.c \ + \ + snd_dma.c snd_mix.c snd_mem.c \ + \ + checksum.c cmd.c cmodel.c common.c crc.c cvar.c \ + files.c mdfour.c net_chan.c \ + \ + sv_ccmds.c sv_ents.c sv_game.c sv_init.c sv_main.c \ + sv_send.c sv_user.c sv_world.c \ + \ + cd.c snd.c \ + \ + q_shared.c pmove.c \ + \ + m_flash.c +# \ +# #snd_mixa.S quake2_LDFLAGS = -lm -pthread @DL_LIBS@ -ref_glx_so_LDFLAGS = -shared -ref_glx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lGL +#AM_CFLAGS = -Wall -Werror -pipe -I/usr/X11R6/include $(shell sdl-config --cflags) -DOPENGL -fPIC +AM_CFLAGS = -Wall -Werror -pipe +# ref_glx +if BUILD_GLX +ref_glx_so_SOURCES = $(REF_GL_COMMON) gl_glx.c +ref_glx_so_CFLAGS = -fPIC @X_CFLAGS@ @OPENGL_CFLAGS@ +ref_glx_so_LDFLAGS = -shared +#ref_glx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lGL +ref_glx_so_LDADD = @X_PRE_LIBS@ @X_LIBS@ @XTRA_LIBS@ @X_EXTRA_LIBS@ @OPENGL_LIBS@ +endif + +# ref_fxgl +if BUILD_FXGL +ref_fxgl_so_SOURCES = $(REF_GL_COMMON) rw_in_svgalib.c gl_fxmesa.c +ref_fxgl_so_CFLAGS = -fPIC @GLIDE_CFLAGS@ @X_CFLAGS@ @SVGALIB_CFLAGS@ #ref_fxgl_so_LDFLAGS = -shared -L/usr/local/glide/lib -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lGL -lvga #ref_fxgl_so_LDFADD = -L/usr/local/glide/lib -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lGL -lvga +ref_fxgl_so_LDFLAGS = -shared +ref_fxgl_so_LDADD = @GLIDE_LIBS@ @X_LIBS@ @SVGALIB_LIBS@ +endif -sdl_flags = @SDL_FLAGS@ - +# ref_sdlgl +if BUILD_SDLGL +ref_sdlgl_so_SOURCES = $(REF_GL_COMMON) rw_sdl.c +ref_sdlgl_so_CFLAGS = -fPIC @SDL_CFLAGS@ -DOPENGL @OPENGL_CFLAGS@ ref_sdlgl_so_LDFLAGS = -shared -ref_sdlgl_so_LDADD = $(sdl_flags) +ref_sdlgl_so_LDADD = @SDL_LIBS@ @OPENGL_LIBS@ +endif +# ref_soft +if BUILD_SOFT +if ASM_ARCH +SOFT_ASM=$(REF_SOFT_ASM) d_copy.S +rgreelse +SOFT_ASM=$(REF_SOFT_ASM) +endif +ref_soft_so_SOURCES = $(REF_SOFT_COMMON) $(SOFT_ASM) \ + rw_svgalib.c rw_in_svgalib.c +ref_soft_so_CFLAGS = -fPIC @SVGALIB_CFLAGS@ ref_soft_so_LDFLAGS = -shared -ref_soft_so_LDADD = -lvga +ref_soft_so_LDADD = @SVGALIB_LIBS@ +endif +# ref_softx +if BUILD_SOFTX +ref_softx_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_x11.c +ref_softx_so_CFLAGS = -fPIC @X_CFLAGS@ ref_softx_so_LDFLAGS = -shared -ref_softx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm +#ref_softx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm +ref_softx_so_LDADD = @X_PRE_LIBS@ @X_LIBS@ @XTRA_LIBS@ @X_EXTRA_LIBS@ +endif +# ref_softsdl +if BUILD_SOFTSDL +ref_softsdl_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_sdl.c +ref_softsdl_so_CFLAGS = -fPIC @SDL_CFLAGS@ ref_softsdl_so_LDFLAGS = -shared -ref_softsdl_so_LDADD = $(sdl_flags) +ref_softsdl_so_LDADD = @SDL_LIBS@ +endif diff --git a/src/qgl.h b/src/qgl.h index 23f25eb..c8a1f9a 100644 --- a/src/qgl.h +++ b/src/qgl.h @@ -440,7 +440,7 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, #endif /* FIXME: this ifdef sucks */ -#ifdef __linux__ || __FreeBSD__ +#if defined __linux__ || defined __FreeBSD__ // local function in dll //#ifndef qwglGetProcAddress // FIXME diff --git a/src/rogue/Makefile.am b/src/rogue/Makefile.am index 61b9645..4be5a96 100644 --- a/src/rogue/Makefile.am +++ b/src/rogue/Makefile.am @@ -2,72 +2,24 @@ if DO_ROGUE bin_PROGRAMS = game.so -game_so_SOURCES = \ - dm_ball.c \ - dm_tag.c \ - g_ai.c \ - g_chase.c \ - g_cmds.c \ - g_combat.c \ - g_func.c \ - g_items.c \ - g_main.c \ - g_misc.c \ - g_monster.c \ - g_newai.c \ - g_newdm.c \ - g_newfnc.c \ - g_newtarg.c \ - g_newtrig.c \ - g_newweap.c \ - g_phys.c \ - g_save.c \ - g_spawn.c \ - g_sphere.c \ - g_svcmds.c \ - g_target.c \ - g_trigger.c \ - g_turret.c \ - g_utils.c \ - g_weapon.c \ - m_actor.c \ - m_berserk.c \ - m_boss2.c \ - m_boss3.c \ - m_boss31.c \ - m_boss32.c \ - m_brain.c \ - m_carrier.c \ - m_chick.c \ - m_flash.c \ - m_flipper.c \ - m_float.c \ - m_flyer.c \ - m_gladiator.c \ - m_gunner.c \ - m_hover.c \ - m_infantry.c \ - m_insane.c \ - m_medic.c \ - m_move.c \ - m_mutant.c \ - m_parasite.c \ - m_soldier.c \ - m_stalker.c \ - m_supertank.c \ - m_tank.c \ - m_turret.c \ - m_widow.c \ - m_widow2.c \ - p_client.c \ - p_hud.c \ - p_trail.c \ - p_view.c \ - p_weapon.c \ - q_shared.c -#AM_CFLAGS = -fPIC -Wall -Werror -pipe -AM_CFLAGS = -fPIC -pipe -AM_CPPFLAGS = -I.. -LDFLAGS = -shared +game_so_SOURCES = dm_ball.c dm_tag.c \ + g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \ + g_items.c g_main.c g_misc.c g_monster.c g_newai.c \ + g_newdm.c g_newfnc.c g_newtarg.c g_newtrig.c \ + g_newweap.c g_phys.c g_save.c g_spawn.c g_sphere.c \ + g_svcmds.c g_target.c g_trigger.c g_turret.c \ + g_utils.c g_weapon.c \ + m_actor.c m_berserk.c m_boss2.c m_boss3.c \ + m_boss31.c m_boss32.c m_brain.c m_carrier.c \ + m_chick.c m_flash.c m_flipper.c m_float.c m_flyer.c \ + m_gladiator.c m_gunner.c m_hover.c m_infantry.c \ + m_insane.c m_medic.c m_move.c m_mutant.c \ + m_parasite.c m_soldier.c m_stalker.c m_supertank.c \ + m_tank.c m_turret.c m_widow.c m_widow2.c \ + p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \ + q_shared.c +#game_so_CFLAGS = -fPIC -Wall -Werror -pipe +game_so_CFLAGS = -I.. -fPIC -pipe +game_so_LDFLAGS = -shared endif # DO_ROGUE diff --git a/src/xatrix/Makefile.am b/src/xatrix/Makefile.am index 5410891..dd78d16 100644 --- a/src/xatrix/Makefile.am +++ b/src/xatrix/Makefile.am @@ -2,62 +2,21 @@ if DO_XATRIX bin_PROGRAMS = game.so -game_so_SOURCES = \ - g_ai.c \ - g_chase.c \ - g_cmds.c \ - g_combat.c \ - g_func.c \ - g_items.c \ - g_main.c \ - g_misc.c \ - g_monster.c \ - g_phys.c \ - g_save.c \ - g_spawn.c \ - g_svcmds.c \ - g_target.c \ - g_trigger.c \ - g_turret.c \ - g_utils.c \ - g_weapon.c \ - m_actor.c \ - m_berserk.c \ - m_boss2.c \ - m_boss3.c \ - m_boss31.c \ - m_boss32.c \ - m_boss5.c \ - m_brain.c \ - m_chick.c \ - m_fixbot.c \ - m_flash.c \ - m_flipper.c \ - m_float.c \ - m_flyer.c \ - m_gekk.c \ - m_gladb.c \ - m_gladiator.c \ - m_gunner.c \ - m_hover.c \ - m_infantry.c \ - m_insane.c \ - m_medic.c \ - m_move.c \ - m_mutant.c \ - m_parasite.c \ - m_soldier.c \ - m_supertank.c \ - m_tank.c \ - p_client.c \ - p_hud.c \ - p_trail.c \ - p_view.c \ - p_weapon.c \ - q_shared.c -#AM_CFLAGS = -fPIC -Wall -Werror -pipe -AM_CFLAGS = -fPIC -pipe -AM_CPPFLAGS = -I.. -LDFLAGS = -shared +game_so_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \ + g_items.c g_main.c g_misc.c g_monster.c g_phys.c \ + g_save.c g_spawn.c g_svcmds.c g_target.c g_trigger.c \ + g_turret.c g_utils.c g_weapon.c \ + m_actor.c m_berserk.c m_boss2.c m_boss3.c \ + m_boss31.c m_boss32.c m_boss5.c m_brain.c \ + m_chick.c m_fixbot.c m_flash.c m_flipper.c \ + m_float.c m_flyer.c m_gekk.c m_gladb.c \ + m_gladiator.c m_gunner.c m_hover.c m_infantry.c \ + m_insane.c m_medic.c m_move.c m_mutant.c \ + m_parasite.c m_soldier.c m_supertank.c m_tank.c \ + p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \ + q_shared.c +#game_so_CFLAGS = -fPIC -Wall -Werror -pipe +game_so_CFLAGS = -I.. -fPIC -pipe +game_so_LDFLAGS = -shared endif # DO_XATRIX