|
From: <sik...@us...> - 2006-05-17 01:51:21
|
Revision: 10 Author: sik0fewl Date: 2006-05-16 18:51:13 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=10&view=rev Log Message: ----------- Added Jam build system To build: ./autogen.sh ./configure --enable-debug jam Let me know if you run into any problems. autogen.sh and configure only need to be run once. After that, just use jam to rebuild the project Added Paths: ----------- trunk/perceptioncrash/Jamfile trunk/perceptioncrash/Jamrules trunk/perceptioncrash/autogen.sh trunk/perceptioncrash/configure.ac trunk/perceptioncrash/src/Jamfile Property Changed: ---------------- trunk/perceptioncrash/ Property changes on: trunk/perceptioncrash ___________________________________________________________________ Name: svn:ignore - .sconsign ogre.log perceptioncrash + .sconsign ogre.log build perceptioncrash Added: trunk/perceptioncrash/Jamfile =================================================================== --- trunk/perceptioncrash/Jamfile (rev 0) +++ trunk/perceptioncrash/Jamfile 2006-05-17 01:51:13 UTC (rev 10) @@ -0,0 +1,8 @@ +SubDir TOP ; + +SubInclude TOP src ; + +UseAutoconf ; + +InstallDoc README ; + Added: trunk/perceptioncrash/Jamrules =================================================================== --- trunk/perceptioncrash/Jamrules (rev 0) +++ trunk/perceptioncrash/Jamrules 2006-05-17 01:51:13 UTC (rev 10) @@ -0,0 +1,44 @@ +# make sure top_builddir is set +if ! $(top_builddir) +{ + top_builddir = $(TOP) ; +} +top_srcdir = $(TOP) ; + +# check if a Jamconfig file already exists +JAMCONFIG ?= $(top_builddir)/Jamconfig ; +include $(JAMCONFIG) ; +if ! $(JAMCONFIG_READ) +{ + EXIT "Couldn't find config. Please run 'configure' first." ; +} + +# It's a c++ application, so we should link with the c++ compiler +LINK = $(CXX) ; + +# do some compiler settings for the different compilation modes +switch $(VARIANT) { + case optimize : + CFLAGS += -O3 -g -Wall ; + CXXFLAGS += -O3 -g -Wall ; + LIBS += -g ; + case debug : + CFLAGS += -Wall -W -O0 -g3 -DDEBUG ; + CXXFLAGS += -Wall -W -O0 -g3 -DDEBUG ; + LIBS += -g3 ; + case profile : + CFLAGS += -O3 -g3 -pg ; + CXXFLAGS += -O3 -g3 -pg ; + LIBS += -g3 -pg ; + case * : + EXIT "Invalid variant $(VARIANT) selected" ; +} + +# Include build rules +include $(TOP)/mk/jam/build.jam ; + +# Include the top_builddir dir, because it contains config.h +IncludeDir $(top_builddir) ; + +# also add the src dir as include directory +IncludeDir $(TOP)/src ; Added: trunk/perceptioncrash/autogen.sh =================================================================== --- trunk/perceptioncrash/autogen.sh (rev 0) +++ trunk/perceptioncrash/autogen.sh 2006-05-17 01:51:13 UTC (rev 10) @@ -0,0 +1,25 @@ +#! /bin/sh + +# Correct working directory? +if test ! -f configure.ac ; then + echo "*** Please invoke this script from directory containing configure.ac." + exit 1 +fi + +# construct aclocal.m4 from macro files +MACRODIR=mk/autoconf +aclocal -I $MACRODIR + +# generate a Jamconfig.in +echo 'prefix ?= "@prefix@" ;' > Jamconfig.in +echo 'exec_prefix ?= "@exec_prefix@" ;' >> Jamconfig.in +autoconf --trace=AC_SUBST \ + | sed -e 's/configure.ac:[0-9]*:AC_SUBST:\([^:]*\).*/\1 ?= "@\1@" ;/g' \ + | sort -u \ + >> Jamconfig.in + +# seems autoconf --trace misses some things :-/ +echo 'INSTALL ?= "@INSTALL@" ;' >> Jamconfig.in + +autoheader +autoconf Property changes on: trunk/perceptioncrash/autogen.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: trunk/perceptioncrash/configure.ac =================================================================== --- trunk/perceptioncrash/configure.ac (rev 0) +++ trunk/perceptioncrash/configure.ac 2006-05-17 01:51:13 UTC (rev 10) @@ -0,0 +1,96 @@ +#---------------------------------------------------------------------------- +# Autoconf input script. Start the ./autgen.sh script for producing a +# the configure script. +#---------------------------------------------------------------------------- +AC_PREREQ([2.54]) + +AC_INIT([perceptioncrash], [0.0.0-svn], [per...@li...]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_AUX_DIR([mk/autoconf]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +#---------------------------------------------------------------------------- +# Configuration header +#---------------------------------------------------------------------------- +AC_CONFIG_HEADERS(config.h) + +# stupid autoconf is adding default -g -O2 flags which we don't want :-/ +test ".$CFLAGS" = "." && CFLAGS=" " +test ".$CXXFLAGS" = "." && CXXFLAGS=" " + +#---------------------------------------------------------------------------- +# Check for operating system +#---------------------------------------------------------------------------- +AC_MSG_CHECKING([for target host]) +case $host_os in + mingw*|cygwin*) + AC_MSG_RESULT(WIN32) + AC_DEFINE([WIN32], [], [define when compiling for a win32 box]) + ;; + *) + AC_MSG_RESULT([assuming unix]) + AC_DEFINE([UNIX], [], [define when compiling for a unix/posix system]) + ;; +esac + +#---------------------------------------------------------------------------- +# Check for build variant (debug, profile, optimize) +#---------------------------------------------------------------------------- +VARIANT=optimize +AC_ARG_ENABLE([optimize], [AC_HELP_STRING([--enable-optimize], + [build with optimizations enabled (default YES)])], + [test "$enableval" = "yes" && VARIANT=optimize]) + +AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], + [build with debugging information (default NO)])], + [test "$enableval" = "yes" && VARIANT=debug]) + +AC_ARG_ENABLE([profile], [AC_HELP_STRING([--enable-profile], + [build with profiling information (default NO)])], + [test "$enableval" = "yes" && VARIANT=profile]) +AC_SUBST([VARIANT]) + +#---------------------------------------------------------------------------- +# find applications +#---------------------------------------------------------------------------- +AC_PROG_CXX +AC_PROG_INSTALL + +AC_DISABLE_STATIC # (we handle static libraries ourself) +#AC_PROG_LIBTOOL + +#---------------------------------------------------------------------------- +# find libraries +#---------------------------------------------------------------------------- +#AM_PATH_SDL([1.2.5]) + +PKG_CHECK_MODULES([OGRE], [OGRE >= 1.2.0]) +PKG_CHECK_MODULES([CEGUI], [CEGUI >= 0.4.1]) + +OGRE_LIBS="$OGRE_LIBS -lCEGUIOgreRenderer" +AC_SUBST([OGRE_LIBS]) + +NP_FINDLIB([CEGUIOGRERENDERER], [CEGUIOgreRenderer], [CEGUIOgreRenderer], + NP_LANG_PROGRAM([], + []), + [], [-lCEGUIOgreRenderer], + [], + [AC_MSG_ERROR([Unable to find libCEGUIOgreRenderer. Please check your Ogre3d installation.])], + [$OGRE_CFLAGS $CEGUI_CFLAGS], [$OGRE_LIBS $CEGUI_LIBS]) + +# do jam specific fixes +AC_INIT_JAM + +# finally output Jamconfig +AC_CONFIG_FILES([Jamconfig]) +AC_OUTPUT + +# a notice for the users +AC_MSG_NOTICE([ + +Please note that this project uses jam (and not make) as build tool. +]) + Added: trunk/perceptioncrash/src/Jamfile =================================================================== --- trunk/perceptioncrash/src/Jamfile (rev 0) +++ trunk/perceptioncrash/src/Jamfile 2006-05-17 01:51:13 UTC (rev 10) @@ -0,0 +1,24 @@ +SubDir TOP src ; + +# construct a new application target and use all .cpp and .hpp files in this +# directory as sources +sources = + [ Wildcard *.cpp *.hpp ] +; + +# We link with the samplelib from the same package +#LinkWith sample : sharedlib staticlib ; + +# If SDL is available we link with it and define SDL_AVAILABLE constant +#if $(SDL_LIBS) != "" || $(SDL_CFLAGS) != "" +#{ +# CFlags sample : -DSDL_AVAILABLE ; +# ExternalLibs sample : SDL ; +#} + +Application perceptioncrash : $(sources) ; +ExternalLibs perceptioncrash : OGRE CEGUI CEGUIOGRERENDERER ; + +# Construct a description for the help target +Help perceptioncrash : "Build the Perception Crash executable" ; + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |