Sfoglia il codice sorgente

* next ubuntux's patch

mateuszb 16 anni fa
parent
commit
408411d8c3

+ 1 - 1
AI/EmptyAI/Makefile.am

@@ -1,5 +1,5 @@
 pkglib_LTLIBRARIES = EmptyAI.la
 pkglib_LTLIBRARIES = EmptyAI.la
-EmptyAI_la_LIBADD = $(top_builddir)/lib/libvcmi.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
+EmptyAI_la_LIBADD = $(top_builddir)/lib/libvcmi.la $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 EmptyAI_la_LDFLAGS = -L$(top_builddir)/lib -module
 EmptyAI_la_LDFLAGS = -L$(top_builddir)/lib -module
 EmptyAI_la_SOURCES = \
 EmptyAI_la_SOURCES = \
 	CEmptyAI.cpp \
 	CEmptyAI.cpp \

+ 1 - 1
AI/GeniusAI/Makefile.am

@@ -1,5 +1,5 @@
 pkglib_LTLIBRARIES = GeniusAI.la
 pkglib_LTLIBRARIES = GeniusAI.la
-GeniusAI_la_LIBADD = $(top_builddir)/lib/libvcmi.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
+GeniusAI_la_LIBADD = $(top_builddir)/lib/libvcmi.la $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 GeniusAI_la_LDFLAGS = -L$(top_builddir)/lib -module
 GeniusAI_la_LDFLAGS = -L$(top_builddir)/lib -module
 GeniusAI_la_SOURCES = \
 GeniusAI_la_SOURCES = \
 	CGeniusAI.cpp \
 	CGeniusAI.cpp \

+ 40 - 15
aclocal/m4/ax_boost_base.m4

@@ -1,4 +1,6 @@
-##### http://autoconf-archive.cryp.to/ax_boost_base.html
+# ===========================================================================
+#             http://autoconf-archive.cryp.to/ax_boost_base.html
+# ===========================================================================
 #
 #
 # SYNOPSIS
 # SYNOPSIS
 #
 #
@@ -8,10 +10,10 @@
 #
 #
 #   Test for the Boost C++ libraries of a particular version (or newer)
 #   Test for the Boost C++ libraries of a particular version (or newer)
 #
 #
-#   If no path to the installed boost library is given the macro
-#   searchs under /usr, /usr/local, and /opt, and evaluates the
-#   $BOOST_ROOT environment variable. Further documentation is
-#   available at <http://randspringer.de/boost/index.html>.
+#   If no path to the installed boost library is given the macro searchs
+#   under /usr, /usr/local, /opt and /opt/local and evaluates the
+#   $BOOST_ROOT environment variable. Further documentation is available at
+#   <http://randspringer.de/boost/index.html>.
 #
 #
 #   This macro calls:
 #   This macro calls:
 #
 #
@@ -23,15 +25,15 @@
 #
 #
 # LAST MODIFICATION
 # LAST MODIFICATION
 #
 #
-#   2007-03-15
+#   2008-04-12
 #
 #
 # COPYLEFT
 # COPYLEFT
 #
 #
