ocaml-mariadb icon indicating copy to clipboard operation
ocaml-mariadb copied to clipboard

Use mariadb_config binary to determine compiler flags

Open Leonidas-from-XIV opened this issue 6 years ago • 4 comments

This will use mariadb_config to determine what to compile and link against. Closes #15.

I've removed support for switching between connector and uhm, server, since that could be handled by putting different mariadb_config in the path.

I've let the mariadb/mysql include prefix in, since I think it would be nice to be able to compile against the MySQL connector, but for this PR I only added mariadb_config support and ignore mysql_config. I am not sure this library is compatible with building against MySQL connector anyway.

Leonidas-from-XIV avatar Dec 04 '17 15:12 Leonidas-from-XIV

Hi

This is not correct. OCaml-MariaDB supports MariaDB's two connectors:

  1. MariaDB C/Connector (libmariadb-dev): link with -lmariadb and include mariadb/mysql.h
  2. MaraDB's libmysqlclient (libmariadbclient-dev): link with -lmysqlclient and include mysql/mysql.h

For the second case, you must use mysql_config to get the flags.

I'd like to support both connectors at least until an Ubuntu LTS version has a C/Connector package that supports the nonblocking APIs.

andrenth avatar Dec 04 '17 15:12 andrenth

Oh, I see. I'll add support for mysql_config as well. Probably tomorrow.

Leonidas-from-XIV avatar Dec 04 '17 16:12 Leonidas-from-XIV

My MariaDB connector from brew does not come with a mysql_config and using the one provided by the MySQL connector does not work since there is no mysql/mysql.h but I suppose this is just because of weird packaging.

I was actually hoping to be able to use this to connect to an (actual) MySQL server but that seems to fail with all kinds of errors.

Leonidas-from-XIV avatar Dec 05 '17 09:12 Leonidas-from-XIV

Doesn't the MariaDB brew package come with a mysql_config?

andrenth avatar Dec 05 '17 13:12 andrenth