apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r410841 - /apr/apr-util/trunk/build/dbd.m4
Date Thu, 01 Jun 2006 11:27:58 GMT
Author: bojan
Date: Thu Jun  1 04:27:58 2006
New Revision: 410841

URL: http://svn.apache.org/viewvc?rev=410841&view=rev
Log:
Don't configure MySQL if the driver isn't there.

Modified:
    apr/apr-util/trunk/build/dbd.m4

Modified: apr/apr-util/trunk/build/dbd.m4
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/build/dbd.m4?rev=410841&r1=410840&r2=410841&view=diff
==============================================================================
--- apr/apr-util/trunk/build/dbd.m4 (original)
+++ apr/apr-util/trunk/build/dbd.m4 Thu Jun  1 04:27:58 2006
@@ -78,97 +78,99 @@
 AC_DEFUN([APU_CHECK_DBD_MYSQL], [
   apu_have_mysql=0
 
-  AC_ARG_WITH([mysql], [
-  --with-mysql=DIR          **** SEE INSTALL.MySQL ****
-  ], [
-    apu_have_mysql=0
-    if test "$withval" = "yes"; then
-      old_cppflags="$CPPFLAGS"
-      old_ldflags="$LDFLAGS"
+  AC_CHECK_FILES([dbd/apr_dbd_mysql.c],[
+    AC_ARG_WITH([mysql], [
+    --with-mysql=DIR          **** SEE INSTALL.MySQL ****
+    ], [
+      apu_have_mysql=0
+      if test "$withval" = "yes"; then
+        old_cppflags="$CPPFLAGS"
+        old_ldflags="$LDFLAGS"
 
-      AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
-      if test "x$MYSQL_CONFIG" != 'x'; then
-        mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
-        mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
+        AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
+        if test "x$MYSQL_CONFIG" != 'x'; then
+          mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
+          mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
 
-        APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
-        APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
-      fi
+          APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
+          APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
+        fi
 
-      AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
-      if test "$apu_have_mysql" == "0"; then
-        AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+        AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+        if test "$apu_have_mysql" == "0"; then
+          AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+        else
+          if test "x$MYSQL_CONFIG" != 'x'; then
+            APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
+            APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
+          fi
+        fi
+
+        CPPFLAGS="$old_cppflags"
+        LDFLAGS="$old_ldflags"
+      elif test "$withval" = "no"; then
+        apu_have_mysql=0
       else
+        old_cppflags="$CPPFLAGS"
+        old_ldflags="$LDFLAGS"
+
+        AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin])
         if test "x$MYSQL_CONFIG" != 'x'; then
+          mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
+          mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
+        else
+          mysql_CPPFLAGS="-I$withval/include"
+          mysql_LDFLAGS="-L$withval/lib "
+        fi
+
+        APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
+        APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
+
+        AC_MSG_NOTICE(checking for mysql in $withval)
+        AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+        if test "$apu_have_mysql" != "0"; then
           APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
           APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
         fi
-      fi
 
-      CPPFLAGS="$old_cppflags"
-      LDFLAGS="$old_ldflags"
-    elif test "$withval" = "no"; then
+        if test "$apu_have_mysql" != "1"; then
+          AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+          if test "$apu_have_mysql" != "0"; then
+            APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/mysql])
+            APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
+          fi
+        fi
+
+        CPPFLAGS="$old_cppflags"
+        LDFLAGS="$old_ldflags"
+      fi
+    ], [
       apu_have_mysql=0
-    else
+
       old_cppflags="$CPPFLAGS"
       old_ldflags="$LDFLAGS"
 
-      AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin])
+      AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
       if test "x$MYSQL_CONFIG" != 'x'; then
         mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
         mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
-      else
-        mysql_CPPFLAGS="-I$withval/include"
-        mysql_LDFLAGS="-L$withval/lib "
-      fi
 
-      APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
-      APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
+        APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
+        APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
+      fi
 
-      AC_MSG_NOTICE(checking for mysql in $withval)
       AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
-      if test "$apu_have_mysql" != "0"; then
-        APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
-        APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
-      fi
 
-      if test "$apu_have_mysql" != "1"; then
-        AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
-        if test "$apu_have_mysql" != "0"; then
-          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/mysql])
-          APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
+      if test "$apu_have_mysql" != "0"; then
+        if test "x$MYSQL_CONFIG" != 'x'; then
+          APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
+          APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
         fi
       fi
 
       CPPFLAGS="$old_cppflags"
       LDFLAGS="$old_ldflags"
-    fi
-  ], [
-    apu_have_mysql=0
-
-    old_cppflags="$CPPFLAGS"
-    old_ldflags="$LDFLAGS"
-
-    AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
-    if test "x$MYSQL_CONFIG" != 'x'; then
-      mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
-      mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
-
-      APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
-      APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
-    fi
-
-    AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
-
-    if test "$apu_have_mysql" != "0"; then
-      if test "x$MYSQL_CONFIG" != 'x'; then
-        APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
-        APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
-      fi
-    fi
-
-    CPPFLAGS="$old_cppflags"
-    LDFLAGS="$old_ldflags"
+    ])
   ])
 
   AC_SUBST(apu_have_mysql)



Mime
View raw message