]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2381. [port] dlz/mysql: support multiple install layouts for
authorMark Andrews <marka@isc.org>
Tue, 17 Jun 2008 03:52:37 +0000 (03:52 +0000)
committerMark Andrews <marka@isc.org>
Tue, 17 Jun 2008 03:52:37 +0000 (03:52 +0000)
                        mysql.  <prefix>/include/{,mysql/}mysql.h and
                        <prefix>/lib/{,mysql/}. [RT #18152]

CHANGES
contrib/dlz/config.dlz.in

diff --git a/CHANGES b/CHANGES
index 9e3b49fbc57e9e9580d7d77846793b98dc5394fe..e18f868ff74d1b7cbda6eab61c48da5b5e2bfc6e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+2381.  [port]          dlz/mysql: support multiple install layouts for
+                       mysql.  <prefix>/include/{,mysql/}mysql.h and
+                       <prefix>/lib/{,mysql/}. [RT #18152]
+
 2380.  [bug]           dns_view_find() was not returning NXDOMAIN/NXRRSET
                        proofs which, in turn, caused validation failures
                        for insecure zones immediately below a secure zone
index 0e4b2e580b2665d7f9f1a87f9c263d8f65615a89..a186eed5b9d72af0087f3093f14178ed28b1b64d 100644 (file)
@@ -123,6 +123,8 @@ AC_ARG_WITH(dlz_mysql,
                                (Required to use MySQL with DLZ)],
     use_dlz_mysql="$withval", use_dlz_mysql="no")
 
+mysql_include=""
+mysql_lib=""
 if test "$use_dlz_mysql" = "yes"
 then
        # User did not specify a path - guess it
@@ -132,9 +134,49 @@ then
                if test -f $d/include/mysql/mysql.h
                then
                        use_dlz_mysql=$d
+                       mysql_include=$d/include/mysql
+                       if test -d $d/lib/mysql
+                       then
+                               mysql_lib=$d/lib/mysql
+                       else
+                               mysql_lib=$d/lib
+                       fi
+                       break
+               elif test -f $d/include/mysql.h
+               then
+                       use_dlz_mysql=$d
+                       mysql_include=$d/include
+                       if test -d $d/lib/mysql
+                       then
+                               mysql_lib=$d/lib/mysql
+                       else
+                               mysql_lib=$d/lib
+                       fi
                        break
                fi
        done
+elif test "$use_dlz_mysql" != "no"
+then
+       d = $use_dlz_mysql
+       if test -f $d/include/mysql/mysql.h
+       then
+               mysql_include=$d/include/mysql
+               if test -d $d/lib/mysql
+               then
+                       mysql_lib=$d/lib/mysql
+               else
+                       mysql_lib=$d/lib
+               fi
+       elif test -f $d/include/mysql.h
+       then
+               mysql_include=$d/include
+               if test -d $d/lib/mysql
+               then
+                       mysql_lib=$d/lib/mysql
+               else
+                       mysql_lib=$d/lib
+               fi
+       fi
 fi
 
 if test "$use_dlz_mysql" = "yes"
@@ -150,11 +192,11 @@ case "$use_dlz_mysql" in
                ;;
        *)
                DLZ_ADD_DRIVER(MYSQL, dlz_mysql_driver,
-                               [-I$use_dlz_mysql/include/mysql],
-                               [-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm])
+                               [-I${mysql_include}],
+                               [-L${mysql_lib} -lmysqlclient -lz -lcrypt -lm])
 
                AC_MSG_RESULT(
-[using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql])
+[using mysql from ${mysql_lib} and ${mysql_include}])
                ;;
 esac