apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Samuelson <pe...@p12n.org>
Subject Re: [PATCH] apr-util: fix dbd.m4 for use with apr_dbd_mysql.c
Date Sun, 07 Jan 2007 10:48:29 GMT

My apologies, that patch was against 1.2.7, I forgot to check the
trunk.  I see you are already using AC_CHECK_HEADERS there, so the bug
that hit me is not present.  It still doesn't work, but the reason is
unrelated, I'll follow up separately.  Meanwhile, if you still want the
cleanup part....


Index: build/dbd.m4
===================================================================
--- build/dbd.m4	(revisione 492953)
+++ build/dbd.m4	(copia locale)
@@ -82,11 +82,10 @@
     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"
+      old_cppflags="$CPPFLAGS"
+      old_ldflags="$LDFLAGS"
 
+      if test "$withval" = "yes"; then
         AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
         if test "x$MYSQL_CONFIG" != 'x'; then
           mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
@@ -95,25 +94,13 @@
           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]))
-        else
-          if test "x$MYSQL_CONFIG" != 'x'; then
-            APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
-            APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
-          fi
+        AC_CHECK_HEADERS([mysql.h mysql/mysql.h],
+                         AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+        if test "$apu_have_mysql" = "1" && test "x$MYSQL_CONFIG" != 'x'; then
+          APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
+          APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
         fi
-
-        CPPFLAGS="$old_cppflags"
-        LDFLAGS="$old_ldflags"
-      elif test "$withval" = "no"; then
-        apu_have_mysql=0
-      else
-        old_cppflags="$CPPFLAGS"
-        old_ldflags="$LDFLAGS"
-
+      elif test "$withval" != "no"; then
         AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin])
         if test "x$MYSQL_CONFIG" != 'x'; then
           mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
@@ -127,26 +114,17 @@
         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]))
+        AC_CHECK_HEADERS([mysql.h 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, [$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])
-          fi
-        fi
-
-        CPPFLAGS="$old_cppflags"
-        LDFLAGS="$old_ldflags"
       fi
-    ], [
-      apu_have_mysql=0
 
+      CPPFLAGS="$old_cppflags"
+      LDFLAGS="$old_ldflags"
+    ], [
       old_cppflags="$CPPFLAGS"
       old_ldflags="$LDFLAGS"
 
@@ -159,13 +137,12 @@
         APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
       fi
 
-      AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
+      AC_CHECK_HEADERS([mysql.h mysql/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
+      if test "$apu_have_mysql" != "0" && test "x$MYSQL_CONFIG" != 'x'; then
+        APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
+        APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
       fi
 
       CPPFLAGS="$old_cppflags"

Mime
View raw message