summaryrefslogtreecommitdiffstats
path: root/m4/np_mysqlclient.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/np_mysqlclient.m4')
-rw-r--r--m4/np_mysqlclient.m432
1 files changed, 24 insertions, 8 deletions
diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
index c2a4d2a7..9fe38ac9 100644
--- a/m4/np_mysqlclient.m4
+++ b/m4/np_mysqlclient.m4
@@ -13,7 +13,7 @@ dnl np_mysql_libs = flags for libs, from mysql_config --libs
13dnl np_mysql_cflags = flags for cflags, from mysql_config --cflags 13dnl np_mysql_cflags = flags for cflags, from mysql_config --cflags
14dnl Also sets in config.h: 14dnl Also sets in config.h:
15dnl HAVE_MYSQLCLIENT 15dnl HAVE_MYSQLCLIENT
16dnl Copile your code with: 16dnl Compile your code with:
17dnl $(CC) $(np_mysql_include) code.c $(np_mysql_libs) 17dnl $(CC) $(np_mysql_include) code.c $(np_mysql_libs)
18 18
19AC_DEFUN([np_mysqlclient], 19AC_DEFUN([np_mysqlclient],
@@ -53,19 +53,35 @@ AC_DEFUN([np_mysqlclient],
53 _savedcppflags="$CPPFLAGS" 53 _savedcppflags="$CPPFLAGS"
54 CPPFLAGS="$CPPFLAGS $np_mysql_include" 54 CPPFLAGS="$CPPFLAGS $np_mysql_include"
55 55
56 dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in 56 np_check_lib_mysqlclient
57 dnl Although -lmysqlclient is duplicated, it is not a problem 57
58 AC_CHECK_LIB([mysqlclient], [mysql_init], [
59 with_mysql=$np_mysql_config
60 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
61 ], [with_mysql=no], [$np_mysql_libs])
62 CPPFLAGS=$_savedcppflags 58 CPPFLAGS=$_savedcppflags
63 59
64 fi 60 fi
65 fi 61 fi
66]) 62])
67 63
68dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH 64dnl Test mysql_init using mysqlclient
65AC_DEFUN([np_check_lib_mysqlclient],
66[
67 dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in
68 dnl Although -lmysqlclient is duplicated, it is not a problem
69 AC_CHECK_LIB([mysqlclient], [mysql_init], [
70 with_mysql=$np_mysql_config
71 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
72 ], [np_check_lib_mariadbclient], [$np_mysql_libs])
73])
74
75dnl Test mysql_init using mariadbclient
76AC_DEFUN([np_check_lib_mariadbclient],
77[
78 AC_CHECK_LIB([mariadbclient], [mysql_init], [
79 with_mysql=$np_mysql_config
80 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile])
81 ], [with_mysql=no], [$np_mysql_libs])
82])
83
84dnl Will take $1, find last occurrence of -LDIR and add DIR to LD_RUN_PATH
69AC_DEFUN([np_add_to_runpath], 85AC_DEFUN([np_add_to_runpath],
70[ 86[
71 dnl Need [[ ]] so autoconf gives us just one set 87 dnl Need [[ ]] so autoconf gives us just one set