From 2daac503a3a2f149f883db7c30199ebbb1f00c7f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 16 Nov 2010 19:26:53 +0000 Subject: cleaned up autoconf/automake project files, this should solve build order and dependency issues --- configure.in | 88 +++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 28 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 3280245..ede99bf 100644 --- a/configure.in +++ b/configure.in @@ -78,7 +78,7 @@ dnl AC_MSG_CHECKING([host type]) case "$host" in *-apple-darwin*) - HOST_LIBS="-lz" + HOST_LIBS="" HOST_GL_LIBS="-framework OpenGL" HOST_AL_LIBS="-framework OpenAL" HOST_SDL_LIBS="-framework SDL -framework Cocoa" @@ -89,10 +89,12 @@ case "$host" in OS=OSX AC_MSG_RESULT(OS X) AC_DEFINE_UNQUOTED(_OSX, 1, [Define this if you are building for native OS X]) + dnl dnl Do not rely on AC_PROG_OBJC presence (e.g. autoconf 2.59) dnl http://www.mail-archive.com/xine-cvslog@lists.sourceforge.net/msg01693.html dnl + m4_ifdef( [AC_PROG_OBJC], [AC_PROG_OBJC], @@ -101,9 +103,9 @@ dnl AC_SUBST(OBJCFLAGS)] ) ;; - + *-*-mingw*) - HOST_LIBS="-lws2_32 -lz" + HOST_LIBS="-lws2_32" HOST_GL_LIBS="-lopengl32 -lglu32" HOST_AL_LIBS="-lopenal32" ICON_CLIENT="osirion-res.o" @@ -113,14 +115,15 @@ dnl OS=WIN32 AC_MSG_RESULT(win32) ;; + *) - HOST_LIBS="-lz" + HOST_LIBS="" HOST_GL_LIBS="-lGL -lGLU" - HOST_AL_LIBS="-lopenal" - ICON_CLIENT="" - ICON_SERVER="" - SDLMAIN="" - INSTALLTYPE="standard" + HOST_AL_LIBS="-lopenal" + ICON_CLIENT="" + ICON_SERVER="" + SDLMAIN="" + INSTALLTYPE="standard" AC_MSG_RESULT(generic unix) OS=UNIX ;; @@ -163,11 +166,11 @@ dnl AC_MSG_CHECKING(whether to include debug messages) AC_ARG_ENABLE(debug_messages, AC_HELP_STRING( - [--disable-debug-messages], [build without extra debug information] + [--disable-debug-messages], [build without extra debug messages] ), AC_MSG_RESULT(no), AC_MSG_RESULT(yes) - AC_DEFINE_UNQUOTED(HAVE_DEBUG_MESSAGES, 1, [Defines if debug information is enabled]) + AC_DEFINE_UNQUOTED(HAVE_DEBUG_MESSAGES, 1, [Define this to enable debug messages]) ) dnl ---------------------------------------------------------------- @@ -195,7 +198,7 @@ if test "x${with_curses}" != "xno"; then AC_CHECK_LIB(ncurses, initscr, HAVE_CURSES="ncurses" AC_DEFINE(HAVE_CURSES, ncurses, [Define this if you have the curses library]) - CURSES_LIBS="$CURSES_LIBS -lncurses", + CURSES_LIBS="-lncurses", HAVE_CURSES="maybe" ) fi @@ -204,7 +207,7 @@ if test "x${with_curses}" != "xno"; then AC_CHECK_LIB(pdcurses, initscr, HAVE_CURSES="pdcurses" AC_DEFINE(HAVE_CURSES, pdcurses, [Define this if you have the curses library]) - CURSES_LIBS="$CURSES_LIBS -lpdcurses", + CURSES_LIBS="-lpdcurses", HAVE_CURSES="maybe" ) fi @@ -213,7 +216,7 @@ if test "x${with_curses}" != "xno"; then AC_CHECK_LIB(curses, initscr, HAVE_CURSES="curses" AC_DEFINE(HAVE_CURSES, curses, [Define this if you have the curses library]) - CURSES_LIBS="$CURSES_LIBS -lcurses", + CURSES_LIBS="-lcurses", HAVE_CURSES="maybe" ) fi @@ -240,8 +243,8 @@ AC_ARG_WITH(bullet, ) ) -save_CPPFLAGS="$CPPFLAGS" -save_LDFLAGS="$LDFLAGS" +LD_FLAGS_save="$LD_FLAGS" +CPPFLAGS_save="$CPPFLAGS" AC_MSG_CHECKING(for bullet directory) @@ -254,8 +257,8 @@ 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" -CPPFLAGS="$save_CPPFLAGS $BULLET_CPPFLAGS" -LDFLAGS="$save_LDFLAGS $BULLET_LIBS" +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]) @@ -263,8 +266,8 @@ AC_CHECK_HEADER(btBulletDynamicsCommon.h, AC_MSG_ERROR([bullet physics library not found (http://bulletphysics.org)]) ) -CPPFLAGS="$save_CPPFLAGS" -LDFLAGS="$save_LDFLAGS" +CPPFLAGS="$CPPFLAGS_save" +LD_FLAGS="$LD_FLAGS_save" AC_SUBST(BULLET_CPPFLAGS) AC_SUBST(BULLET_LIBS) @@ -273,6 +276,9 @@ dnl ---------------------------------------------------------------- dnl zlib dnl +LIBS_save="$LIBS" +LD_FLAGS_save="$LD_FLAGS" + AC_CHECK_HEADER(zlib.h, [], AC_MSG_ERROR([zlib.h not found]) @@ -283,6 +289,13 @@ AC_CHECK_LIB(z, compress, AC_MSG_ERROR([zlib not found]) ) +LD_FLAGS="$LD_FLAGS_save" +LIBS="$LIBS_save" + +LIBZ_LIBS="-lz" +AC_SUBST(LIBZ_LIBS) + + dnl ---------------------------------------------------------------- dnl build client and server or dedicated server only dnl @@ -301,7 +314,7 @@ if test "x${with_client}" = xno; then else AC_MSG_RESULT(yes) - LDFLAGS_save="$LDFLAGS" + LD_FLAGS_save="$LDFLAGS" dnl --------------------------------------------------------------- dnl OpenGL @@ -327,7 +340,7 @@ else ) fi - LD_FLAGS="$LDFLAGS_save" + LD_FLAGS="$LD_FLAGS_save" GL_LIBS="$HOST_GL_LIBS" AC_SUBST(GL_LIBS) AC_SUBST(GL_CFLAGS) @@ -347,7 +360,7 @@ else ) fi - LD_FLAGS="$LDFLAGS_save" + LD_FLAGS="$LD_FLAGS_save" AL_LIBS="$HOST_AL_LIBS" AC_SUBST(AL_LIBS) AC_SUBST(AL_CFLAGS) @@ -356,6 +369,9 @@ else dnl libpng dnl + LD_FLAGS_save="$LD_FLAGS" + LD_FLAGS="$LD_FLAGS $LIBZ_LIBS" + AC_CHECK_HEADER(png.h, [], [AC_MSG_ERROR([png.h not found])] @@ -365,6 +381,7 @@ else [AC_MSG_ERROR([libpng not found])] ) + LD_FLAGS="$LD_FLAGS_save" LIBPNG_LIBS="-lpng" AC_SUBST(LIBPNG_LIBS) @@ -474,10 +491,25 @@ dnl Write makefiles and config.h AM_CONDITIONAL(BUILD_CLIENT, test "x$BUILD_CLIENT" = xyes) AM_CONDITIONAL(BUILD_DEDICATED, test "x$BUILD_CLIENT" = xno) -AC_OUTPUT(Makefile src/Makefile src/audio/Makefile src/auxiliary/Makefile \ - src/client/Makefile src/core/Makefile src/dedicated/Makefile src/filesystem/Makefile \ - src/game/Makefile src/game/base/Makefile src/game/example/Makefile src/game/intro/Makefile \ - src/math/Makefile src/model/Makefile src/render/Makefile src/sys/Makefile src/ui/Makefile) +AC_OUTPUT( \ + src/auxiliary/Makefile \ + src/math/Makefile \ + src/sys/Makefile \ + src/filesystem/Makefile \ + src/model/Makefile \ + src/core/Makefile \ + src/dedicated/Makefile \ + src/audio/Makefile \ + src/render/Makefile \ + src/ui/Makefile\ + src/client/Makefile \ + src/game/base/Makefile \ + src/game/example/Makefile \ + src/game/intro/Makefile \ + src/game/Makefile \ + src/Makefile \ + Makefile +) dnl --------------------------------------------------------------- dnl Configuration summary @@ -489,7 +521,7 @@ Configuration summary: platform ........... $host flags .............. $CPPFLAGS $CXXFLAGS -libraries .......... $HOST_LIBS $LIBJPG_LIBS $LIBPNG_LIBS $CURSES_LIBS +libraries .......... $HOST_LIBS $LIBJPG_LIBS $LIBPNG_LIBS $LIBZ_LIBS $CURSES_LIBS bullet ............. $BULLET_LIBS curses ............. $HAVE_CURSES build client ....... $BUILD_CLIENT]) -- cgit v1.2.3