From 458d1d1d5a2db4c18c51f438eefd482d9993c74d Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Tue, 23 Oct 2001 21:51:50 +0000 Subject: [PATCH] Build fixes. Now works with automake 1.5 and autoconf 2.52. --enable-editor option added. SDL_VIDEO and SDL_INPUT defined for mingw (-grabmouse now works on win32). --- Makefile.am | 18 +++++++++- acconfig.h | 8 +++++ arch/dos/Makefile.am | 2 +- configure.in | 83 ++++++++++++++------------------------------ main/Makefile.am | 14 +++++--- maths/Makefile.am | 2 +- texmap/Makefile.am | 2 +- 7 files changed, 64 insertions(+), 65 deletions(-) diff --git a/Makefile.am b/Makefile.am index c84723a6..908631f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,23 @@ SUBDIRS = 2d 3d maths mem cfile iff texmap misc input video sound arch main EXTRA_SUBDIRS = includes tools unused -bin_PROGRAMS = @TARGETS@ +if ENV_DJGPP +bin_PROGRAMS = d2x +else +if USE_GGI +bin_PROGRAMS = d2x-ggi +else +if USE_SVGALIB +bin_PROGRAMS = d2x-svga +else +if USE_OPENGL +bin_PROGRAMS = d2x-ogl +else +bin_PROGRAMS = d2x-sdl +endif +endif +endif +endif EXTRA_PROGRAMS = d2x d2x-sdl d2x-ogl d2x-svga d2x-ggi diff --git a/acconfig.h b/acconfig.h index 07b9a8fc..ec26e9fd 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,6 +4,9 @@ /* Define if you want a network build */ #undef NETWORK +/* Define if you want to build the editor */ +#undef EDITOR + /* Define if you want an OpenGL build */ #undef OGL @@ -48,3 +51,8 @@ # endif # endif #endif + +#ifdef __MINGW32__ +#define SDL_VIDEO 1 +#define SDL_INPUT 1 +#endif diff --git a/arch/dos/Makefile.am b/arch/dos/Makefile.am index 8f68a073..2584e5b1 100644 --- a/arch/dos/Makefile.am +++ b/arch/dos/Makefile.am @@ -11,7 +11,7 @@ SUFFIXES = .asm $(NASM) $(NASMFLAGS) $< -o $@ if ENV_DJGPP -libarch_dos_a_LIBADD += timer.o modex.o +libarch_dos_a_LIBADD = timer.o modex.o endif EXTRA_DIST = ${EXTRA_SUBDIRS} \ diff --git a/configure.in b/configure.in index 80fa8798..9af2b32d 100644 --- a/configure.in +++ b/configure.in @@ -20,12 +20,13 @@ AC_CHECK_TOOL(AR, ar, :) AC_STDC_HEADERS AC_CYGWIN +AC_MINGW32 if test x$CYGWIN = xyes; then AC_MSG_WARN([Cygwin found, setting -mno-cygwin]) CFLAGS="$CFLAGS -mno-cygwin" + MINGW32=yes fi -AC_MINGW32 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes) if test x$MINGW32 = xyes; then GL_LIBS="opengl32 glu32" @@ -37,6 +38,14 @@ fi CFLAGS="$CFLAGS -O2 -Wall" +dnl Enable editor build? +AC_ARG_ENABLE(editor, + [ --enable-editor Build editor? ],,) +if test x$enable_editor = xyes; then + AC_DEFINE(EDITOR) +fi +AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes) + dnl Enable cross-platform bitmap/palette loader? AC_ARG_ENABLE(xploader, [ --enable-xploader Enable xp bitmap/palette loader ],,) @@ -66,10 +75,9 @@ if test "$host_os" = "msdosdjgpp"; then CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS" AC_PATH_PROG(NASM, nasm, no) - TARGETS=d2x D2X_ARCH_SUBDIRS=dos - else + CFLAGS="-pipe $CFLAGS" D2X_ARCH_SUBDIRS=sdl @@ -86,18 +94,14 @@ else ) AC_SUBST(SDL_LIBS) + CFLAGS="$SDL_CFLAGS $CFLAGS" + AC_CHECK_HEADERS(netipx/ipx.h) # Check for OpenGL AC_ARG_WITH(opengl, - [ --with-opengl Build OpenGL support ], - [case "${withval}" in - yes) opengl=true ;; - no) opengl=false ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;; - esac],[opengl=false]) - - if test x$opengl = xtrue; then + [ --with-opengl Build OpenGL support ],,) + if test x$with_opengl = xyes; then for lib in $GL_LIBS; do AC_CHECK_LIB($lib, main, OGL_LIBS="${OGL_LIBS} -l$lib", @@ -106,43 +110,31 @@ else ${OGL_LIBS} ) done + AC_DEFINE(OGL) fi AC_SUBST(OGL_LIBS) - AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue) - - CFLAGS="$SDL_CFLAGS $CFLAGS" + AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes) # Check for GGI AC_ARG_WITH(ggi, - [ --with-ggi Build GGI support ], - [case "${withval}" in - yes) ggi=true ;; - no) ggi=false ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;; - esac],[ggi=false]) - - if test x$ggi = xtrue; then + [ --with-ggi Build GGI support ],,) + if test x$with_ggi = xyes; then AC_CHECK_LIB(ggi, ggiInit, GGI_LIBS="-lggi", [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false]) AC_CHECK_LIB(gii, giiInit, GGI_LIBS="${GGI_LIBS} -lgii", [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false]) + AC_DEFINE(GGI) fi AC_SUBST(GGI_LIBS) - AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue) + AM_CONDITIONAL(USE_GGI, test x$with_ggi = xtrue) # Check for SVGALib AC_ARG_WITH(svga, - [ --with-svga Build SVGALib support ], - [case "${withval}" in - yes) svga=true ;; - no) svga=false ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;; - esac],[svga=false]) - - if test x$svga = xtrue; then - AC_CHECK_LIB(vga, vga_getmousetype, + [ --with-svga Build SVGALib support ],,) + if test x$with_svga = xyes; then + AC_CHECK_LIB(vga,vga_getmousetype, SVGA_LIBS="-lvga", [AC_MSG_ERROR([vga not found, SVGALib cannot be built]) svga=false], @@ -152,30 +144,12 @@ else [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built]) svga=false], -lvga) + AC_DEFINE(SVGA) fi AC_SUBST(SVGA_LIBS) - AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue) - - if test x$opengl = xtrue; then - AC_DEFINE(OGL) - TARGETS=d2x-ogl - else - if test x$svga = xtrue; then - AC_DEFINE(SVGA) - TARGETS=d2x-svga - else - if test x$ggi = xtrue; then - AC_DEFINE(GGI) - TARGETS=d2x-ggi - else - TARGETS=d2x-sdl - fi - fi - fi + AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = yes) AC_PATH_PROG(NASM, $NASM_PROG, no) - CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS" - fi dnl Check for network @@ -219,11 +193,6 @@ AC_SUBST(NASMFLAGS) AC_SUBST(CFLAGS) -AC_SUBST(TARGETS) - -AC_ARG_PROGRAM - -#libdir='$(shell pwd)/${top_srcdir}/main' AC_OUTPUT( Makefile 2d/Makefile diff --git a/main/Makefile.am b/main/Makefile.am index f78604e1..dc20f9df 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -7,23 +7,29 @@ CFLAGS += -fwritable-strings INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/arch/include if USE_NETWORK -NETWORK_SRCS = ipx_drv.c +NETWORK_SRCS = ipx_drv.c multi.c multibot.c kmatrix.c else NETWORK_SRCS = endif +if EDITOR +EDITOR_SRCS = bmread.c +else +EDITOR_SRCS = +endif + libmain_a_SOURCES = ${NETWORK_SRCS} \ ai.c gamerend.c lighting.c paging.c switch.c \ ai2.c effects.c gamesave.c menu.c physics.c texmerge.c \ aipath.c endlevel.c gameseg.c mglobal.c piggy.c text.c \ automap.c escort.c gameseq.c mission.c playsave.c titles.c \ bm.c fireball.c gauges.c morph.c polyobj.c vclip.c \ -bmread.c fuelcen.c hostage.c multi.c powerup.c wall.c \ -cntrlcen.c fvi.c hud.c multibot.c render.c weapon.c \ +fuelcen.c hostage.c powerup.c wall.c \ +cntrlcen.c fvi.c hud.c render.c weapon.c \ collide.c game.c inferno.c netmisc.c robot.c \ config.c gamecntl.c kconfig.c network.c scores.c \ controls.c gamefont.c kludge.c newdemo.c slew.c \ -credits.c gamemine.c kmatrix.c newmenu.c songs.c \ +credits.c gamemine.c newmenu.c songs.c \ crypt.c gamepal.c laser.c object.c state.c \ console.c cmd.c diff --git a/maths/Makefile.am b/maths/Makefile.am index 983e2f0b..d2530d25 100644 --- a/maths/Makefile.am +++ b/maths/Makefile.am @@ -12,7 +12,7 @@ SUFFIXES = .asm $(NASM) $(NASMFLAGS) $< -o $@ if USE_ASM -libmaths_a_LIBADD += vecmata.o fix.o +libmaths_a_LIBADD = vecmata.o fix.o endif EXTRA_DIST = \ diff --git a/texmap/Makefile.am b/texmap/Makefile.am index 5333b766..7897e2b3 100644 --- a/texmap/Makefile.am +++ b/texmap/Makefile.am @@ -12,7 +12,7 @@ SUFFIXES = .asm $(NASM) $(NASMFLAGS) $< -o $@ if USE_ASM -libtexmap_a_LIBADD += tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o +libtexmap_a_LIBADD = tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o endif EXTRA_DIST = \ -- 2.39.2