Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mariadb_config binary to determine compiler flags #16

Conversation

Leonidas-from-XIV
Copy link
Member

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.

(* OASIS_STOP *)

let dispatch = function
| After_rules ->
let stubgen = "stubgen/ffi_stubgen.byte" in
let stubgen_types = "stubgen/ffi_types_stubgen.byte" in
let stubgen_ml_types = "stubgen/ffi_ml_types_subgen" in
let stubgen_ml_types = "stubgen/ffi_ml_types_stubgen" in
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated change and I am quite surprised how this used to work.

@andrenth
Copy link
Collaborator

andrenth commented Dec 4, 2017

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.

@Leonidas-from-XIV
Copy link
Member Author

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

@Leonidas-from-XIV
Copy link
Member Author

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.

@andrenth
Copy link
Collaborator

andrenth commented Dec 5, 2017

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

@paurkedal
Copy link
Collaborator

Since I switched to use dune and dune-configurator (#52), this PR does not apply any more, and I'm wondering if we can close it, given that #15 was resolved?

The dune switch replicated the existing functionality, rather than using mysql_config and mariadb_config. The latter can be implemented, but given there are two commands and if the former does not always give use the flags we need, I suggest we only resurrect this PR if it still solves a real problem.

@Leonidas-from-XIV
Copy link
Member Author

Yeah, I don't use MySQL nor MariaDB anymore, so I'm have no need for it either way.

@Leonidas-from-XIV Leonidas-from-XIV deleted the feature/mariadb_config branch October 17, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building on macOS fails
3 participants