Bug 62631 - apr-util-1.6.1 fail to compile with mysql8
Summary: apr-util-1.6.1 fail to compile with mysql8
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.6.3
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 08:07 UTC by Please
Modified: 2018-10-24 16:44 UTC (History)
1 user (show)



Attachments
this fix two problems - one in mysql library and second in m4 build script. (2.60 KB, text/plain)
2018-08-17 08:07 UTC, Please
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Please 2018-08-17 08:07:38 UTC
Created attachment 36097 [details]
this fix two problems - one in mysql library and second in m4 build script.

It looks like it is a APR1 conflict with Mysql80-client 

(build and install apr manually)
./configure --with-apr=../apr-1.6.3/ --with-mysql 

apr-util configure gives this with mysql80-client 

....
checking for mysql_config... /usr/local/bin/mysql_config
  adding "-I/usr/local/include/mysql" to CPPFLAGS
  setting LIBS to "-L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm -lrt -lexecinfo -lssl -lcrypto"
checking for mysql.h... no
checking for mysql/mysql.h... no
...

when mysql57-client gives:
....
checking for mysql_config... /usr/local/bin/mysql_config
  adding "-I/usr/local/include/mysql" to CPPFLAGS
  setting LIBS to "-L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm -lrt -lexecinfo -lssl -lcrypto"
checking for mysql.h... yes
checking for mysql_init in -lmysqlclient... yes
checking for my_global.h... yes
....

Two changes:
1. add c99 my_bool to apr_dbd_mysql.c
2. update build/dbd.m4 to not check agains my_global.h 


For more details please see bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230538
Comment 1 Bernard Spil 2018-10-24 16:44:10 UTC
I'm trying to fix this as team-member of the apache@ team in FreeBSD which is also the maintainer of the APR packages.

Looks like this issue is NOT FreeBSD specific, MySQL 8 ships different headers than 5.x. The autoconf needs some 

Looking at the config.log I see
> configure:20376: checking for mysql.h
> configure:20376: cc -c -O2 -fno-strict-aliasing -pipe -march=native  -DLIBICONV_PLUG -fstack-protector  -I/usr/ports/devel/apr1/work/apr-1.6.5/include -I/usr/local/include -I/usr/local/include/mysql -DHAVE_MYSQL_H -I/usr/local/include -DLIBICONV_PLUG conftest.c >&5
> conftest.c:21:10: fatal error: 'my_global.h' file not found
> #include <my_global.h>
>          ^~~~~~~~~~~~~
> 1 error generated.
> configure:20376: $? = 1
> configure: failed program was:

MySQL 8.0 does not ship a my_global.h, and APR decides that there's no usable MySQL.
There's a my_global.h in 
   https://github.com/mysql/mysql-server/tree/5.7/include 
but not in 
   https://github.com/mysql/mysql-server/tree/8.0/include

The requirement for my_global.h was introduced in 2008
https://svn.apache.org/viewvc?view=revision&revision=747625