From: <den...@us...> - 2010-01-16 22:47:22
|
Revision: 94 http://stdair.svn.sourceforge.net/stdair/?rev=94&view=rev Author: denis_arnaud Date: 2010-01-16 22:47:13 +0000 (Sat, 16 Jan 2010) Log Message: ----------- [Conf] Improved the M4 macro files for MySQL, SOCI, Boost, MPICH2 and OpenMPI. Modified Paths: -------------- trunk/stdair/config/ax_boost.m4 trunk/stdair/config/ax_mysql.m4 trunk/stdair/config/mpich2.m4 trunk/stdair/config/openmpi.m4 trunk/stdair/config/soci.m4 Removed Paths: ------------- trunk/stdair/config/mysql.m4 Modified: trunk/stdair/config/ax_boost.m4 =================================================================== --- trunk/stdair/config/ax_boost.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/ax_boost.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -69,6 +69,7 @@ # AC_CANONICAL_BUILD BOOST_MDW_VERSION="1-33-1" BOOSTLIB_MDW_VERSION="1_33_1" +BOOST_version_header="boost/version.hpp" if test "x$want_boost" = "xyes"; then boost_lib_version_req=ifelse([$1], ,1.20.0,$1) @@ -87,14 +88,18 @@ dnl this location is chosen if boost libraries are installed dnl with the --layout=system option dnl or if you install boost with RPM - if test -d /lib64; then + if test -d /lib64 + then BOOST_LIBDIRTYPE="lib64" else BOOST_LIBDIRTYPE="lib" fi - if test "$ac_boost_path" != ""; then - if test "$BOOST_LIBDIRTYPE" == "lib64"; then - if test -d "$ac_boost_path/$BOOST_LIBDIRTYPE" && test -r "$ac_boost_path/$BOOST_LIBDIRTYPE"; then + if test "$ac_boost_path" != "" + then + if test "$BOOST_LIBDIRTYPE" == "lib64" + then + if test -d "$ac_boost_path/$BOOST_LIBDIRTYPE" && test -r "$ac_boost_path/$BOOST_LIBDIRTYPE" + then BOOST_LIBS="-L$ac_boost_path/$BOOST_LIBDIRTYPE" else BOOST_LIBS="-L$ac_boost_path/lib" @@ -103,19 +108,28 @@ BOOST_LIBS="-L$ac_boost_path/lib" fi BOOST_CFLAGS="-I$ac_boost_path/include" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path/include/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` else - for ac_boost_path_tmp in /usr /usr/local /opt /nastools/boost ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + for ac_boost_path_tmp in /usr /usr/local /opt /nastools/boost + do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost" + then BOOST_LIBS="-L$ac_boost_path_tmp/$BOOST_LIBDIRTYPE" BOOST_CFLAGS="-I$ac_boost_path_tmp/include" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path_tmp/include/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` break; fi - if test -d "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" && test -r "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost"; then + if test -d "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" && test -r "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" + then BOOST_LIBS="-L$ac_boost_path_tmp/$BOOST_LIBDIRTYPE" BOOST_CFLAGS="-I$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` dnl Hack for wrongly installed Boost libraries (AMD64 libraries installed in boost/lib directory) - if test -d "$ac_boost_path_tmp/lib" && test -r "$ac_boost_path_tmp/lib" && test ! -d "$ac_boost_path_tmp/lib64"; then + if test -d "$ac_boost_path_tmp/lib" \ + && test -r "$ac_boost_path_tmp/lib" \ + && test ! -d "$ac_boost_path_tmp/lib64" + then BOOST_LIBS="-L$ac_boost_path_tmp/lib" echo "Hack: $BOOST_LIBS" fi @@ -584,10 +598,12 @@ # than MPICH2 # CPPFLAGS_ORIG="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPICH2_CFLAGS}" + CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPIGEN_CFLAGS}" +# CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPICH2_CFLAGS}" # CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${OPENMPI_CFLAGS}" LDFLAGS_ORIG="${LDFLAGS}" - LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPICH2_LIBS}" + LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPIGEN_LIBS}" +# LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPICH2_LIBS}" # LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${OPENMPI_LIBS}" # @@ -606,7 +622,7 @@ AC_LANG_RESTORE ]) - BOOST_PYTHON_LIB="-lboost_python" + BOOST_PYTHON_LIB="-lboost_python ${PYTHON_LIBS} ${PYTHON_ADD_LIBS}" AC_SUBST(BOOST_PYTHON_LIB) # @@ -637,7 +653,7 @@ if test "x$link_mpi" = "xno"; then AC_MSG_NOTICE(Could not link against $ax_lib !) else - BOOST_MPI_LIB="${BOOST_MPI_LIB} ${BOOST_SERIALIZATION_LIB}" + BOOST_MPI_LIB="${BOOST_MPI_LIB} ${BOOST_SERIALIZATION_LIB} ${MPIGEN_LIBS}" fi fi @@ -673,6 +689,7 @@ BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_SERIALIZATION_LIB}" BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_PYTHON_LIB}" BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_MPI_LIB}" + BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${MPIGEN_LIBS}" fi fi Modified: trunk/stdair/config/ax_mysql.m4 =================================================================== --- trunk/stdair/config/ax_mysql.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/ax_mysql.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -63,7 +63,7 @@ * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; esac - AC_MSG_RESULT([$MYSQL_bindir]) + AC_MSG_RESULT([$MYSQL_CONFIG]) # AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) @@ -79,7 +79,7 @@ MYSQL_LIB_OPTION=libs fi - if test "x${MYSQL_CONFIG+set}" != xset + if test "x${MYSQL_CONFIG}1" = "x1" then MYSQL_VERSION=`${MYSQL_CONFIG} --version` MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` @@ -144,6 +144,7 @@ AC_MSG_RESULT([$MYSQL_incdir]) + MYSQL_VERSION=`grep "define MYSQL_SERVER_VERSION" $MYSQL_incdir/mysql_version.h | cut -d\" -f2` MYSQL_CFLAGS="-I${MYSQL_incdir}" MYSQL_LIBS="-L${MYSQL_libdir} -l${MYSQL_C_LIB}" fi Modified: trunk/stdair/config/mpich2.m4 =================================================================== --- trunk/stdair/config/mpich2.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/mpich2.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -202,6 +202,10 @@ # # Make the changes permanent # + HAVE_MPICH2=1 + MPIGEN_VERSION=${MPICH2_VERSION} + MPIGEN_CFLAGS=${MPICH2_CFLAGS} + MPIGEN_LIBS=${MPICH2_LIBS} AC_SUBST(MPICH2_VERSION) AC_SUBST(MPICH2_CFLAGS) AC_SUBST(MPICH2_LIBS) Deleted: trunk/stdair/config/mysql.m4 =================================================================== --- trunk/stdair/config/mysql.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/mysql.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -1,163 +0,0 @@ -dnl @synopsis AX_MYSQL -dnl -dnl This macro tries to find MySQL C API header and library locations. -dnl -dnl We define the following configure script flags: -dnl -dnl --with-mysql: Give prefix for both library and headers, and try -dnl to guess subdirectory names for each. (e.g. Tack /lib and -dnl /include onto given dir name, and other common schemes.) -dnl --with-mysql-lib: Similar to --with-mysql, but for library only. -dnl --with-mysql-include: Similar to --with-mysql, but for headers -dnl only. -dnl -dnl @version 1.2, 2007/02/20 -dnl @author Warren Young <my...@et...> - -AC_DEFUN([AX_MYSQL], -[ - # - # Set up configure script macros - # - AC_ARG_WITH(mysql, - [ --with-mysql=<path> root directory path of MySQL installation], - [MYSQL_lib_check="$with_mysql/lib64/mysql $with_mysql/lib/mysql $with_mysql/lib64 $with_mysql/lib" - MYSQL_inc_check="$with_mysql/include $with_mysql/include/mysql" - MYSQL_bin_check="$with_mysql/bin"], - [MYSQL_lib_check="/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /opt/mysql/lib /opt/mysql/lib/mysql" - MYSQL_inc_check="/usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /opt/mysql/include/mysql" - MYSQL_bin_check="/usr/bin /usr/local/bin /usr/local/mysql/bin"]) - - AC_ARG_WITH(mysql-lib, - [ --with-mysql-lib=<path> directory path of MySQL library installation], - [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib64 $with_mysql_lib/lib $with_mysql_lib/lib64/mysql $with_mysql_lib/lib/mysql"]) - - AC_ARG_WITH(mysql-include, - [ --with-mysql-include=<path> directory path of MySQL header installation], - [MYSQL_inc_check="$with_mysql_include $with_mysql_include/include $with_mysql_include/include/mysql"]) - - - # - # Look for MySQL Configuration Script - # - AC_MSG_CHECKING([for MySQL configuration script]) - MYSQL_CONFIG= - MYSQL_bindir= - for m in $MYSQL_bin_check - do - if test -d "$m" && test -f "$m/mysql_config" - then - MYSQL_CONFIG=$m/mysql_config - MYSQL_bindir=$m - break - fi - done - - if test -z "$MYSQL_bindir" - then - AC_MSG_ERROR([Didn't find $MYSQL_CONFIG binary in '$MYSQL_bin_check']) - fi - - case "$MYSQL_bindir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_bindir]) - -# AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) - - # - # Decide which C API library to use, based on thread support - # - if test "x$acx_pthread_ok" = xyes - then - MYSQL_C_LIB=mysqlclient_r - MYSQL_LIB_OPTION=libs_r - else - MYSQL_C_LIB=mysqlclient - MYSQL_LIB_OPTION=libs - fi - - if test "x${MYSQL_CONFIG+set}" != xset - then - MYSQL_VERSION=`${MYSQL_CONFIG} --version` - MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` - MYSQL_LIBS=`${MYSQL_CONFIG} --${MYSQL_LIB_OPTION}` - else - # - # Look for MySQL C API library - # - AC_MSG_CHECKING([for MySQL library directory]) - MYSQL_libdir= - for m in $MYSQL_lib_check - do - if test -d "$m" && \ - (test -f "$m/lib$MYSQL_C_LIB.so" \ - || test -f "$m/lib$MYSQL_C_LIB.a") - then - MYSQL_libdir=$m - break - fi - done - - if test -z "$MYSQL_libdir" - then - AC_MSG_ERROR([Didn't find $MYSQL_C_LIB library in '$MYSQL_lib_check']) - fi - - case "$MYSQL_libdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_libdir]) - -# case "$MYSQL_libdir" in -# /usr/lib) ;; -# *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;; -# esac - - # - # Look for MySQL C API headers - # - AC_MSG_CHECKING([for MySQL include directory]) - MYSQL_incdir= - for m in $MYSQL_inc_check - do - if test -d "$m" && test -f "$m/mysql.h" - then - MYSQL_incdir=$m - break - fi - done - - if test -z "$MYSQL_incdir" - then - AC_MSG_ERROR([Didn't find the MySQL include dir in '$MYSQL_inc_check']) - fi - - case "$MYSQL_incdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_incdir]) - - MYSQL_CFLAGS="-I${MYSQL_incdir}" - MYSQL_LIBS="-L${MYSQL_libdir} -l${MYSQL_C_LIB}" - fi - - AC_SUBST(MYSQL_VERSION) - AC_SUBST(MYSQL_CFLAGS) - AC_SUBST(MYSQL_LIBS) - - save_LIBS="$LIBS" - LIBS="$LIBS $MYSQL_LIBS" - AC_CHECK_LIB($MYSQL_C_LIB, mysql_store_result, - [], - [AC_MSG_ERROR([Could not find working MySQL client library!])] - ) - AC_SUBST(MYSQL_C_LIB) - LIBS="$save_LIBS" -]) dnl AX_MYSQL Modified: trunk/stdair/config/openmpi.m4 =================================================================== --- trunk/stdair/config/openmpi.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/openmpi.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -201,6 +201,10 @@ # # Make the changes permanent # + HAVE_OPENMPI=1 + MPIGEN_VERSION=${OPENMPI_VERSION} + MPIGEN_CFLAGS=${OPENMPI_CFLAGS} + MPIGEN_LIBS=${OPENMPI_LIBS} AC_SUBST(OPENMPI_VERSION) AC_SUBST(OPENMPI_CFLAGS) AC_SUBST(OPENMPI_LIBS) Modified: trunk/stdair/config/soci.m4 =================================================================== --- trunk/stdair/config/soci.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/soci.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -22,9 +22,11 @@ AC_ARG_WITH(soci, [ --with-soci=<path> root directory path of Soci installation], [SOCI_lib_check="$with_soci/lib64/soci $with_soci/lib/soci $with_soci/lib64 $with_soci/lib" - SOCI_inc_check="$with_soci/include $with_soci/include/soci"], + SOCI_inc_check="$with_soci/include $with_soci/include/soci" + SOCI_bin_check="$with_soci/bin"], [SOCI_lib_check="/usr/lib64 /usr/lib /usr/lib64/soci /usr/lib/soci /usr/local/lib64 /usr/local/lib /usr/local/lib/soci /usr/local/soci/lib /usr/local/soci/lib/soci /opt/soci/lib /opt/soci/lib/soci" - SOCI_inc_check="/usr/include /usr/include/soci /usr/local/include/soci /usr/local/soci/include /usr/local/soci/include/soci /opt/soci/include /opt/soci/include/soci"]) + SOCI_inc_check="/usr/include /usr/include/soci /usr/local/include/soci /usr/local/soci/include /usr/local/soci/include/soci /opt/soci/include /opt/soci/include/soci" + SOCI_bin_check="/usr/bin /usr/local/bin /usr/local/soci/bin /opt/bin /opt/soci/bin /opt/bin/soci"]) AC_ARG_WITH(soci-lib, [ --with-soci-lib=<path> directory path of Soci library installation], @@ -34,6 +36,41 @@ [ --with-soci-include=<path> directory path of Soci header installation], [SOCI_inc_check="$with_soci_include $with_soci_include/include $with_soci_include/include/soci"]) + # + # Look for Soci Configuration Script + # + AC_MSG_CHECKING([for Soci configuration script]) + SOCI_CONFIG= + SOCI_bindir= + for m in $SOCI_bin_check + do + if test -d "$m" && test -f "$m/soci-config" + then + SOCI_CONFIG=$m/soci-config + SOCI_bindir=$m + break + fi + done + +# if test -z "$SOCI_bindir" +# then +# AC_MSG_ERROR([Didn't find $SOCI_CONFIG binary in '$SOCI_bin_check']) +# fi + +# case "$SOCI_bindir" in +# /* ) ;; +# * ) AC_MSG_ERROR([The Soci binary directory ($SOCI_bindir) must be an absolute path.]) ;; +# esac + + AC_MSG_RESULT([$SOCI_CONFIG]) + +# AC_PATH_PROG(SOCI_CONFIG, soci-config, $SOCI_bindir) + + if test "x${SOCI_CONFIG}1" != "x1" + then + SOCI_VERSION=`${SOCI_CONFIG} --version` + fi + # SOCI library SOCI_CORE_LIB=soci_core SOCI_MYSQL_LIB=soci_mysql This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |