]> 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 04:03:31 +0000 (04:03 +0000)
committerMark Andrews <marka@isc.org>
Tue, 17 Jun 2008 04:03:31 +0000 (04:03 +0000)
                        mysql.  <prefix>/include/{,mysql/}mysql.h and
                        <prefix>/lib/{,mysql/}. [RT #18152]

CHANGES
configure
contrib/dlz/config.dlz.in

diff --git a/CHANGES b/CHANGES
index 93dba70c4adfa333d5a875c23b201e5318bebbe8..b5bfc106e617873c0de6631aecc5c124050c1496 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 7e616d0bec75ec066905ca5e20f04e92e2202141..84e0aeeaf9fcefd27ae8c87533632d584d6fb188 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,7 +14,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: configure,v 1.418.60.8 2008/05/06 01:33:33 each Exp $
+# $Id: configure,v 1.418.60.9 2008/06/17 04:03:31 marka Exp $
 #
 # Portions Copyright (C) 1996-2001  Nominum, Inc.
 #
@@ -30565,6 +30565,8 @@ else
 fi
 
 
+mysql_include=""
+mysql_lib=""
 if test "$use_dlz_mysql" = "yes"
 then
        # User did not specify a path - guess it
@@ -30574,9 +30576,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"
@@ -30601,18 +30643,18 @@ echo "${ECHO_T}no" >&6; }
                DLZ_DRIVER_SRCS="$DLZ_DRIVER_SRCS $dlzdir/$i.c"
                DLZ_DRIVER_OBJS="$DLZ_DRIVER_OBJS $i.$O"
        done
-       if test -n "-I$use_dlz_mysql/include/mysql"
+       if test -n "-I${mysql_include}"
        then
-               DLZ_DRIVER_INCLUDES="$DLZ_DRIVER_INCLUDES -I$use_dlz_mysql/include/mysql"
+               DLZ_DRIVER_INCLUDES="$DLZ_DRIVER_INCLUDES -I${mysql_include}"
        fi
-       if test -n "-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm"
+       if test -n "-L${mysql_lib} -lmysqlclient -lz -lcrypt -lm"
        then
-               DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm"
+               DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L${mysql_lib} -lmysqlclient -lz -lcrypt -lm"
        fi
 
 
-               { echo "$as_me:$LINENO: result: using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql" >&5
-echo "${ECHO_T}using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql" >&6; }
+               { echo "$as_me:$LINENO: result: using mysql from ${mysql_lib} and ${mysql_include}" >&5
+echo "${ECHO_T}using mysql from ${mysql_lib} and ${mysql_include}" >&6; }
                ;;
 esac
 
index 0e4b2e580b2665d7f9f1a87f9c263d8f65615a89..f78e907a77e714cc5021ff2d0e928b9af838f414 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