rendered paste bodyIndex: build.sh
===================================================================
--- build.sh (revision 2559)
+++ build.sh (working copy)
@@ -191,14 +191,20 @@
local GLEW_PREFIX_RELEASE="$INSTALL_ROOT/glew-install"
local WX_PREFIX_DEBUG="$INSTALL_ROOT/wxWidgets-install-debug"
local WX_PREFIX_RELEASE="$INSTALL_ROOT/wxWidgets-install-release"
-
+
+ if [ $NO_FMOD ]; then
+ local FMOD="--without-fmod"
+ else
+ local FMOD="--with-fmod-prefix=$FMOD_PREFIX_DEBUG"
+ fi
+
[[ $DO_GENERATE ]] && GenerateCities3DMakefiles
if [ $DO_DEBUG ]; then
ConfigureAndMake "$CITIES3D_BASE" \
"$CITIES3D_COMMON $CITIES3D_DEBUG \
--with-boost-prefix=$BOOST_PREFIX_DEBUG \
- --with-fmod-prefix=$FMOD_PREFIX_DEBUG \
+ $FMOD \
--with-glew-prefix=$GLEW_PREFIX_DEBUG \
--with-wx-prefix=$WX_PREFIX_DEBUG" \
"$BUILD_ROOT/Cities3D-build-debug" \
@@ -232,6 +238,7 @@
[[ $arg == "boost" || $arg == "all" ]] && DO_BOOST=1
[[ $arg == "fmod" || $arg == "all" ]] && DO_FMOD=1
+ [[ $arg == "nofmod" || $arg == "disable-fmod" ]] && NO_FMOD=1
[[ $arg == "glew" || $arg == "all" ]] && DO_GLEW=1
[[ $arg == "wxWidgets" || $arg == "all" ]] && DO_WX=1
[[ $arg == "Cities3D" || $arg == "all" ]] && DO_CITIES3D=1
Index: Cities3D/configure.ac
===================================================================
--- Cities3D/configure.ac (revision 2559)
+++ Cities3D/configure.ac (working copy)
@@ -57,6 +57,13 @@
fi
# Check for fmod-3.74.1 exactly
+AC_MSG_CHECKING(if fmod is disabled)
+AC_ARG_WITH(fmod,
+ [ --without-fmod Disables use of the non-free library Fmod (and sound)],
+ [AC_MSG_RESULT(yes)
+ disable-fmod=1],
+[
+AC_MSG_RESULT(no)
AM_PATH_FMOD([3.74.1], [fmodFound=1])
if test "$fmodFound" != 1; then
AC_MSG_ERROR([
@@ -68,8 +75,12 @@
You can specify the prefix where fmod is installed by
using --with-fmod-prefix=PATH when running configure.
+
+ Alternatively, you can use --without-fmod to disable
+ fmod. This will disable audio support.
])
fi
+])
# Check for glew-1.3.5 exactly
AM_PATH_GLEW([1.3.5], [glewFound=1])
@@ -121,6 +132,10 @@
# Enable optimization and symbol stripping only in non-debug mode
C3D_CXXFLAGS="-O3 -s -DNDEBUG"
fi
+if test "$disable-fmod == 1"; then
+ # Make sure source-files know not to use fmod
+ C3D_CXXFLAGS="$C3D_CXXFLAGS -Ddisable-fmod"
+fi
# Enable precompiled wxWidgets headers
C3D_CXXFLAGS="$C3D_CXXFLAGS -DWX_PRECOMP"
# Enable all standard and extra warnings
Index: Cities3D/src/RulesCore/SoundEngine.cpp
===================================================================
--- Cities3D/src/RulesCore/SoundEngine.cpp (revision 2559)
+++ Cities3D/src/RulesCore/SoundEngine.cpp (working copy)
@@ -20,8 +20,10 @@
#include "SoundEngine.h"
#include "FilePath.h"
#include "ConfigDatabase.h"
-#include "fmod.h"
-#include "fmod_errors.h"
+#ifndef disable-fmod
+ #include "fmod.h"
+ #include "fmod_errors.h"
+#endif
//---------------------------- TYPEDEFS -----------------------------//
#ifdef _DEBUG
@@ -31,6 +33,13 @@
//---------------------------- STATICS -----------------------------//
//---------------------------- PUBLIC -----------------------------//
+#ifdef disable-fmod
+ //Empty until there is an alternative
+
+ SoundEngine::SoundEngine() {}
+ void SoundEngine::PlaySound(const wxString &sound) const {}
+#else
+
SoundEngine::SoundEngine()
{
if(FALSE == FSOUND_Init(44100, 32, 0))
@@ -75,8 +84,9 @@
}
}
+#endif
+
//---------------------------- PROTECTED -----------------------------//
//---------------------------- PRIVATE -----------------------------//
-