Hello everyone.

Since both build systems Warzone currently employs have some problems
(not the least of which is having to update both), I have adapted the
pentagram.sf.net build system for Warzone.

(Quoted from README.buildsystem, included in wz-newbuildsystem.tar.bz2):

"The build system is based upon that used by Pentagram (pentagram.sf.net). It
uses autoconf, make (not automake) and perl.

Advantages to the current build systems:
 * Just one build system
 * Familiar build process
 * No new/uncommon dependencies
 * Fast because of no recursive make calls
 * Doesn't build a library for every source directory
 * You don't need to rerun the whole autostuff after adding one source file
 * Dependency checking
 * Stops as soon as an error occurs
 * Can build in a separate directory (does the current build system support
   this?)

(Possible) Disadvantages:
 * Unfamiliar for developers (that's what this document is for)
 * You need to run './bootstrap && ./configure' once, after that only when you
   change configure.ac/Makefile.in or install new development packages etc.
 * Every source file (.c/.l/.y) will be built (if it's in a directory listed in
   Make.modules)

Things not implemented currently (more or less easily changed):
 * make install
 * Files with extensions other than .c/.l/.y
 * Building the software renderer"

More information is in README.buildsystem.

To try it, do the following (ideally from a fresh SVN checkout, so there are no
stray files around):


find -name Makefile.\* | xargs rm
rm -rf autogen.sh makerules
mv lib/framework/cursors.c lib/framework/cursors.inc
patch -p0 < wz-newbuildsystem.patch
tar xfj wz-newbuildsystem.tar.bz2
./bootstrap
./configure
make


After that, you have a warzone binary in the current directory, which
will not work from there, since it doesn't find its data (on the other
hand, a user may find it more easily there...), just move/symlink it
into the data directory and run it from there.


