]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reduce repeated detection of mysql lib directory.
authorPetr Menšík <pemensik@redhat.com>
Thu, 15 Feb 2018 11:48:56 +0000 (12:48 +0100)
committerEvan Hunt <each@isc.org>
Fri, 23 Feb 2018 21:57:56 +0000 (13:57 -0800)
Use common part once a bit later.

(cherry picked from commit 2a70eae04f901e13df814fc8b67b030d46cf90c6)
(cherry picked from commit d04af522226717c5d72271726446659ca87846e4)
(cherry picked from commit 1b0cf4fea63b263c1f46dbb7f282d00b5a67f9b5)
(cherry picked from commit 9982419c4c43211a79a35b94c2c6b45fdc0f860a)

contrib/dlz/config.dlz.in

index 33f05d5436073aa167cef177a83075c766ac603f..2b1295a27a1057e355b16db43855e26b1260eaa2 100644 (file)
@@ -134,30 +134,28 @@ mysql_include=""
 mysql_lib=""
 if test "$use_dlz_mysql" = "yes"
 then
-       # User did not specify a path - guess it
-       mysqldirs="/usr /usr/local /usr/local/mysql /usr/pkg"
-       for d in $mysqldirs
-       do
-               if test -f $d/include/mysql/mysql.h
-               then
-                       use_dlz_mysql=$d
-                       mysql_include=$d/include/mysql
-                       if test -d $d/lib/mysql
+       AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config)
+       if test -n "$MYSQL_CONFIG"
+       then
+               mysql_include=`${MYSQL_CONFIG} --include`
+               mysql_lib=`${MYSQL_CONFIG} --libs`
+               use_dlz_mysql="config"
+
+       else
+               # User did not specify a path - guess it
+               mysqldirs="/usr /usr/local /usr/local/mysql /usr/pkg"
+               for d in $mysqldirs
+               do
+                       if test -f $d/include/mysql/mysql.h
                        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
+                               use_dlz_mysql=$d
+                               mysql_include=$d/include/mysql
+                               break
+                       elif test -f $d/include/mysql.h
                        then
-                               mysql_lib=$d/lib/mysql
-                       else
-                               mysql_lib=$d/lib
+                               use_dlz_mysql=$d
+                               mysql_include=$d/include
+                               break
                        fi
                        break
                fi
@@ -168,21 +166,9 @@ then
        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
 
@@ -198,6 +184,12 @@ case "$use_dlz_mysql" in
                AC_MSG_RESULT(no)
                ;;
        *)
+               if test -d "$use_dlz_mysql/lib/mysql"
+               then
+                       mysql_lib="$use_dlz_mysql/lib/mysql"
+               else
+                       mysql_lib="$use_dlz_mysql/lib"
+               fi
                DLZ_ADD_DRIVER(MYSQL, dlz_mysql_driver,
                                [-I${mysql_include}],
                                [-L${mysql_lib} -lmysqlclient -lz -lcrypt -lm])