dyne / dowse

The Awareness Hub for the Internet of Things
http://dowse.eu
159 stars 17 forks source link

Add WITH_MYSQL switch to use MySQL instead of MariaDB #35

Closed ilpianista closed 7 years ago

ilpianista commented 7 years ago

On both Arch Linux and Ubuntu, MariaDB headers are installed under /usr/include/mysql and the library is still named libmysqld.so.

While we could include both headers locations (/usr/include/mysql and /usr/include/mariadb) we cannot link to both libraries -lmariadb -lmysqld because only the latter is present on those systems and the build will fail.

~This patch fixes the build on those systems, but (maybe) will broke your workflow I guess.~ ~I don't know how to handle both cases, however may I ask which distro are you using that installs MariaDB library as libmariadb.so?~

jaromil commented 7 years ago

This is indeed the current problem on the Travis test, since it runs on Ubuntu 14. I was wondering to solve this problem by switching Travis to use our reference OS (Devuan), but then it would be even better perhaps to solve this problem for all platforms. Debian provides aliased packages for libmysql-*

ilpianista commented 7 years ago

@jaromil what do you think about this proposal? I added the WITH_MYSQL switch; by default MariaDB is used.

nicolarossi commented 7 years ago

I'm not agree to Travis-ing with compile "path" different from the official released . Otherwise something like : (test -x /usr/bin/mariadb_config && mariadb_config --include ) || (mysql_config --include) ?

ilpianista commented 7 years ago

@nicolarossi the problem aren't the includes, but the linker flags: we cannot link to both -lmariadb and -lmysqld. We could script something in the Makefiles, but what about kore build configuration used by webui? We cannot script there, and that's because I added a new flavor to the build configuration.