[ARGUS] argus-clients and mysql8
Andreas Hasenack
andreas at canonical.com
Mon Aug 10 10:13:21 EDT 2020
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:
--- /dev/null
+++ b/include/argus_mysql.h
@@ -0,0 +1,14 @@
+#ifndef ARGUS_MYSQL_H
+#define ARGUS_MYSQL_H
+
+#ifdef ARGUS_MYSQL
+# ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+# endif
+# include <mysql.h>
+# ifndef my_bool
+# define my_bool bool
+# endif
+# endif /* ARGUS_MYSQL*/
+
+#endif /* ARGUS_MYSQL_H */
On Mon, Aug 10, 2020 at 10:32 AM Carter Bullard <carter at qosient.com> wrote:
>
> Yes, this would be the strategy … llooks good on my end …
> Carter
>
> > On Aug 10, 2020, at 9:21 AM, Andreas Hasenack <andreas at canonical.com> wrote:
> >
> > Ah, indeed, but it looks like at least the debian package does not
> > include a -dev binary package that installs the include files. It does
> > ship examples, but I'm not sure how the maintainer expects them to be
> > built if there are no shipped include files.
> >
> > The attached patch I believe represents what you meant earlier, and
> > the resulting deb is linked with mysql8:
> >
> > $ dpkg --info ./argus-client_3.0.8.2-6ubuntu1_amd64.deb |grep mysql
> > Depends: libc6 (>= 2.29), libgeoip1 (>= 1.6.12), libmysqlclient21 (>=
> > 8.0.11), libncurses6 (>= 6), libreadline8 (>= 6.0), libtinfo6 (>= 6),
> > libwrap0 (>= 7.6-4~), zlib1g (>= 1:1.1.4), perl:any
> >
> > Does this patch look ok?
> >
> > On Mon, Aug 10, 2020 at 10:07 AM Carter Bullard <carter at qosient.com> wrote:
> >>
> >> Hey Andreas,
> >> Yes, if you install the argus-clients package, (make install) the include files should go in an appropriate /usr include directory. For centos, it’s /usr/local/include/argus …
> >>
> >> Carter
> >>
> >>> On Aug 10, 2020, at 8:47 AM, Andreas Hasenack <andreas at canonical.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> On Sat, Aug 8, 2020 at 9:04 AM Carter Bullard <carter at qosient.com> wrote:
> >>>>
> >>>> Hey Andreas,
> >>>> Thanks !!!!! Since we do need to have some backward compatibility, and a lot of sites use old mysql … if this works for you, I’d go down the road of adding a ./include/argus_mysql.h file and use that in place of mysql.h …. And let that file do the corrections ...
> >>>>
> >>>> What do you think ??
> >>>
> >>> Sounds good, but this will become a new public header file that you
> >>> will have to install on the system, right? If that's fine by you, it's
> >>> fine by me :)
> >>>
> >>
> > <mysql8_my_bool.patch>
>
More information about the argus
mailing list