From 3cf2faf81f4990d231c42c0151eef6738bf0160c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 18 Nov 2010 22:24:11 +0000 Subject: Added autodetection to configure for bullet libraries installed in /usr or /usr/local, added --enable-static-bullet option to staticly link the libraries. Updated installation instructions. --- Makefile.am | 2 ++ configure.in | 64 ++++++++++++++++++++++++++++++++++----------------- doc/installation.html | 54 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 91 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index 13a6b8e..07835a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,5 +2,7 @@ # have all needed files, that a GNU package needs AUTOMAKE_OPTIONS = foreign 1.4 +ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = src diff --git a/configure.in b/configure.in index ede99bf..e33b46b 100644 --- a/configure.in +++ b/configure.in @@ -16,6 +16,8 @@ AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL +AC_CONFIG_MACRO_DIR([m4]) + dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, dnl if-not-found, test-parameter) AC_DEFUN([KDE_FIND_PATH], @@ -150,9 +152,7 @@ dnl AC_MSG_CHECKING(whether to abort on compiler warnings) WARN_CFLAGS="" AC_ARG_ENABLE(warn, - AC_HELP_STRING( - [--disable-warn], [do not abort on compiler warnings] - ), + AC_HELP_STRING([--disable-warn], [do not abort on compiler warnings]), AC_MSG_RESULT(no), AC_MSG_RESULT(yes) WARN_CFLAGS="$WARN_CFLAGS -Wall -Werror" @@ -165,9 +165,7 @@ dnl AC_MSG_CHECKING(whether to include debug messages) AC_ARG_ENABLE(debug_messages, - AC_HELP_STRING( - [--disable-debug-messages], [build without extra debug messages] - ), + AC_HELP_STRING([--disable-debug-messages], [build without extra debug messages]), AC_MSG_RESULT(no), AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_DEBUG_MESSAGES, 1, [Define this to enable debug messages]) @@ -237,35 +235,59 @@ dnl HAVE_BULLET=no +AC_ARG_ENABLE(static_bullet, + AC_HELP_STRING([--enable-static-bullet], [staticly link with bullet physics libraries]), + AC_MSG_RESULT(yes), + STATIC_BULLET="yes" + AC_MSG_RESULT(no) + STATIC_BULLET="no" +) + AC_ARG_WITH(bullet, - AC_HELP_STRING([--with-bullet=DIR], - [use the bullet physics library in DIR (read the documentation)] + AC_HELP_STRING([--with-bullet=PREFIX], + [link with bullet physics library installed in PREFIX] ) ) LD_FLAGS_save="$LD_FLAGS" CPPFLAGS_save="$CPPFLAGS" -AC_MSG_CHECKING(for bullet directory) - -BULLET_DIR="/usr/local" +BULLET_DIRS="/usr/local /usr" if test "x${with_bullet}" != "x"; then - BULLET_DIR="${with_bullet}" + BULLET_DIRS="${with_bullet}" fi -AC_MSG_RESULT([$BULLET_DIR]) -BULLET_CPPFLAGS="-I${BULLET_DIR}/include/bullet" -BULLET_LIBS="$BULLET_DIR/lib/libBulletDynamics.a $BULLET_DIR/lib/libBulletCollision.a $BULLET_DIR/lib/libLinearMath.a" +for dir_to_test in ${BULLET_DIRS}; do + if test "x${BULLET_DIR}" = "x"; then + CPPFLAGS="-I${dir_to_test}/include/bullet" + AC_CHECK_HEADER(btBulletDynamicsCommon.h, + BULLET_DIR="${dir_to_test}", + [] + ) + fi +done + +if test "x${BULLET_DIR}" = "x"; then + AC_MSG_ERROR([bullet physics library not found in ${BULLET_DIRS}]) +fi + +AC_MSG_CHECKING([for bullet prefix]) +AC_MSG_RESULT([${BULLET_DIR}]) + +AC_MSG_CHECKING([if static linking of the bullet libraries is requested]) +if test "x${enable_static_bullet}" = "xyes"; then + BULLET_CPPFLAGS="-I${BULLET_DIR}/include/bullet" + BULLET_LIBS="$BULLET_DIR/lib/libBulletDynamics.a $BULLET_DIR/lib/libBulletCollision.a $BULLET_DIR/lib/libLinearMath.a" + AC_MSG_RESULT([yes]) +else + BULLET_CPPFLAGS="-I${BULLET_DIR}/include/bullet" + BULLET_LIBS="-lBulletDynamics -lBulletCollision -lLinearMath" + AC_MSG_RESULT([no]) +fi CPPFLAGS="$CPPFLAGS_save $BULLET_CPPFLAGS" LD_FLAGS="$LD_FLAGS_save $BULLET_LIBS" -AC_CHECK_HEADER(btBulletDynamicsCommon.h, - AC_DEFINE(HAVE_BULLET, yes, [Define this if you have the bullet physics library]) - HAVE_BULLET="yes", - AC_MSG_ERROR([bullet physics library not found (http://bulletphysics.org)]) -) - CPPFLAGS="$CPPFLAGS_save" LD_FLAGS="$LD_FLAGS_save" diff --git a/doc/installation.html b/doc/installation.html index ebfe223..0e06100 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -82,13 +82,21 @@
+

