[ARGUS] argus-clients and mysql8

Carter Bullard carter at qosient.com
Thu Aug 27 10:57:02 EDT 2020


Hey Andreas,
I put in fixes for the my_bool in the newest versions of argus, 3.0.8.3, which should be on the server (either is or soon).
For the clients I had to add a test for the include file stdbool.h … so need to add to ./configure.ac ...

diff --git a/configure.ac b/configure.ac
index dda9994a..60e39ae8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,7 +90,7 @@ AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 
-AC_CHECK_HEADERS([sys/types.h sys/sockio.h sys/file.h string.h fcntl.h syslog.h])
+AC_CHECK_HEADERS([sys/types.h sys/sockio.h sys/file.h string.h fcntl.h syslog.h stdbool.h])
 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h libintl.h malloc.h memory.h netdb.h netinet/in.h net/if_dl.h])
 AC_CHECK_HEADERS([stdlib.h stddef.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h])

And of course you’ll need to do:

% autoconf

With these changes, all seems to compile on 4-5 different versions of linux, Mac, and lots of different versions of mysql.
Send email if this doesn’t address your problem …

Carter


> On Aug 16, 2020, at 11:50 AM, Carter Bullard <carter at qosient.com> wrote:
> 
> 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 <mailto: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 <mailto: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/20200827/53b754b7/attachment-0001.html>


More information about the argus mailing list