]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Do better checking for the MySQL 64 bit libraries looking for both
authorKern Sibbald <kern@sibbald.com>
Mon, 14 May 2007 16:35:40 +0000 (16:35 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 14 May 2007 16:35:40 +0000 (16:35 +0000)
     .a and .so libraries.
kes  Add a kludge for Ubuntu's non-standard locations for MySQL -- allow
     /usr/include/mysql/mysql.h AND /usr/lib/... rather than /usr/lib/mysql/...

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4783 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/bacula-macros/db.m4
bacula/configure
bacula/technotes-2.1

index fa3e80fe5b0f13b3abf70a68b7f3aa32c5bdc343..b22810ea939d9f97efd843cdabb0ea0a832efe66 100644 (file)
@@ -12,7 +12,8 @@ AC_ARG_WITH(mysql,
         if test "$withval" = "yes"; then
            if test -f /usr/local/mysql/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/local/mysql/include/mysql
-                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
                    else
                            MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
@@ -20,15 +21,20 @@ AC_ARG_WITH(mysql,
                    MYSQL_BINDIR=/usr/local/mysql/bin
            elif test -f /usr/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/include/mysql
-                   if test -f /usr/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/lib64/mysql/libmysqlclient_r.so; then  
                            MYSQL_LIBDIR=/usr/lib64/mysql
-                   else
+                   elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                          -o -f /usr/lib/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/lib/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/lib
                    fi
                    MYSQL_BINDIR=/usr/bin
            elif test -f /usr/include/mysql.h; then
                    MYSQL_INCDIR=/usr/include
-                   if test -f /usr/lib64/libmysqlclient_r.a; then
+                   if test -f /usr/lib64/libmysqlclient_r.a \
+                        -o -f /usr/lib64/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/lib64
                    else
                            MYSQL_LIBDIR=/usr/lib
@@ -36,7 +42,8 @@ AC_ARG_WITH(mysql,
                    MYSQL_BINDIR=/usr/bin
            elif test -f /usr/local/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/local/include/mysql
-                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/lib64/mysql
                    else
                            MYSQL_LIBDIR=/usr/local/lib/mysql
@@ -44,7 +51,8 @@ AC_ARG_WITH(mysql,
                    MYSQL_BINDIR=/usr/local/bin
            elif test -f /usr/local/include/mysql.h; then
                    MYSQL_INCDIR=/usr/local/include
-                   if test -f /usr/local/lib64/libmysqlclient_r.a; then
+                   if test -f /usr/local/lib64/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/lib64
                    else
                            MYSQL_LIBDIR=/usr/local/lib
@@ -57,7 +65,8 @@ AC_ARG_WITH(mysql,
         else
            if test -f $withval/include/mysql/mysql.h; then
               MYSQL_INCDIR=$withval/include/mysql
-              if test -f $withval/lib64/mysql/libmysqlclient_r.a; then
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                   -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
                  MYSQL_LIBDIR=$withval/lib64/mysql
               else
                  MYSQL_LIBDIR=$withval/lib/mysql
@@ -69,7 +78,8 @@ AC_ARG_WITH(mysql,
               MYSQL_BINDIR=$withval/bin
            elif test -f $withval/include/mysql.h; then
               MYSQL_INCDIR=$withval/include
-              if test -f "$withval/lib64/libmysqlclient_r.a"; then
+              if test -f $withval/lib64/libmysqlclient_r.a \
+                   -o -f $withval/lib64/libmysqlclient_r.so; then
                  MYSQL_LIBDIR=$withval/lib64
               else
                  MYSQL_LIBDIR=$withval/lib
@@ -81,11 +91,8 @@ AC_ARG_WITH(mysql,
            fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
-    if test -f "$MYSQL_LIBDIR/libmysqlclient_r.a"; then
-       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
-       AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
-    fi
-    if test -f "$MYSQL_LIBDIR/libmysqlclient_r.so"; then
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
+         -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
        SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
        AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
     fi
index 7251a176d107759b09822d5e7c93bdc0500c72fa..57c3e9b210e4e8c63fb8d3e74a504e4c899257c4 100755 (executable)
@@ -19001,7 +19001,8 @@ if test "${with_mysql+set}" = set; then
         if test "$withval" = "yes"; then
            if test -f /usr/local/mysql/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/local/mysql/include/mysql
-                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
                    else
                            MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
@@ -19009,15 +19010,20 @@ if test "${with_mysql+set}" = set; then
                    MYSQL_BINDIR=/usr/local/mysql/bin
            elif test -f /usr/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/include/mysql
-                   if test -f /usr/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/lib64/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/lib64/mysql
-                   else
+                   elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                          -o -f /usr/lib/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/lib/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/lib
                    fi
                    MYSQL_BINDIR=/usr/bin
            elif test -f /usr/include/mysql.h; then
                    MYSQL_INCDIR=/usr/include
-                   if test -f /usr/lib64/libmysqlclient_r.a; then
+                   if test -f /usr/lib64/libmysqlclient_r.a \
+                        -o -f /usr/lib64/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/lib64
                    else
                            MYSQL_LIBDIR=/usr/lib
@@ -19025,7 +19031,8 @@ if test "${with_mysql+set}" = set; then
                    MYSQL_BINDIR=/usr/bin
            elif test -f /usr/local/include/mysql/mysql.h; then
                    MYSQL_INCDIR=/usr/local/include/mysql
-                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a; then
+                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/lib64/mysql
                    else
                            MYSQL_LIBDIR=/usr/local/lib/mysql
@@ -19033,7 +19040,8 @@ if test "${with_mysql+set}" = set; then
                    MYSQL_BINDIR=/usr/local/bin
            elif test -f /usr/local/include/mysql.h; then
                    MYSQL_INCDIR=/usr/local/include
-                   if test -f /usr/local/lib64/libmysqlclient_r.a; then
+                   if test -f /usr/local/lib64/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/libmysqlclient_r.so; then
                            MYSQL_LIBDIR=/usr/local/lib64
                    else
                            MYSQL_LIBDIR=/usr/local/lib
@@ -19049,7 +19057,8 @@ echo "$as_me: error: Unable to find mysql.h in standard locations" >&2;}
         else
            if test -f $withval/include/mysql/mysql.h; then
               MYSQL_INCDIR=$withval/include/mysql
-              if test -f $withval/lib64/mysql/libmysqlclient_r.a; then
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                   -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
                  MYSQL_LIBDIR=$withval/lib64/mysql
               else
                  MYSQL_LIBDIR=$withval/lib/mysql
@@ -19061,7 +19070,8 @@ echo "$as_me: error: Unable to find mysql.h in standard locations" >&2;}
               MYSQL_BINDIR=$withval/bin
            elif test -f $withval/include/mysql.h; then
               MYSQL_INCDIR=$withval/include
-              if test -f "$withval/lib64/libmysqlclient_r.a"; then
+              if test -f $withval/lib64/libmysqlclient_r.a \
+                   -o -f $withval/lib64/libmysqlclient_r.so; then
                  MYSQL_LIBDIR=$withval/lib64
               else
                  MYSQL_LIBDIR=$withval/lib
@@ -19076,14 +19086,8 @@ echo "$as_me: error: Invalid MySQL directory $withval - unable to find mysql.h u
            fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
-    if test -f "$MYSQL_LIBDIR/libmysqlclient_r.a"; then
-       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
-       cat >>confdefs.h <<\_ACEOF
-#define HAVE_THREAD_SAFE_MYSQL 1
-_ACEOF
-
-    fi
-    if test -f "$MYSQL_LIBDIR/libmysqlclient_r.so"; then
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
+         -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
        SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
        cat >>confdefs.h <<\_ACEOF
 #define HAVE_THREAD_SAFE_MYSQL 1
index 0aee9b6ccd98eb2d5f814bcbd0e439e0e5799902..2757331ceaca1d0f037a63fc1b9a21dab30aa5b2 100644 (file)
@@ -2,6 +2,10 @@
 
 General:
 14May07 
+kes  Do better checking for the MySQL 64 bit libraries looking for both
+     .a and .so libraries.
+kes  Add a kludge for Ubuntu's non-standard locations for MySQL -- allow
+     /usr/include/mysql/mysql.h AND /usr/lib/... rather than /usr/lib/mysql/...
 kes  Require the thread safe version of MySQL during configure. Thanks
      to Andre Noll for pointing this out.
 kes  Ensure that calls to find_jobids_from_mediaid_list() check count before