[ARGUS] argus-clients and mysql8
Carter Bullard
carter at qosient.com
Sun Aug 16 11:50:54 EDT 2020
Hey Andreas,
We can try this autoconf approach …
Add this to your acsite.m4 file that is in the clients root directory:
% diff --git a/acsite.m4 b/acsite.m4
index 3f3dc0c1..8bcccf87 100644
--- a/acsite.m4
+++ b/acsite.m4
@@ -890,6 +890,18 @@ ARGUS_MYSQL_MAKEFILE=no
fi
fi
+ AC_MSG_CHECKING([for my_bool in $ac_cv_mysql_where_inc/mysql.h])
+ AC_EGREP_HEADER(my_bool, $ac_cv_mysql_where_inc/mysql.h,
+ MYSQL_MY_BOOL_AVAILABLE=yes,)
+
+ if test "$MYSQL_BOOL_AVAILABLE" = yes; then
+ AC_DEFINE([HAVE_MYSQL_MY_BOOL],[],
+ [Define if your mysql implimentation defines my_bool type])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+
ARGUS_MYSQL="./ramysql"
ARGUS_MYSQL_MAKEFILE="./examples/ramysql/Makefile"
AC_SUBST(MYSQL_LDFLAGS)
Then rebuild your configure script …
% autoreconf
And then include/argus_mysql.h becomes …
-— contents of ./include/argus_mysql.h
#ifndef ARGUS_MYSQL_H
#define ARGUS_MYSQL_H
#ifdef ARGUS_MYSQL
# ifdef HAVE_STDBOOL_H
# include <stdbool.h>
# endif
# include <mysql.h>
# ifndef HAVE_MYSQL_MY_BOOL
# define my_bool bool
# endif
# endif /* ARGUS_MYSQL*/
#endif /* ARGUS_MYSQL_H */
-— end contents
How’s that ???
Carter
> On Aug 10, 2020, at 11:33 AM, Carter Bullard <carter at qosient.com> wrote:
>
> Yep, that makes sense … let me noodle on this this afternoon …
> Carter
> <http://qosient.com/>
> Carter Bullard <mailto:carter at qosient.com>• Founder / CEO
> 150 E 57th Street, Suite 12D
> New York, New York 10022-2795
> Phone +1.212.588.9133 • Mobile +1.917.497.9494
>
>
>
>> On Aug 10, 2020, at 11:06 AM, Andreas Hasenack <andreas at canonical.com <mailto:andreas at canonical.com>> wrote:
>>
>> On Mon, Aug 10, 2020 at 11:53 AM Andreas Hasenack <andreas at canonical.com <mailto:andreas at canonical.com>> wrote:
>>>
>>> Hi,
>>>
>>> On Mon, Aug 10, 2020 at 11:13 AM Andreas Hasenack <andreas at canonical.com <mailto:andreas at canonical.com>> wrote:
>>>>
>>>> That failed to build with mysql5.7:
>>>> ./rasql.c: In function ‘RaMySQLInit’:
>>>> ../../include/argus_mysql.h:10:20: error: unknown type name ‘bool’;
>>>> did you mean ‘_Bool’?
>>>> # define my_bool bool
>>>> ^
>>>> It shouldn't be trying to redefine my_bool with mysql 5.7. Looks like
>>>> the "if !defined(my_bool)" didn't work as expected.
>>>> In mysql5.7 my_bool is a typedef to char, would that explain it?
>>>>
>>>> Switching that clause to #ifndef my_bool seemed to work in both
>>>> mysql5.7 and 8. Weird, I thought these #if's were the same:
>>>
>>> Scratch that, it's not working either way. I don't know yet, but the
>>> my_bool check is always returning as if it's not defined.
>>
>> Ok, we can't use #ifdef checks for my_bool because it's not something
>> that is #define'd, it's a typedef (in the case of mysql 5.7). This
>> probably needs a configure.ac check.
>> _______________________________________________
>> argus mailing list
>> argus at qosient.com <mailto:argus at qosient.com>
>> https://pairlist1.pair.net/mailman/listinfo/argus <https://pairlist1.pair.net/mailman/listinfo/argus>
> _______________________________________________
> argus mailing list
> argus at qosient.com
> https://pairlist1.pair.net/mailman/listinfo/argus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20200816/2ba9a753/attachment-0001.html>
More information about the argus
mailing list