Dear all,
I have to add mySQL / MariaDB support in an old 5.15.2 installation. As explained in https://doc.qt.io/qt-5/sql-driver.html#qmysql I have to compile the plugin myself. The problem is, that the qmake step does not recognize the mariaDB installation:
Qt Code:
  1. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ qmake -- MYSQL_INCDIR="/usr/include/mariadb" MYSQL_LIBDIR="/lib/x86_64-linux-gnu"
  2.  
  3. Running configuration tests...
  4. Done running configuration tests.
  5.  
  6. Configure summary:
  7.  
  8. Qt Sql Drivers:
  9. DB2 (IBM) .............................. no
  10. InterBase .............................. no
  11. MySql .................................. no
  12. OCI (Oracle) ........................... no
  13. ODBC ................................... no
  14. PostgreSQL ............................. no
  15. SQLite2 ................................ no
  16. SQLite ................................. yes
  17. Using system provided SQLite ......... no
  18. TDS (Sybase) ........................... no
  19.  
  20. Qt is now configured for building. Just run 'make'.
  21. Once everything is built, you must run 'make install'.
  22. Qt will be installed into '/opt/Qt/5.15.2/gcc_64'.
To copy to clipboard, switch view to plain text mode 

Same result if I try
Qt Code:
  1. qmake -- MYSQL_PREFIX=/usr/include/mariadb
To copy to clipboard, switch view to plain text mode 
. I am quite sure that mariaDB IS installed:
Qt Code:
  1. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /usr/include/mariadb/mysql*
  2. /usr/include/mariadb/mysql_com.h /usr/include/mariadb/mysqld_error.h /usr/include/mariadb/mysql.h /usr/include/mariadb/mysql_version.h
  3.  
  4. /usr/include/mariadb/mysql:
  5. client_plugin.h plugin_auth_common.h plugin_auth.h
  6. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /lib/x86_64-linux-gnu/libmysql*
  7. /lib/x86_64-linux-gnu/libmysqlclient.so.21 /lib/x86_64-linux-gnu/libmysqlclient.so.21.2.31 /lib/x86_64-linux-gnu/libmysqlservices.a
To copy to clipboard, switch view to plain text mode 

It seems that qmake does not find any of the config-tests as config.log says - pay attention to line 8, 11, ... which says mysql_config not found.

Qt Code:
  1. Command line:
  2. Global lib dirs: [/home/qt/openssl-1.1.1g/lib] [/usr/lib/gcc/x86_64-linux-gnu/9 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib]
  3. Global inc dirs: [/home/qt/openssl-1.1.1g/include] [/usr/include/c++/9 /usr/include/x86_64-linux-gnu/c++/9 /usr/include/c++/9/backward /usr/lib/gcc/x86_64-linux-gnu/9/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include]
  4. loaded result for library config.sqldrivers.libraries.db2
  5. ...
  6. loaded result for library config.sqldrivers.libraries.mysql
  7. Trying source 0 (type mysqlConfig) of library mysql ...
  8. mysql_config not found.
  9. => source produced no result.
  10. Trying source 1 (type mysqlConfig) of library mysql ...
  11. mysql_config not found.
  12. => source produced no result.
  13. Trying source 2 (type mysqlConfig) of library mysql ...
  14. mysql_config not found.
  15. => source produced no result.
  16. Trying source 3 (type mysqlConfig) of library mysql ...
  17. mysql_config not found.
  18. => source produced no result.
  19. Trying source 4 (type inline) of library mysql ...
  20. mysql.h not found in [] and global paths.
  21. => source produced no result.
  22. Trying source 5 (type inline) of library mysql ...
  23. => source failed condition 'config.win32'.
  24. Trying source 6 (type inline) of library mysql ...
  25. => source failed condition 'config.win32'.
  26. Trying source 7 (type inline) of library mysql ...
  27. mysql.h not found in [] and global paths.
  28. => source produced no result.
  29. Trying source 8 (type inline) of library mysql ...
  30. mysql.h not found in [] and global paths.
  31. => source produced no result.
  32. test config.sqldrivers.libraries.mysql FAILED
  33. loaded result for library config.sqldrivers.libraries.oci
  34. ...
To copy to clipboard, switch view to plain text mode 

I already removed the sources and re-installed them using the Maintenance tool. Did not help.
  1. Where should these tests be located?
  2. Can I force the mySQL build somehow?
  3. I think the include path has to point to mysql.h - correct?


Any hint highly welcome.