aboutsummaryrefslogtreecommitdiff
path: root/m4/np_mysqlclient.m4
diff options
context:
space:
mode:
authorGravatar Eric Stanley <estanley@nagios.com> 2011-12-16 10:18:41 -0600
committerGravatar Eric Stanley <estanley@nagios.com> 2011-12-16 10:18:41 -0600
commit55fb4097cd416aecd778ccb82e731d25f3ee6fce (patch)
tree6ab83e079bbac68f0cc34f3dca92dbe468bc34bf /m4/np_mysqlclient.m4
parent5532dbe48a485edb7f75c5058a2aac87090f66d3 (diff)
downloadmonitoring-plugins-55fb4097cd416aecd778ccb82e731d25f3ee6fce.tar.gz
Fixed issue for compiling mysql plugin on Solaris
On Solaris, in the case where the mysql libraries were compiled using a non-gcc compiler, but the plugins are being compiled with gcc, the configure process would incorrectly determine the MYSQLCFLAGS. This has been corrected in the m4/np_mysqlclient.m4 file.
Diffstat (limited to 'm4/np_mysqlclient.m4')
-rw-r--r--m4/np_mysqlclient.m46
1 files changed, 6 insertions, 0 deletions
diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
index 9bbe63c6..cd36c4f7 100644
--- a/m4/np_mysqlclient.m4
+++ b/m4/np_mysqlclient.m4
@@ -42,6 +42,12 @@ AC_DEFUN([np_mysqlclient],
fi
np_mysql_libs="`$np_mysql_config --libs`"
np_mysql_cflags="`$np_mysql_config --cflags`"
+ # On Solaris, cflags may contain -xstrconst, which is not acceptable to the
+ # gcc compiler. In this case, use the include flags as the cflags
+ echo $np_mysql_cflags | grep -- -xstrconst > /dev/null 2> /dev/null
+ if test $? -eq 0 -a "$CC" = "gcc" ; then
+ np_mysql_cflags="`$np_mysql_config --include`"
+ fi
dnl Test a mysql_init. Some systems have mysql_config, but no headers
_savedcppflags="$CPPFLAGS"