-#   Copyright (c) 2007 Thomas Porschberg <[email protected]>
+#   Copyright (c) 2008 Thomas Porschberg <[email protected]>
 #
 #
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
 
 
 AC_DEFUN([AX_BOOST_BASE],
 AC_DEFUN([AX_BOOST_BASE],
 [
 [
@@ -50,6 +52,21 @@ AC_ARG_WITH([boost],
     ],
     ],
     [want_boost="yes"])
     [want_boost="yes"])
 
 
+
+AC_ARG_WITH([boost-libdir],
+        AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
+        [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
+        [
+        if test -d $withval
+        then
+                ac_boost_lib_path="$withval"
+        else
+                AC_MSG_ERROR(--with-boost-libdir expected directory name)
+        fi
+        ],
+        [ac_boost_lib_path=""]
+)
+
 if test "x$want_boost" = "xyes"; then
 if test "x$want_boost" = "xyes"; then
 	boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
 	boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
 	boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
 	boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
@@ -70,7 +87,7 @@ if test "x$want_boost" = "xyes"; then
 		BOOST_LDFLAGS="-L$ac_boost_path/lib"
 		BOOST_LDFLAGS="-L$ac_boost_path/lib"
 		BOOST_CPPFLAGS="-I$ac_boost_path/include"
 		BOOST_CPPFLAGS="-I$ac_boost_path/include"
 	else
 	else
-		for ac_boost_path_tmp in /usr /usr/local /opt ; do
+		for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
 			if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
 			if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
 				BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
 				BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
 				BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
 				BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
@@ -79,6 +96,12 @@ if test "x$want_boost" = "xyes"; then
 		done
 		done
 	fi
 	fi
 
 
+    dnl overwrite ld flags if we have required special directory with
+    dnl --with-boost-libdir parameter
+    if test "$ac_boost_lib_path" != ""; then
+       BOOST_LDFLAGS="-L$ac_boost_lib_path"
+    fi
+
 	CPPFLAGS_SAVED="$CPPFLAGS"
 	CPPFLAGS_SAVED="$CPPFLAGS"
 	CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
 	CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
 	export CPPFLAGS
 	export CPPFLAGS
@@ -111,7 +134,6 @@ if test "x$want_boost" = "xyes"; then
 	if test "x$succeeded" != "xyes"; then
 	if test "x$succeeded" != "xyes"; then
 		_version=0
 		_version=0
 		if test "$ac_boost_path" != ""; then
 		if test "$ac_boost_path" != ""; then
-               		BOOST_LDFLAGS="-L$ac_boost_path/lib"
 			if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
 			if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
 				for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
 				for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
 					_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
 					_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
@@ -124,7 +146,7 @@ if test "x$want_boost" = "xyes"; then
 				done
 				done
 			fi
 			fi
 		else
 		else
-			for ac_boost_path in /usr /usr/local /opt ; do
+			for ac_boost_path in /usr /usr/local /opt /opt/local ; do
 				if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
 				if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
 					for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
 					for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
 						_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
 						_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
@@ -139,7 +161,10 @@ if test "x$want_boost" = "xyes"; then
 
 
 			VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
 			VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
 			BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
 			BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
-			BOOST_LDFLAGS="-L$best_path/lib"
+            if test "$ac_boost_lib_path" = ""
+            then
+               BOOST_LDFLAGS="-L$best_path/lib"
+            fi
 
 
 	    		if test "x$BOOST_ROOT" != "x"; then
 	    		if test "x$BOOST_ROOT" != "x"; then
 				if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
 				if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
@@ -147,7 +172,7 @@ if test "x$want_boost" = "xyes"; then
 					stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
 					stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
 			        	stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
 			        	stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
 					V_CHECK=`expr $stage_version_shorten \>\= $_version`
 					V_CHECK=`expr $stage_version_shorten \>\= $_version`
-				        if test "$V_CHECK" = "1" ; then
+                    if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
 						AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
 						AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
 						BOOST_CPPFLAGS="-I$BOOST_ROOT"
 						BOOST_CPPFLAGS="-I$BOOST_ROOT"
 						BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
 						BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"

+ 11 - 9
aclocal/m4/ax_boost_filesystem.m4

@@ -1,4 +1,6 @@
-##### http://autoconf-archive.cryp.to/ax_boost_filesystem.html
+# ===========================================================================
+#          http://autoconf-archive.cryp.to/ax_boost_filesystem.html
+# ===========================================================================
 #
 #
 # SYNOPSIS
 # SYNOPSIS
 #
 #
@@ -7,8 +9,8 @@
 # DESCRIPTION
 # DESCRIPTION
 #
 #
 #   Test for Filesystem library from the Boost C++ libraries. The macro
 #   Test for Filesystem library from the Boost C++ libraries. The macro
-#   requires a preceding call to AX_BOOST_BASE. Further documentation
-#   is available at <http://randspringer.de/boost/index.html>.
+#   requires a preceding call to AX_BOOST_BASE. Further documentation is
+#   available at <http://randspringer.de/boost/index.html>.
 #
 #
 #   This macro calls:
 #   This macro calls:
 #
 #
@@ -20,16 +22,16 @@
 #
 #
 # LAST MODIFICATION
 # LAST MODIFICATION
 #
 #
-#   2007-07-26
+#   2008-04-12
 #
 #
 # COPYLEFT
 # COPYLEFT
 #
 #
-#   Copyright (c) 2007 Thomas Porschberg <[email protected]>
-#   Copyright (c) 2007 Michael Tindal
+#   Copyright (c) 2008 Thomas Porschberg <[email protected]>
+#   Copyright (c) 2008 Michael Tindal
 #
 #
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
 
 
 AC_DEFUN([AX_BOOST_FILESYSTEM],
 AC_DEFUN([AX_BOOST_FILESYSTEM],
 [
 [

+ 1 - 1
client/Makefile.am

@@ -1,6 +1,6 @@
 bin_PROGRAMS = vcmiclient
 bin_PROGRAMS = vcmiclient
 
 
-vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
+vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 vcmiclient_LDFLAGS = -L$(top_builddir)/lib
 vcmiclient_LDFLAGS = -L$(top_builddir)/lib
 vcmiclient_SOURCES =  \
 vcmiclient_SOURCES =  \
 	../AI_Base.h \
 	../AI_Base.h \

+ 2 - 2
lib/Makefile.am

@@ -1,5 +1,5 @@
-noinst_LIBRARIES = libvcmi.a
-libvcmi_a_SOURCES = \
+pkglib_LTLIBRARIES = libvcmi.la
+libvcmi_la_SOURCES = \
 	../CConsoleHandler.cpp \
 	../CConsoleHandler.cpp \
 	../CConsoleHandler.h \
 	../CConsoleHandler.h \
 	../CGameState.cpp \
 	../CGameState.cpp \

+ 1 - 1
server/Makefile.am

@@ -1,6 +1,6 @@
 bin_PROGRAMS = vcmiserver
 bin_PROGRAMS = vcmiserver
 
 
-vcmiserver_LDADD = $(top_builddir)/lib/libvcmi.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
+vcmiserver_LDADD = $(top_builddir)/lib/libvcmi.la $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 vcmiserver_LDFLAGS = -L$(top_builddir)/lib
 vcmiserver_LDFLAGS = -L$(top_builddir)/lib
 vcmiserver_SOURCES = \
 vcmiserver_SOURCES = \
 	./CGameHandler.cpp \
 	./CGameHandler.cpp \