From ee727895ec19966c2237f5e2536694eb4e3fe537 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 19 Oct 2001 00:30:31 +0000 Subject: [PATCH] build fixes --- 2d/Makefile.am | 15 ++++--- arch/win32/Makefile.am | 6 ++- configure.in | 93 +++++++++++++++++++----------------------- main/Makefile.am | 20 +++++++-- 4 files changed, 68 insertions(+), 66 deletions(-) diff --git a/2d/Makefile.am b/2d/Makefile.am index 7689639c..2ce85c7c 100644 --- a/2d/Makefile.am +++ b/2d/Makefile.am @@ -2,23 +2,22 @@ noinst_LIBRARIES = lib2d.a INCLUDES = -I $(top_srcdir)/includes if USE_ASM -lib2d_a_SOURCES = \ -2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c \ -bitblt.c canvas.c font.c line.c pixel.c rle.c \ -bitmap.c circle.c gpixel.c palette.c poly.c +ASM_SRCS = else -lib2d_a_SOURCES = \ +ASM_SRCS = tmerge.c +endif + +lib2d_a_SOURCES = ${ASM_SRCS} \ 2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c \ -bitblt.c canvas.c font.c line.c pixel.c rle.c tmerge.c \ +bitblt.c canvas.c font.c line.c pixel.c rle.c \ bitmap.c circle.c gpixel.c palette.c poly.c -endif SUFFIXES = .asm %.o: %.asm $(NASM) $(NASMFLAGS) $< -o $@ if USE_ASM -lib2d_a_LIBADD += linear.o tmerge_a.o +lib2d_a_LIBADD = linear.o tmerge_a.o endif EXTRA_DIST = \ diff --git a/arch/win32/Makefile.am b/arch/win32/Makefile.am index 902f8338..0579747a 100644 --- a/arch/win32/Makefile.am +++ b/arch/win32/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_SUBDIRS = include +EXTRA_SUBDIRS = include d3dframe noinst_LIBRARIES = libarch_win32.a @@ -11,10 +11,12 @@ libarch_win32_a_SOURCES = findfile.c endif EXTRA_DIST = \ +d1x.ico d1x.rc d3d.ico debug.cpp descent.ico digi.c findfile.c glinit.c gr.c \ +hmpfile.c init.c ipx_win.c joydefs.c joyhh.c key.c mono.c mouse.c palw32.c \ +pch.cpp scene.cpp serial.c texture.cpp timer.c win32.c winmain.cpp winnet.c dist-hook: list='$(EXTRA_SUBDIRS)'; for subdir in $$list; do \ ( cd $(srcdir) && tar --exclude=CVS -cf - $$subdir ) \ | ( cd $(distdir) && tar xf - ) \ done -CVS Makefile.am Makefile.am~ Makefile.in d1x.ico d1x.rc d3d.ico d3dframe debug.cpp descent.ico digi.c findfile.c glinit.c gr.c hmpfile.c include init.c ipx_win.c joydefs.c joyhh.c key.c mono.c mouse.c palw32.c pch.cpp scene.cpp serial.c texture.cpp timer.c win32.c winmain.cpp winnet.c diff --git a/configure.in b/configure.in index 82a9f2b1..2e13ef08 100644 --- a/configure.in +++ b/configure.in @@ -19,11 +19,6 @@ AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar, :) AC_STDC_HEADERS -NO_ASM=0 -NO_NETWORK=0 -GL_LIBS="GL GLU" -NASM_PROG=nasm - AC_CYGWIN if test x$CYGWIN = xyes; then AC_MSG_WARN([Cygwin found, setting -mno-cygwin]) @@ -33,31 +28,31 @@ fi AC_MINGW32 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes) if test x$MINGW32 = xyes; then - AC_MSG_WARN([mingw32 found, disabling network]) - NO_NETWORK=1 GL_LIBS="opengl32 glu32" NASM_PROG=nasmw + D2X_ARCH_SUBDIRS=win32 +else + GL_LIBS="GL GLU" + NASM_PROG=nasm fi -CFLAGS="$CFLAGS -g -O2 -Wall" +CFLAGS="$CFLAGS -O2 -Wall" dnl Count warnings as errors? -AC_ARG_WITH(werror, - [ --with-werror Count compiler warning as errors ], - [case "${withval}" in - yes) CFLAGS="-Werror $CFLAGS" ;; - no) ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;; - esac],) +AC_ARG_ENABLE(werror, + [ --enable-werror Count compiler warning as errors ],,) +if test x$enable_werror = xyes; then + CFLAGS="-Werror $CFLAGS" +fi dnl Build with NDEBUG? -AC_ARG_WITH(ndebug, - [ --with-ndebug Take out extra Asserts, Int3, etc ], - [case "${withval}" in - yes) AC_DEFINE(NDEBUG) ;; - no) ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;; - esac],) +AC_ARG_ENABLE(debug, + [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,) +if test x$enable_debug = xno; then + AC_DEFINE(NDEBUG) +else + CFLAGS="-g $CFLAGS" +fi # Test for DJGPP AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp") @@ -70,10 +65,6 @@ if test "$host_os" = "msdosdjgpp"; then else CFLAGS="-pipe $CFLAGS" - case "$host_os" in - *linux*) AC_DEFINE(__ENV_LINUX__) ;; - esac - dnl Check for SDL AM_PATH_SDL(1.1.7, :, @@ -85,7 +76,7 @@ else # Check for OpenGL AC_ARG_WITH(opengl, - [ --with-opengl Build OpenGL support ], + [ --with-opengl Build OpenGL support ], [case "${withval}" in yes) opengl=true ;; no) opengl=false ;; @@ -109,7 +100,7 @@ else # Check for GGI AC_ARG_WITH(ggi, - [ --with-ggi Build GGI support ], + [ --with-ggi Build GGI support ], [case "${withval}" in yes) ggi=true ;; no) ggi=false ;; @@ -129,7 +120,7 @@ else # Check for SVGALib AC_ARG_WITH(svga, - [ --with-svga Build SVGALib support ], + [ --with-svga Build SVGALib support ], [case "${withval}" in yes) svga=true ;; no) svga=false ;; @@ -173,25 +164,23 @@ else fi -# Check for NASM and network -AC_ARG_WITH(assembler, - [ --without-assembler Do not use assembler optimization ], - if test x$withval = xno; then - NO_ASM=1 - fi) -AC_ARG_WITH(network, - [ --without-network Do not build network/serial support ], - if test x$withval = xno; then - NO_NETWORK=1 - fi) - -if test "$NASM" = "no"; then - NO_ASM=1 +dnl Check for network +AC_ARG_ENABLE(network, + [ --disable-network Do not build network/serial support ],,) +if test x$enable_network != xno; then + AC_DEFINE(NETWORK) fi -if test "$NO_ASM" = 1; then - AC_DEFINE(NO_ASM) - NASMFLAGS="" +AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno) + +dnl Check for assembler +AC_ARG_ENABLE(assembler, + [ --disable-assembler Do not use assembler optimization ],,) +if test x$enable_assembler = xno; then + AC_DEFINE(NO_ASM) else + if test x$NASM = xno; then + AC_MSG_ERROR([$NASM not found. Install it or use --disable-assembler]) + else NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS" case $host_os in cygwin) @@ -201,17 +190,16 @@ else NASMFLAGS="-f coff -i\$(srcdir)/" ;; linux*) - NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/" + NASMFLAGS="-f elf -d__linux__ -i\$(srcdir)/" ;; *) AC_MSG_ERROR([Assembler not supported for this OS]) esac -fi -if test "$NO_NETWORK" = 0; then - AC_DEFINE(NETWORK) + fi fi -AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1) -AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1) +AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno) + +AC_SUBST(D2X_ARCH_SUBDIRS) AC_SUBST(NASMFLAGS) @@ -227,6 +215,7 @@ Makefile 2d/Makefile 3d/Makefile arch/Makefile +arch/win32/Makefile cfile/Makefile iff/Makefile input/Makefile diff --git a/main/Makefile.am b/main/Makefile.am index 528f654b..9f2962a6 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -10,10 +10,16 @@ EXTRA_PROGRAMS = d2x d2x-sdl d2x-ogl d2x-svga d2x-ggi LDFLAGS = -export-dynamic -d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a +if MINGW32 +ARCH_LIBS = ../arch/win32/libarch_win32.a +else +ARCH_LIBS = +endif + +d2x_LDADD = ${ARCH_LIBS} ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a if MINGW32 -d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} +d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} -lwsock32 else d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread ${SDL_LIBS} endif @@ -21,7 +27,13 @@ d2x_ogl_LDADD = ${d2x_sdl_LDADD} ${OGL_LIBS} d2x_svga_LDADD = ${d2x_sdl_LDADD} ${SVGA_LIBS} d2x_ggi_LDADD = ${d2x_sdl_LDADD} ${GGI_LIBS} -d2x_SOURCES = \ +if USE_NETWORK +NETWORK_SRCS = ipx_drv.c +else +NETWORK_SRCS = +endif + +d2x_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 \ @@ -54,7 +66,7 @@ newmenu.h object.h paging.h physics.h piggy.h player.h playsave.h polyobj.h \ powerup.h render.h robot.h scores.h screens.h segment.h segpoint.h slew.h \ songs.h sounds.h state.h switch.h terrain.h texmerge.h text.h textures.h \ titles.h vclip.h vers_id.h wall.h weapon.h \ -dumpmine.c +dumpmine.c ipx_drv.h dist-hook: list='$(EXTRA_SUBDIRS)'; for subdir in $$list; do \ -- 2.39.2