Date: Wednesday, November 15, 2006 @ 14:50:54
  Author: csaba
    Path: /cvsroot/carob/libmysequoia

Modified: configure.ac (1.15 -> 1.16)

added --with-mysql-headers=DIR option to ./configure. Fixes LMS-32


--------------+
 configure.ac |   53 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 41 insertions(+), 12 deletions(-)


Index: libmysequoia/configure.ac
diff -u libmysequoia/configure.ac:1.15 libmysequoia/configure.ac:1.16
--- libmysequoia/configure.ac:1.15      Fri Nov 10 15:49:46 2006
+++ libmysequoia/configure.ac   Wed Nov 15 14:50:54 2006
@@ -3,10 +3,6 @@
 AM_INIT_AUTOMAKE(libmysequoia, 0.9.4)
 AM_CONFIG_HEADER(include/config.h)
 
-# See the libtool docs for information on how to do shared lib versions.
-SHARED_LIB_VERSION=15:0:0
-AC_SUBST(SHARED_LIB_VERSION)
-
 # Checks for programs.
 AC_PROG_INSTALL
 AC_PROG_CXX
@@ -16,14 +12,6 @@
 
 AC_LANG_CPLUSPLUS
 
-# Check for mysql 
-AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
-if test "x$MYSQL_CONFIG" = "xno"; then
-  AC_MSG_ERROR([You need to install the MySQL development package])
-fi
-MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
-AC_SUBST(MYSQL_CFLAGS)
-
 # Check for cppunit
 AC_ARG_ENABLE(cppunit, AC_HELP_STRING([--enable-cppunit], [enable test 
excution with cppunit]))
 
@@ -95,17 +83,58 @@
 AC_SUBST(DOXYGEN)
 
 # Check for Carob headers and library
+AC_MSG_CHECKING([for Carob])
 CXXFLAGS="$CXXFLAGS -I/usr/include/carob"
 LIBS="$LIBS -lcarob"
 AC_TRY_LINK([#include <ConnectionParameters.hpp>],
                     [using namespace CarobNS; ControllerInfo ci; ],
                     ,AC_MSG_ERROR([Carob header files or library not found. 
Please install a carob package or use CXXFLAGS/LDFLAGS]))
+AC_MSG_RESULT([yes])
 
 # Checks for libraries.
 AC_CHECK_LIB([dl], [dlopen],, AC_MSG_ERROR([dl library not found. Please 
install it.]))
 AC_CHECK_LIB([log4cxx], [main], LOG4CXX_LDADD="-llog4cxx", 
AC_MSG_ERROR([log4cxx library not found. Please install it.]))
 AC_SUBST(LOG4CXX_LDADD)
 
+# Check for mysql headers
+AC_MSG_CHECKING([for MySQL headers])
+mysql_header_dir="/usr/include/mysql"
+AC_ARG_WITH(mysql-headers,  
+  [  --with-mysql-headers=DIR   MySQL header files directory.],
+  [
+    mysql_header_dir="$withval"
+  ]
+)
+
+if test -f "$mysql_header_dir/mysql.h"
+then
+  MYSQL_CFLAGS="-I$mysql_header_dir"
+else
+  AC_MSG_ERROR([You need to install the MySQL development package, or use 
--with-mysql-headers=DIR if the headers are in an unusual place.])
+fi
+AC_MSG_RESULT([$mysql_header_dir])
+AC_SUBST(MYSQL_CFLAGS)
+
+AC_MSG_CHECKING([for MySQL version])
+mysql_version=`grep MYSQL_VERSION_ID $mysql_header_dir/mysql_version.h | $SED 
-e 's/.*\(\<@<:@0-9@:>@*\>\).*/\1/'`
+if test $mysql_version -ge 50000
+then
+  major_version=15
+elif test $mysql_version -ge 40100
+then 
+  major_version=14
+elif test $mysql_version -ge 40000
+then
+  major_version=12
+else
+  AC_MSG_ERROR([Unknow MySQL version.])
+fi
+AC_MSG_RESULT([$mysql_version])
+
+# See the libtool docs for information on how to do shared lib versions.
+SHARED_LIB_VERSION=$major_version:0:0
+AC_SUBST(SHARED_LIB_VERSION)
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdlib.h string.h])

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to