Author: wyoung
Date: Thu May 28 23:06:47 2009
New Revision: 2517

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2517&view=rev
Log:
- Improved mysql_loc.m4 and mysql++.m4 macros to be more useful in a 
  third-party project.  No net effect on MySQL++ itself.
- Minor updates to autoconf build system to reflect these changes.  Just
  matters of naming.

Modified:
    trunk/config/mysql++.m4
    trunk/config/mysql_loc.m4
    trunk/configure.ac
    trunk/mysql++.bkl

Modified: trunk/config/mysql++.m4
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/config/mysql%2B%2B.m4?rev=2517&r1=2516&r2=2517&view=diff
==============================================================================
--- trunk/config/mysql++.m4 (original)
+++ trunk/config/mysql++.m4 Thu May 28 23:06:47 2009
@@ -63,33 +63,33 @@
        #
        # Look for MySQL++ library
        #
-       MYSQLPP_libdir=
+       MYSQLPP_LIB_DIR=
        for dir in $MYSQLPP_lib_check
        do
                if test -d "$dir" && \
                        ( test -f "$dir/libmysqlpp.so" ||
                          test -f "$dir/libmysqlpp.a" )
                then
-                       MYSQLPP_libdir=$dir
+                       MYSQLPP_LIB_DIR=$dir
                        break
                fi
        done
 
-       if test -z "$MYSQLPP_libdir"
+       if test -z "$MYSQLPP_LIB_DIR"
        then
                AC_MSG_ERROR([Didn't find the MySQL++ library dir in 
'$MYSQLPP_lib_check'])
        fi
 