+ Requirements:
+ To run the client, tour system will need to have the following packages installed: libSDL, libjpeg, libpng and libz. + You do not need to have the bullet libraries installed. To run the dedicated server you need libz and ncurses. + These are common packages and most systems will already have them installed. +

Linux download:
osirion-linux-latest.zip (32- and 64-bit)
This package contains the linux version of the client and the server. +

Extract the package, a new subdirectory will be created. The actual directory name will depend on the version number. Enter the new subdirectory. +

tar jxvf osirion-latest.tar.bz2
cd osirion-linux-740 @@ -96,18 +104,22 @@ cd osirion-linux-740

Dowload the game data package:
osirion-data-latest.zip
+

Unzip it: +

unzip ../osirion-data-latest.zip

To run the 32 bit client: +

./osirion.x86

To run the 64 bit client: +

./osirion.x86_64
@@ -149,8 +161,17 @@ unzip ../osirion-data-latest.zip

You will also need a recent version of gcc, GNU make, automake and libtool. - In theory, the source should compile on any POSIX-compatible platform - supported by SDL. +

+
+ +
+ Building on windows +
+
+

+ You can build the source on windows using a MinGW/MSYS environment. You can use + the instructions in this document + to create a complete environment, capable of building the Project::OSiRiON source code.

@@ -178,6 +199,9 @@ cd bullet-2.77
make
sudo make install
+

+ I recommend you use this specific version of the library, physics behaviour could be different in other versions. +

@@ -228,22 +252,36 @@ autoreconf -fi
If you do not need the client and want to build the dedicated server only you can pass the --without-client option to configure:

+
+./configure --without-client +

- Configure will automaticly detect the bullet library if it was installed in /usr/local. - If it was installed somewhere else you will have to pass the --with-bullet=directory option - to configure. For example, --with-bullet=/usr will use the bullet libraries installed in - /usr/lib and the includes in /usr/include/bullet. + Configure will automaticly detect the bullet library if it was installed in + /usr or /usr/local. + If it was installed somewhere else you will have to pass the --with-bullet=prefix option + to configure. For example, --with-bullet=/opt/bullet will use the bullet libraries installed in + /opt/bullet/lib and the includes in /opt/bullet/include/bullet.

-
-./configure --without-client --with-bullet=/usr +./configure --with-bullet=/opt/bullet
+

+ If you add the --enable-static-bullet option, the resulting binary will be staticly + linked with the bullet libraries. They will work on systems that do not have bullet installed. +

+
+./configure --with-bullet=/opt/bullet --enable-static-bullet +
+

If configure finds ncurses or pdcurses, the dedicated server will use this library and a have a curses console. To disable curses detection, pass the --without-curses option to configure.

+
+./configure --without-client --without-curses +

Compile the source code:

-- cgit v1.2.3