Comments?
Anything missing (except "make install", I'll add that later)?
Anything else?




--
        Chapter VIII

Due to the convergence of forces beyond his comprehension, Salvatore
Quanucci was suddenly squirted out of the universe like a watermelon
seed, and never heard from again.
Index: m4/sdl.m4
===================================================================
--- m4/sdl.m4   (revision 59)
+++ m4/sdl.m4   (working copy)
@@ -5,10 +5,10 @@
 # stolen from Manish Singh
 # Shamelessly stolen from Owen Taylor
 
-dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl AC_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],
+AC_DEFUN([AC_PATH_SDL],
 [dnl 
 dnl Get the cflags and libraries from the sdl-config script
 dnl
Index: m4/vorbis.m4
===================================================================
--- m4/vorbis.m4        (revision 59)
+++ m4/vorbis.m4        (working copy)
@@ -2,10 +2,10 @@
 # Jack Moffitt <[EMAIL PROTECTED]> 10-21-2000
 # Shamelessly stolen from Owen Taylor and Manish Singh
 
-dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl AC_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
 dnl
-AC_DEFUN([AM_PATH_VORBIS],[
+AC_DEFUN([AC_PATH_VORBIS],[
 dnl 
 dnl Get the cflags and libraries
 dnl
Index: m4/ogg.m4
===================================================================
--- m4/ogg.m4   (revision 59)
+++ m4/ogg.m4   (working copy)
@@ -2,10 +2,10 @@
 # Jack Moffitt <[EMAIL PROTECTED]> 10-21-2000
 # Shamelessly stolen from Owen Taylor and Manish Singh
 
-dnl AM_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl AC_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
 dnl
-AC_DEFUN([AM_PATH_OGG],[
+AC_DEFUN([AC_PATH_OGG],[
 dnl 
 dnl Get the cflags and libraries
 dnl
Index: src/multiopt.c
===================================================================
--- src/multiopt.c      (revision 59)
+++ src/multiopt.c      (working copy)
@@ -1096,7 +1096,6 @@
        st = getMultiStats(selectedPlayer,TRUE);        // save stats
 
        
saveMultiStats(getPlayerName(selectedPlayer),getPlayerName(selectedPlayer),&st);
        
-       mplayerSubmit();
 
        NETclose();                                                             
        // close game.
 
Index: configure.ac
===================================================================
--- configure.ac        (revision 59)
+++ configure.ac        (working copy)
@@ -1,19 +1,91 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.56)
-AC_INIT([warzone], [2.0], [http://gna.org/projects/warzone])
+AC_INIT([warzone], [1.99], [http://developer.berlios.de/projects/warzone/])
 AC_CONFIG_SRCDIR([lib/gamelib/anim.h])
 AC_CONFIG_HEADER([config.h])
+
+PACKAGE=warzone
+
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package Name])
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE
-AM_MAINTAINER_MODE
+# System settings
+AC_EXEEXT
 
+# will be overridden for windows
+EMPTY_FILE=/dev/null
+RM="rm -rf"
+MKDIR="mkdir -p"
+
+AC_SUBST(EMPTY_FILE)
+AC_SUBST(RM)
+AC_SUBST(MKDIR)
+
+AC_MSG_CHECKING(system)
+case "$host_os" in
+        linux*)
+                AC_DEFINE(UNIX, 1, [UNIX-variant])
+                AC_DEFINE(LINUX, 1, [Linux])
+                AC_DEFINE(HAVE_HOME, 1, [HOME env.var exists])
+                AC_MSG_RESULT(UNIX (GNU/Linux))
+                ;;
+        mingw32*)
+                AC_DEFINE(WIN32, 1, [Windows])
+                AC_MSG_RESULT(Win32 (mingw32))
+                # note that -mwindows is added by SDL_LIBS
+                GUI_LIBS="$GUI_LIBS -lwinmm"
+                CON_LIBS="$CON_LIBS -mconsole"
+                EMPTY_FILE=nul
+                ;;
+        cygwin*)
+                AC_DEFINE(WIN32, 1, [Windows])
+                AC_DEFINE(CYGWIN, 1, [Cygwin])
+                AC_MSG_RESULT(Win32 (cygwin))
+                CXXFLAGS="$CXXFLAGS -mno-cygwin"
+                GUI_LIBS="$GUI_LIBS -lwinmm"
+                EMPTY_FILE=nul
+                ;;
+        openbsd*)
+                AC_DEFINE(UNIX, 1, [UNIX-variant])
+                AC_DEFINE(HAVE_HOME, 1, [HOME env.var exists])
+                AC_DEFINE(OPENBSD, 1, [OpenBSD])
+                AC_MSG_RESULT(UNIX (OpenBSD))
+                GUI_LIBS="$GUI_LIBS -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm 
-lXxf86dga"
+                ;;
+        solaris*)
+                AC_DEFINE(UNIX, 1, [UNIX-variant])
+                AC_DEFINE(HAVE_HOME, 1, [HOME env.var exists])
+                AC_MSG_RESULT(UNIX (Solaris))
+                GUI_LIBS="$GUI_LIBS -lX11"
+                ;;
+        darwin*)
+                dnl We have a problem here: both MacOS X and Darwin report
+                dnl the same signature "powerpc-apple-darwin*" - so we have
+                dnl to do more to distinguish them. Plain Darwin will propably
+                dnl use X-Windows; and it is of course lacking Cocoa.
+                dnl For now I am lazy and do not add proper detection code.
+                AC_DEFINE(MACOSX, 1, [Mac OS X])
+                AC_MSG_RESULT(Mac OS X)
+                GUI_LIBS="$GUI_LIBS -framework AudioUnit -framework CoreMIDI"
+                DATAPATH="data"
+                ;;
+        *)
+                AC_DEFINE(UNIX, 1, [UNIX-variant])
+                AC_MSG_RESULT(not sure... guessing a unix variant)
+                ;;
+esac
+
 # Checks for programs.
+AC_PROG_CPP
 AC_PROG_CC
-AC_PROG_RANLIB
+AC_PROG_CXX
 AC_PROG_YACC
 AC_PROG_LEX
+AC_PROG_INSTALL
 
 # Checks for libraries.
 
@@ -48,8 +120,11 @@
   no)  make_data=false ;;
   *)   AC_MSG_ERROR(bad value ${enableval} for --disable-make-data) ;;
 esac], [make_data=true])
-AM_CONDITIONAL(MAKE_DATA, test x$make_data = xtrue)
 