-       case "$MYSQLPP_libdir" in
+       case "$MYSQLPP_LIB_DIR" in
                /* ) ;;
-               * )  AC_MSG_ERROR([The MySQL++ library directory 
($MYSQLPP_libdir) must be an absolute path.]) ;;
+               * )  AC_MSG_ERROR([The MySQL++ library directory 
($MYSQLPP_LIB_DIR) must be an absolute path.]) ;;
        esac
 
-       AC_MSG_RESULT([lib in $MYSQLPP_libdir])
+       AC_MSG_RESULT([lib in $MYSQLPP_LIB_DIR])
 
-       case "$MYSQLPP_libdir" in
+       case "$MYSQLPP_LIB_DIR" in
          /usr/lib) ;;
-         *) LDFLAGS="$LDFLAGS -L${MYSQLPP_libdir}" ;;
+         *) LDFLAGS="$LDFLAGS -L${MYSQLPP_LIB_DIR}" ;;
        esac
 
 
@@ -97,29 +97,29 @@
        # Look for MySQL++ headers
        #
        AC_MSG_CHECKING([for MySQL++ header directory])
-       MYSQLPP_incdir=
+       MYSQLPP_INC_DIR=
        for dir in $MYSQLPP_inc_check
        do
                if test -d "$dir" && test -f "$dir/mysql++.h"
                then
-                       MYSQLPP_incdir=$dir
+                       MYSQLPP_INC_DIR=$dir
                        break
                fi
        done
 
-       if test -z "$MYSQLPP_incdir"
+       if test -z "$MYSQLPP_INC_DIR"
        then
                AC_MSG_ERROR([Didn't find the MySQL++ header dir in 
'$MYSQLPP_inc_check'])
        fi
 
-       case "$MYSQLPP_incdir" in
+       case "$MYSQLPP_INC_DIR" in
                /* ) ;;
-               * )  AC_MSG_ERROR([The MySQL++ header directory 
($MYSQLPP_incdir) must be an absolute path.]) ;;
+               * )  AC_MSG_ERROR([The MySQL++ header directory 
($MYSQLPP_INC_DIR) must be an absolute path.]) ;;
        esac
 
-       AC_MSG_RESULT([$MYSQLPP_incdir])
+       AC_MSG_RESULT([$MYSQLPP_INC_DIR])
 
-       CPPFLAGS="$CPPFLAGS -I${MYSQLPP_incdir}"
+       CPPFLAGS="$CPPFLAGS -I${MYSQLPP_INC_DIR} -I${MYSQL_C_INC_DIR}"
 
        AC_MSG_CHECKING([that we can build MySQL++ programs])
        AC_COMPILE_IFELSE(
@@ -127,5 +127,8 @@
                [mysqlpp::Connection c(false)])],
                ac_cv_mysqlpp_devel=yes,
                AC_MSG_ERROR(no))
+
+       AC_SUBST(MYSQLPP_INC_DIR)
+       AC_SUBST(MYSQLPP_LIB_DIR)
 ])]) dnl End MYSQLPP_DEVEL
 

Modified: trunk/config/mysql_loc.m4
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/config/mysql_loc.m4?rev=2517&r1=2516&r2=2517&view=diff
==============================================================================
--- trunk/config/mysql_loc.m4 (original)
+++ trunk/config/mysql_loc.m4 Thu May 28 23:06:47 2009
@@ -1,19 +1,18 @@
-dnl @synopsis MYSQL_API_LOCATION
+dnl @synopsis MYSQL_C_API_LOCATION
 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                    to guess subdirectory names for each by tacking common
+dnl         suffixes on like /lib and /include.
+dnl            --with-mysql-lib: Same as --with-mysql, but for library only.
+dnl            --with-mysql-include: Same as --with-mysql, but for headers 
only.
 dnl
-dnl @version 1.3, 2008/08/06
+dnl @version 1.4, 2009/05/28
 dnl @author Warren Young <[email protected]>
-AC_DEFUN([MYSQL_API_LOCATION],
+AC_DEFUN([MYSQL_C_API_LOCATION],
 [
        #
        # Set up configure script macros
@@ -36,41 +35,46 @@
        #
        if test "x$acx_pthread_ok" = xyes
        then
-               MYSQL_C_LIB=mysqlclient_r
+               MYSQL_C_LIB_NAME=mysqlclient_r
        else
-               MYSQL_C_LIB=mysqlclient
+               MYSQL_C_LIB_NAME=mysqlclient
        fi
 
        #
        # Look for MySQL C API library
        #
        AC_MSG_CHECKING([for MySQL library directory])
-       MYSQL_libdir=
+       MYSQL_C_LIB_DIR=
        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")
+                       (test -f "$m/lib$MYSQL_C_LIB_NAME.so" || \
+                        test -f "$m/lib$MYSQL_C_LIB_NAME.a")
                then
-                       MYSQL_libdir=$m
+                       MYSQL_C_LIB_DIR=$m
                        break
                fi
        done
 
-       if test -z "$MYSQL_libdir"
+       if test -z "$MYSQL_C_LIB_DIR"
        then
-               AC_MSG_ERROR([Didn't find $MYSQL_C_LIB library in 
'$MYSQL_lib_check'])
+               AC_MSG_ERROR([Didn't find $MYSQL_C_LIB_NAME library in 
'$MYSQL_lib_check'])
        fi
 
-       case "$MYSQL_libdir" in
+       case "$MYSQL_C_LIB_DIR" in
                /* ) ;;
-               * )  AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) 
must be an absolute path.]) ;;
+               * )  AC_MSG_ERROR([The MySQL library directory 
($MYSQL_C_LIB_DIR) must be an absolute path.]) ;;
        esac
 
-       AC_MSG_RESULT([$MYSQL_libdir])
+       AC_MSG_RESULT([$MYSQL_C_LIB_DIR])
 
-       case "$MYSQL_libdir" in
-         /usr/lib) ;;
-         *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;;
+       case "$MYSQL_C_LIB_DIR" in
+         /usr/lib)
+               MYSQL_C_LIB_DIR=
+               ;;
+         *)
+               LDFLAGS="$LDFLAGS -L${MYSQL_C_LIB_DIR}"
+               ;;
        esac
 
 
@@ -78,33 +82,33 @@
        # Look for MySQL C API headers
        #
        AC_MSG_CHECKING([for MySQL include directory])
-       MYSQL_incdir=
+       MYSQL_C_INC_DIR=
        for m in $MYSQL_inc_check
        do
                if test -d "$m" && test -f "$m/mysql.h"
                then
-                       MYSQL_incdir=$m
+                       MYSQL_C_INC_DIR=$m
                        break
                fi
        done
 
-       if test -z "$MYSQL_incdir"
+       if test -z "$MYSQL_C_INC_DIR"
        then
                AC_MSG_ERROR([Didn't find the MySQL include dir in 
'$MYSQL_inc_check'])
        fi
 
-       case "$MYSQL_incdir" in
+       case "$MYSQL_C_INC_DIR" in
                /* ) ;;
-               * )  AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) 
must be an absolute path.]) ;;
+               * )  AC_MSG_ERROR([The MySQL include directory 
($MYSQL_C_INC_DIR) must be an absolute path.]) ;;
        esac
 
-       AC_MSG_RESULT([$MYSQL_incdir])
+       AC_MSG_RESULT([$MYSQL_C_INC_DIR])
 
-       CPPFLAGS="$CPPFLAGS -I${MYSQL_incdir}"
+       CPPFLAGS="$CPPFLAGS -I${MYSQL_C_INC_DIR}"
 
     AC_MSG_CHECKING([if we can link to MySQL C API library directly])
        save_LIBS=$LIBS
-       LIBS="$LIBS -l$MYSQL_C_LIB $MYSQLPP_EXTRA_LIBS"
+       LIBS="$LIBS -l$MYSQL_C_LIB_NAME $MYSQLPP_EXTRA_LIBS"
        AC_TRY_LINK(
         [ #include <mysql.h> ],
         [ mysql_store_result(0); ],
@@ -115,7 +119,7 @@
               [ AC_MSG_ERROR([zlib not found]) ]))
           AC_MSG_CHECKING([whether adding -lz will let MySQL C API link 
succeed])
           MYSQLPP_EXTRA_LIBS="$MYSQLPP_EXTRA_LIBS -lz"
-          LIBS="$save_LIBS -l$MYSQL_C_LIB $MYSQLPP_EXTRA_LIBS"
+          LIBS="$save_LIBS -l$MYSQL_C_LIB_NAME $MYSQLPP_EXTRA_LIBS"
           AC_TRY_LINK(
               [ #include <mysql.h> ],
               [ mysql_store_result(0); ],
@@ -125,7 +129,10 @@
               ]
           )
         ])
-       AC_SUBST(MYSQL_C_LIB)
        LIBS=$save_LIBS
-]) dnl MYSQL_API_LOCATION
 
+       AC_SUBST(MYSQL_C_INC_DIR)
+       AC_SUBST(MYSQL_C_LIB_DIR)
+       AC_SUBST(MYSQL_C_LIB_NAME)
+]) dnl MYSQL_C_API_LOCATION
+

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/configure.ac?rev=2517&r1=2516&r2=2517&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu May 28 23:06:47 2009
@@ -64,7 +64,7 @@
 # Checks for libraries and local system features
 LIB_MATH
 LIB_SOCKET_NSL
-MYSQL_API_LOCATION
+MYSQL_C_API_LOCATION
 MYSQL_WITH_SSL
 AX_C_LOCALTIME_R
 AC_CHECK_LIB(intl, main)

Modified: trunk/mysql++.bkl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/mysql%2B%2B.bkl?rev=2517&r1=2516&r2=2517&view=diff
==============================================================================
--- trunk/mysql++.bkl (original)
+++ trunk/mysql++.bkl Thu May 28 23:06:47 2009
@@ -121,7 +121,7 @@
 
         <cxxflags>@PTHREAD_CFLAGS@</cxxflags>
         <include>.</include>
-        <ldflags>-...@mysql_c_lib@ @PTHREAD_LIBS@ 
@MYSQLPP_EXTRA_LIBS@</ldflags>
+        <ldflags>-...@mysql_c_lib_name@ @PTHREAD_LIBS@ 
@MYSQLPP_EXTRA_LIBS@</ldflags>
       </if>
     </dll>
 
@@ -157,7 +157,7 @@
 
     <if cond="FORMAT=='autoconf'">
       <cxxflags>@PTHREAD_CFLAGS@</cxxflags>
-      <ldflags>-...@mysql_c_lib@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@</ldflags>
+      <ldflags>-...@mysql_c_lib_name@ @PTHREAD_LIBS@ 
@MYSQLPP_EXTRA_LIBS@</ldflags>
       <warnings>max</warnings>
       <sys-lib>mysqlpp</sys-lib>
     </if>


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to