mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 00:49:46 +02:00
#3317: Data::MySQL MySQL headers and library search paths
This commit is contained in:
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -L/usr/local/opt/mysql-client/lib -lmysqlclient
|
include MySQL.make
|
||||||
INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include -I/usr/local/opt/mysql-client/include/mysql
|
|
||||||
|
SYSLIBS += -lmysqlclient
|
||||||
SYSFLAGS += -DTHREADSAFE -DNO_TCL
|
SYSFLAGS += -DTHREADSAFE -DNO_TCL
|
||||||
|
|
||||||
objects = Binder Extractor SessionImpl Connector \
|
objects = Binder Extractor SessionImpl Connector \
|
||||||
|
|||||||
40
Data/MySQL/MySQL.make
Normal file
40
Data/MySQL/MySQL.make
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# MySQL.make
|
||||||
|
#
|
||||||
|
# Makefile fragment for finding MySQL library
|
||||||
|
#
|
||||||
|
|
||||||
|
ifndef POCO_MYSQL_INCLUDE
|
||||||
|
ifeq (0, $(shell test -d /usr/local/include/mysql; echo $$?))
|
||||||
|
POCO_MYSQL_INCLUDE = /usr/local/include
|
||||||
|
else
|
||||||
|
ifeq (0, $(shell test -d /usr/local/opt/mysql-client; echo $$?))
|
||||||
|
POCO_MYSQL_INCLUDE = /usr/local/opt/mysql-client/include
|
||||||
|
else
|
||||||
|
ifeq (0, $(shell test -d /usr/local/opt/mysql; echo $$?))
|
||||||
|
POCO_MYSQL_INCLUDE = /usr/local/opt/mysql/include
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef POCO_MYSQL_LIB
|
||||||
|
ifeq (0, $(shell test -d /usr/local/include/mysql; echo $$?))
|
||||||
|
POCO_MYSQL_LIB = /usr/local/lib
|
||||||
|
else
|
||||||
|
ifeq (0, $(shell test -d /usr/local/opt/mysql-client/lib; echo $$?))
|
||||||
|
POCO_MYSQL_INCLUDE = /usr/local/opt/mysql-client/lib
|
||||||
|
else
|
||||||
|
ifeq (0, $(shell test -d /usr/local/opt/mysql/lib; echo $$?))
|
||||||
|
POCO_MYSQL_INCLUDE = /usr/local/opt/mysql/lib
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef POCO_MYSQL_INCLUDE
|
||||||
|
INCLUDE += -I$(POCO_MYSQL_INCLUDE)
|
||||||
|
endif
|
||||||
|
ifdef POCO_MYSQL_LIB
|
||||||
|
SYSLIBS += -L$(POCO_MYSQL_LIB)
|
||||||
|
endif
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "Poco/Data/AbstractBinder.h"
|
#include "Poco/Data/AbstractBinder.h"
|
||||||
#include "Poco/Data/LOB.h"
|
#include "Poco/Data/LOB.h"
|
||||||
#include "Poco/Data/MySQL/MySQLException.h"
|
#include "Poco/Data/MySQL/MySQLException.h"
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
#include "Poco/Data/MySQL/MySQL.h"
|
#include "Poco/Data/MySQL/MySQL.h"
|
||||||
#include "Poco/Data/DataException.h"
|
#include "Poco/Data/DataException.h"
|
||||||
|
#include <mysql/mysql.h>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <mysql.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
#define Data_MySQL_ResultMetadata_INCLUDED
|
#define Data_MySQL_ResultMetadata_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include <mysql.h>
|
|
||||||
#include <vector>
|
|
||||||
#include "Poco/Data/MetaColumn.h"
|
#include "Poco/Data/MetaColumn.h"
|
||||||
|
#include <mysql/mysql.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#if LIBMYSQL_VERSION_ID >= 80000
|
#if LIBMYSQL_VERSION_ID >= 80000
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
#define Data_MySQL_SessionHandle_INCLUDED
|
#define Data_MySQL_SessionHandle_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include <mysql.h>
|
|
||||||
#include "Poco/Data/MySQL/MySQLException.h"
|
#include "Poco/Data/MySQL/MySQLException.h"
|
||||||
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
#define Data_MySQL_StatementHandle_INCLUDED
|
#define Data_MySQL_StatementHandle_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include <mysql.h>
|
|
||||||
#include "Poco/Data/MySQL/MySQLException.h"
|
#include "Poco/Data/MySQL/MySQLException.h"
|
||||||
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "Poco/Data/MySQL/MySQL.h"
|
#include "Poco/Data/MySQL/MySQL.h"
|
||||||
#include "Poco/Data/Session.h"
|
#include "Poco/Data/Session.h"
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include "Poco/Data/MySQL/SessionImpl.h"
|
#include "Poco/Data/MySQL/SessionImpl.h"
|
||||||
#include "Poco/Data/SessionFactory.h"
|
#include "Poco/Data/SessionFactory.h"
|
||||||
#include "Poco/Exception.h"
|
#include "Poco/Exception.h"
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Data/MySQL/MySQLException.h"
|
#include "Poco/Data/MySQL/MySQLException.h"
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <mysql.h>
|
|
||||||
#include "Poco/Data/MySQL/StatementExecutor.h"
|
#include "Poco/Data/MySQL/StatementExecutor.h"
|
||||||
#include "Poco/Format.h"
|
#include "Poco/Format.h"
|
||||||
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Data/MySQL/Utility.h"
|
#include "Poco/Data/MySQL/Utility.h"
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
INCLUDE += -I./../include -I/usr/local/include/mysql -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include -I/usr/local/opt/mysql-client/include/mysql
|
include $(POCO_BASE)/Data/MySQL/MySQL.make
|
||||||
|
|
||||||
# Note: linking order is important, do not change it.
|
# Note: linking order is important, do not change it.
|
||||||
SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -L/usr/local/opt/mysql-client/lib -lmysqlclient -lz -lpthread -ldl
|
SYSLIBS += -lmysqlclient -lz -lpthread -ldl
|
||||||
|
|
||||||
objects = MySQLTestSuite Driver MySQLTest SQLExecutor
|
objects = MySQLTestSuite Driver MySQLTest SQLExecutor
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ Poco::SharedPtr<SQLExecutor> MySQLTest::_pExecutor = 0;
|
|||||||
#define MYSQL_USER "pocotest"
|
#define MYSQL_USER "pocotest"
|
||||||
#define MYSQL_PWD "pocotest"
|
#define MYSQL_PWD "pocotest"
|
||||||
#define MYSQL_HOST "127.0.0.1"
|
#define MYSQL_HOST "127.0.0.1"
|
||||||
|
#ifndef MYSQL_PORT
|
||||||
#define MYSQL_PORT 3306
|
#define MYSQL_PORT 3306
|
||||||
|
#endif
|
||||||
#define MYSQL_DB "pocotest"
|
#define MYSQL_DB "pocotest"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "MySQLTestSuite.h"
|
#include "MySQLTestSuite.h"
|
||||||
#include "MySQLTest.h"
|
#include "MySQLTest.h"
|
||||||
|
|
||||||
|
|
||||||
CppUnit::Test* MySQLTestSuite::suite()
|
CppUnit::Test* MySQLTestSuite::suite()
|
||||||
{
|
{
|
||||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MySQLTestSuite");
|
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MySQLTestSuite");
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include <Winsock2.h>
|
#include <Winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <mysql.h>
|
#include <mysql/mysql.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
|||||||
18
configure
vendored
18
configure
vendored
@@ -102,6 +102,12 @@ Options:
|
|||||||
--odbc-include=<path>
|
--odbc-include=<path>
|
||||||
Specify the directory where ODBC header files are located.
|
Specify the directory where ODBC header files are located.
|
||||||
|
|
||||||
|
--mysql-lib=<path>
|
||||||
|
Specify the directory where MySQL library is located.
|
||||||
|
|
||||||
|
--mysql-include=<path>
|
||||||
|
Specify the directory where MySQL header files are located.
|
||||||
|
|
||||||
--cflags=<flags>
|
--cflags=<flags>
|
||||||
Pass additional flags to compiler.
|
Pass additional flags to compiler.
|
||||||
Example: --cflags=-wall
|
Example: --cflags=-wall
|
||||||
@@ -178,6 +184,12 @@ while [ $# -ge 1 ]; do
|
|||||||
--odbc-include=*)
|
--odbc-include=*)
|
||||||
odbcinclude="`echo ${1} | awk '{print substr($0,16)}'`" ;;
|
odbcinclude="`echo ${1} | awk '{print substr($0,16)}'`" ;;
|
||||||
|
|
||||||
|
--mysql-lib=*)
|
||||||
|
mysqllib="`echo ${1} | awk '{print substr($0,13)}'`" ;;
|
||||||
|
|
||||||
|
--mysql-include=*)
|
||||||
|
mysqlinclude="`echo ${1} | awk '{print substr($0,17)}'`" ;;
|
||||||
|
|
||||||
--cflags=*)
|
--cflags=*)
|
||||||
flags="$flags `echo ${1} | awk '{print substr($0,10)}'`" ;;
|
flags="$flags `echo ${1} | awk '{print substr($0,10)}'`" ;;
|
||||||
|
|
||||||
@@ -315,6 +327,12 @@ fi
|
|||||||
if [ -n "$odbcinclude" ] ; then
|
if [ -n "$odbcinclude" ] ; then
|
||||||
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>$build/config.make
|
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>$build/config.make
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$mysqllib" ] ; then
|
||||||
|
echo "POCO_MYSQL_LIB = $mysqllib" >>$build/config.make
|
||||||
|
fi
|
||||||
|
if [ -n "$mysqlinclude" ] ; then
|
||||||
|
echo "POCO_MYSQL_INCLUDE = $mysqlinclude" >>$build/config.make
|
||||||
|
fi
|
||||||
if [ -n "$unbundled" ] ; then
|
if [ -n "$unbundled" ] ; then
|
||||||
echo "POCO_UNBUNDLED = 1" >>$build/config.make
|
echo "POCO_UNBUNDLED = 1" >>$build/config.make
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user