+if test "$make_data" = true; then
+  AC_DEFINE(MAKE_DATA, 1, [Define to make data])
+fi
+
 AC_CHECK_LIB(m, pow)
 
 AC_CHECK_LIB(z, gzgets, ,
@@ -59,6 +134,32 @@
 You may need to install a zlib \"development\" package.]))
 WZ_LIBS="$WZ_LIBS -lz"
 
+AC_ARG_ENABLE(warnings,
+[  --enable-warnings       show compiler warnings],
+[ warnings=$enableval ], [ warnings=no ])
+AC_MSG_CHECKING([warnings])
+if test "$warnings" = yes; then
+  WARNINGS="-W -Wall"
+  AC_MSG_RESULT([yes])
+else
+  WARNINGS=""
+  AC_MSG_RESULT([no])
+fi
+AC_SUBST(WARNINGS)
+
+AC_ARG_ENABLE(profiling,
+[  --enable-profiling      enable profiling],
+[ profiling=$enableval ], [ profiling=no ])
+AC_MSG_CHECKING([profiling])
+if test "$profiling" = yes; then
+  PROFILE="-pg"
+  AC_MSG_RESULT([yes])
+else
+  PROFILE=""
+  AC_MSG_RESULT([no])
+fi
+AC_SUBST(PROFILE)
+
 AC_ARG_ENABLE(debug,
 [  --enable-debug          run in debug mode],
 [ debug=$enableval ], [ debug=no ])
@@ -129,7 +230,7 @@
 WZ_EXPAND_DIR(datadir, "$datadir/warzone")
 AC_DEFINE_UNQUOTED(DEFAULT_DATA_DIR, "$datadir", [Warzone data path])
 
-AM_PATH_SDL([1.1.4], [sdl_found="yes"], [sdl_found="no"])
+AC_PATH_SDL([1.1.4], [sdl_found="yes"], [sdl_found="no"])
 if test "$sdl_found" = yes; then
   WZ_CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
   WZ_CFLAGS="$CFLAGS $SDL_CFLAGS"
@@ -138,6 +239,11 @@
   AC_MSG_ERROR([You need to install SDL (http://www.libsdl.org/).])
 fi
 
+GUI_LIBS="$GUI_LIBS $SDL_LIBS"
+
+AC_SUBST(SYS_LIBS)
+AC_SUBST(GUI_LIBS)
+
 AC_PATH_SDLNET([
        WZ_CPPFLAGS="$WZ_CPPFLAGS $SDLNETINC" WZ_LIBS="$WZ_LIBS $SDLNETLIB"],
        AC_MSG_ERROR(SDL_net is not installed))
@@ -146,10 +252,10 @@
   AC_CHECK_HEADER(GL/gl.h, GL_h=yes, GL_h=no)
   AC_CHECK_HEADER(GL/glu.h, GLU_h=yes, GLU_h=no)
   GL_lib=yes
-  AC_CHECK_LIB(GL, main, GLLIB=GL, 
+  AC_CHECK_LIB(GL, main, GLLIB=GL,
                [AC_CHECK_LIB(opengl32, main, GLLIB=opengl32, GL_lib=no)])
   GLU_lib=yes
-  AC_CHECK_LIB(GLU, main, GLULIB=GLU, 
+  AC_CHECK_LIB(GLU, main, GLULIB=GLU,
                [AC_CHECK_LIB(glu32, main, GLULIB=glu32, GLU_lib=no)])
   if test "x$GL_lib" = "xno" -o "x$GLU_lib" = "xno"; then
     if test "x$opengl" = xyes; then
@@ -185,7 +291,7 @@
 if test "x$openal" != xno; then
   AC_CHECK_HEADER(AL/al.h, AL_h=yes, AL_h=no)
   AL_lib=yes
-  AC_CHECK_LIB(openal, main, ALLIB=openal, 
+  AC_CHECK_LIB(openal, main, ALLIB=openal,
                [AC_CHECK_LIB(openal32, main, ALLIB=openal32, AL_lib=no)])
   # On Windows (and perhaps some other platforms), Alut is a separate library
   AC_CHECK_LIB(alut, main, ALUTLIB="-lalut", ALUTLIB="")
@@ -233,8 +339,8 @@
 else
   if test "x$ogg" = "xyes"
   then
-    AM_PATH_OGG(have_ogg=yes, have_ogg=no)
-    AM_PATH_VORBIS(have_vorbis=yes, have_vorbis=no)
+    AC_PATH_OGG(have_ogg=yes, have_ogg=no)
+    AC_PATH_VORBIS(have_vorbis=yes, have_vorbis=no)
     if test "x$have_ogg" = "xyes"
     then
       if test "x$have_vorbis" = "xyes"
@@ -271,26 +377,13 @@
 # generates the kind of filename that automake expects.
 AC_SUBST(FLEX_FLAGS, "-olex.yy.c")
 
-# only now set the LIBS/CFLAGS/CPPFLAGS lines, if set earlier it will give 
+# only now set the LIBS/CFLAGS/CPPFLAGS lines, if set earlier it will give
 # strange error messages when something is wrong
-LIBS="$LIBS $WZ_LIBS"
+LDFLAGS="$LIBS $WZ_LIBS"
 CFLAGS="$CFLAGS $WZ_CFLAGS"
 CPPFLAGS="$CPPFLAGS $WZ_CPPFLAGS"
 
 AC_CONFIG_FILES([Makefile
-                 lib/Makefile
-                 lib/framework/Makefile
-                 lib/gamelib/Makefile
-                 lib/ivis_opengl/Makefile
-                 lib/ivis02/Makefile
-                 lib/ivis_common/Makefile
-                 lib/netplay/Makefile
-                 lib/script/Makefile
-                 lib/sequence/Makefile
-                 lib/sound/Makefile
-                 lib/widget/Makefile
-                 data/Makefile
-                 src/Makefile
                  autopackage/default.apspec])
 AC_OUTPUT
 
Index: lib/framework/frame.c
===================================================================
--- lib/framework/frame.c       (revision 59)
+++ lib/framework/frame.c       (working copy)
@@ -24,7 +24,7 @@
 
 #include "fractions.h"
 #include <assert.h>
-#include "cursors.c"
+#include "cursors.inc"
 
 #define IGNORE_FOCUS
 

Attachment: wz-newbuildsystem.tar.bz2
Description: Binary data

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to