From 0f2fa0aae60ba71924c4a39bec7a6e87a7bb5341 Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Tue, 23 Sep 2008 07:44:45 +0000 Subject: [PATCH] FIX BUG-2123306 - Added support for optional compiling of NetSSL and Data, including control of which data components (ODBC, MySQL, SQLite) Added --help configuration additions FIX MinGW build support for Data component Corrected link order of Poco components for data samples resulting in unresolved symbol errors --- Data/samples/Binding/Makefile | 2 +- Data/samples/RecordSet/Makefile | 2 +- Data/samples/RowFormatter/Makefile | 2 +- Data/samples/Tuple/Makefile | 2 +- Data/samples/TypeHandler/Makefile | 2 +- Makefile | 110 +++++++++++++++++++++++++---- build/config/MinGW | 2 +- configure | 53 ++++++++++++++ 8 files changed, 155 insertions(+), 20 deletions(-) diff --git a/Data/samples/Binding/Makefile b/Data/samples/Binding/Makefile index 2319ef6cd..9c627bbc4 100644 --- a/Data/samples/Binding/Makefile +++ b/Data/samples/Binding/Makefile @@ -12,6 +12,6 @@ objects = Binding target = Binding target_version = 1 -target_libs = PocoFoundation PocoData PocoSQLite +target_libs = PocoSQLite PocoData PocoFoundation include $(POCO_BASE)/build/rules/exec diff --git a/Data/samples/RecordSet/Makefile b/Data/samples/RecordSet/Makefile index ce4660f35..b8520d9cb 100644 --- a/Data/samples/RecordSet/Makefile +++ b/Data/samples/RecordSet/Makefile @@ -12,6 +12,6 @@ objects = RecordSet target = RecordSet target_version = 1 -target_libs = PocoFoundation PocoData PocoSQLite +target_libs = PocoSQLite PocoData PocoFoundation include $(POCO_BASE)/build/rules/exec diff --git a/Data/samples/RowFormatter/Makefile b/Data/samples/RowFormatter/Makefile index 492c89116..0c7503e61 100644 --- a/Data/samples/RowFormatter/Makefile +++ b/Data/samples/RowFormatter/Makefile @@ -12,6 +12,6 @@ objects = RowFormatter target = RowFormatter target_version = 1 -target_libs = PocoFoundation PocoData PocoSQLite +target_libs = PocoSQLite PocoData PocoFoundation include $(POCO_BASE)/build/rules/exec diff --git a/Data/samples/Tuple/Makefile b/Data/samples/Tuple/Makefile index 567a7e1cc..8364a1136 100644 --- a/Data/samples/Tuple/Makefile +++ b/Data/samples/Tuple/Makefile @@ -12,6 +12,6 @@ objects = Tuple target = Tuple target_version = 1 -target_libs = PocoFoundation PocoData PocoSQLite +target_libs = PocoSQLite PocoData PocoFoundation include $(POCO_BASE)/build/rules/exec diff --git a/Data/samples/TypeHandler/Makefile b/Data/samples/TypeHandler/Makefile index 221e3cf33..4402f3053 100644 --- a/Data/samples/TypeHandler/Makefile +++ b/Data/samples/TypeHandler/Makefile @@ -12,6 +12,6 @@ objects = TypeHandler target = TypeHandler target_version = 1 -target_libs = PocoFoundation PocoData PocoSQLite +target_libs = PocoSQLite PocoData PocoFoundation include $(POCO_BASE)/build/rules/exec diff --git a/Makefile b/Makefile index 57be232a2..0e9a0c57e 100644 --- a/Makefile +++ b/Makefile @@ -15,37 +15,42 @@ ifndef POCO_PREFIX export POCO_PREFIX=/usr/local endif -.PHONY: all libexecs cppunit tests samples install +ifndef POCO_BUILD +export POCO_BUILD=$(POCO_BASE) +endif + +.PHONY: all libexecs cppunit tests samples clean distclean install all: libexecs tests samples INSTALLDIR = $(DESTDIR)$(POCO_PREFIX) -COMPONENTS = Foundation XML Util Net NetSSL_OpenSSL +COMPONENTS = Foundation XML Util Net NetSSL_OpenSSL Data Data/SQLite Data/ODBC cppunit: $(MAKE) -C $(POCO_BASE)/CppUnit install: libexecs - mkdir -p $(INSTALLDIR)/include/Poco - mkdir -p $(INSTALLDIR)/lib - mkdir -p $(INSTALLDIR)/bin + install -d $(INSTALLDIR)/include/Poco + install -d $(INSTALLDIR)/lib + install -d $(INSTALLDIR)/bin for comp in $(COMPONENTS) ; do \ if [ -d "$(POCO_BASE)/$$comp/include" ] ; then \ cp -Rf $(POCO_BASE)/$$comp/include/* $(INSTALLDIR)/include/ ; \ fi ; \ - if [ -d "$(POCO_BASE)/$$comp/bin" ] ; then \ - find $(POCO_BASE)/$$comp/bin -perm -700 -type f -exec cp -Rf {} $(INSTALLDIR)/bin \; ; \ + if [ -d "$(POCO_BUILD)/$$comp/bin" ] ; then \ + find $(POCO_BUILD)/$$comp/bin -perm -700 -type f -exec install {} $(INSTALLDIR)/bin \; ; \ fi ; \ done - find $(POCO_BASE)/lib -name "libPoco*" -exec cp -Rf {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib -name "libPoco*" -type f -exec install {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \; -.PHONY: Foundation-libexec XML-libexec Util-libexec Net-libexec NetSSL_OpenSSL-libexec -.PHONY: Foundation-tests XML-tests Util-tests Net-tests NetSSL_OpenSSL-tests -.PHONY: Foundation-samples XML-samples Util-samples Net-samples NetSSL_OpenSSL-samples +.PHONY: Foundation-libexec XML-libexec Util-libexec Net-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec +.PHONY: Foundation-tests XML-tests Util-tests Net-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests +.PHONY: Foundation-samples XML-samples Util-samples Net-samples NetSSL_OpenSSL-samples Data-samples -libexecs: Foundation-libexec XML-libexec Util-libexec Net-libexec NetSSL_OpenSSL-libexec -tests: Foundation-tests XML-tests Util-tests Net-tests NetSSL_OpenSSL-tests -samples: Foundation-samples XML-samples Util-samples Net-samples NetSSL_OpenSSL-samples +libexecs: Foundation-libexec XML-libexec Util-libexec Net-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec +tests: Foundation-tests XML-tests Util-tests Net-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests +samples: Foundation-samples XML-samples Util-samples Net-samples NetSSL_OpenSSL-samples Data-samples Foundation-libexec: $(MAKE) -C $(POCO_BASE)/Foundation @@ -83,6 +88,7 @@ Net-tests: Net-libexec cppunit Net-samples: Net-libexec Foundation-libexec XML-libexec Util-libexec $(MAKE) -C $(POCO_BASE)/Net/samples +ifeq ($(POCO_NETSSL_SUPPORT),enable) NetSSL_OpenSSL-libexec: Foundation-libexec Net-libexec Util-libexec $(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL @@ -91,3 +97,79 @@ NetSSL_OpenSSL-tests: NetSSL_OpenSSL-libexec cppunit NetSSL_OpenSSL-samples: NetSSL_OpenSSL-libexec $(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/samples +else +#no NetSSL support +endif + +ifeq ($(POCO_DATA_SUPPORT),enable) +Data-libexec: Foundation-libexec + $(MAKE) -C $(POCO_BASE)/Data + +Data-tests: Data-libexec cppunit + $(MAKE) -C $(POCO_BASE)/Data/testsuite + +Data-samples: Data-libexec Data-libexec Data/SQLite-libexec + $(MAKE) -C $(POCO_BASE)/Data/samples + +ifeq ($(POCO_DATA_SQLITE_SUPPORT), enable) +Data/SQLite-libexec: Foundation-libexec Data-libexec + $(MAKE) -C $(POCO_BASE)/Data/SQLite + +Data/SQLite-tests: Data/SQLite-libexec cppunit + $(MAKE) -C $(POCO_BASE)/Data/SQLite/testsuite +else +#no SQLite support +endif + +ifeq ($(POCO_DATA_ODBC_SUPPORT), enable) +Data/ODBC-libexec: Foundation-libexec Data-libexec + $(MAKE) -C $(POCO_BASE)/Data/ODBC + +Data/ODBC-tests: Data/ODBC-libexec cppunit + $(MAKE) -C $(POCO_BASE)/Data/ODBC/testsuite +else +#no ODBC support +endif + +ifeq ($(POCO_DATA_MYSQL_SUPPORT), enable) +Data/MySQL-libexec: Foundation-libexec Data-libexec + $(MAKE) -C $(POCO_BASE)/Data/MySQL + +Data/MySQL-tests: Data/ODBC-libexec cppunit + $(MAKE) -C $(POCO_BASE)/Data/MySQL/testsuite +else +#no MySQL support +endif +else +#no Data support +endif + +clean: + $(MAKE) -C $(POCO_BASE)/Foundation clean + $(MAKE) -C $(POCO_BASE)/Foundation/testsuite clean + $(MAKE) -C $(POCO_BASE)/Foundation/samples clean + $(MAKE) -C $(POCO_BASE)/XML clean + $(MAKE) -C $(POCO_BASE)/XML/testsuite clean + $(MAKE) -C $(POCO_BASE)/XML/samples clean + $(MAKE) -C $(POCO_BASE)/Util clean + $(MAKE) -C $(POCO_BASE)/Util/testsuite clean + $(MAKE) -C $(POCO_BASE)/Util/samples clean + $(MAKE) -C $(POCO_BASE)/Net clean + $(MAKE) -C $(POCO_BASE)/Net/testsuite clean + $(MAKE) -C $(POCO_BASE)/Net/samples clean + $(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL clean + $(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/testsuite clean + $(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/samples clean + $(MAKE) -C $(POCO_BASE)/Data clean + $(MAKE) -C $(POCO_BASE)/Data/testsuite clean + $(MAKE) -C $(POCO_BASE)/Data/samples clean + $(MAKE) -C $(POCO_BASE)/Data/SQLite clean + $(MAKE) -C $(POCO_BASE)/Data/SQLite/testsuite clean + $(MAKE) -C $(POCO_BASE)/Data/ODBC clean + $(MAKE) -C $(POCO_BASE)/Data/ODBC/testsuite clean + +distclean: + rm -rf $(POCO_BUILD)/lib + find $(POCO_BUILD) -name obj -type d -print0 | xargs -0 rm -rf + find $(POCO_BUILD) -name .dep -type d -print0 | xargs -0 rm -rf + find $(POCO_BUILD) -name bin -type d -print0 | xargs -0 rm -rf diff --git a/build/config/MinGW b/build/config/MinGW index d2c6c8b7a..77979e773 100644 --- a/build/config/MinGW +++ b/build/config/MinGW @@ -66,7 +66,7 @@ RELEASEOPT_LINK = -O2 # # System Specific Flags # -SYSFLAGS = -mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED -I/usr/local/include -I/usr/include +SYSFLAGS = -mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED -I/usr/local/include -I/usr/include # # System Specific Libraries diff --git a/configure b/configure index 3f05b577c..ef425630a 100755 --- a/configure +++ b/configure @@ -52,6 +52,21 @@ Options: Compile with -DPOCO_NO_FPENVIRONMENT. Useful if your C++ compiler has incomplete floating-point support (such as uclibc-based systems). + + --disable-NetSSL + Do not build NetSSL support + + --disable-Data + Do not build Data support + + --disable-ODBC + Do not build Data/ODBC support + + --disable-SQLite + Do not build Data/SQLite support + + --disable-MySQL + Do not build Data/MySQL support ENDHELP } @@ -65,6 +80,11 @@ cd $build tests="tests" samples="samples" flags="" +poco_netssl_support="enable" +poco_data_support="enable" +poco_data_odbc_support="enable" +poco_data_sqlite_support="enable" +poco_data_mysql_support="enable" # parse arguments while [ "$1" != "" ] ; do val=`expr $1 : '--config=\(.*\)'` @@ -97,6 +117,29 @@ while [ "$1" != "" ] ; do if [ "$1" = "--no-fpenvironment" ] ; then flags="$flags -DPOCO_NO_FPENVIRONMENT" fi + + if [ "$1" = "--disable-NetSSL" ] ; then + poco_netssl_support="disable" + fi + + if [ "$1" = "--disable-Data" ] ; then + poco_data_support="disable" + fi + + if [ "$1" = "--disable-ODBC" ] ; then + poco_data_odbc_support="disable" + poco_data_support="enable" + fi + + if [ "$1" = "--disable-SQLite" ] ; then + poco_data_sqlite_support="disable" + poco_data_support="enable" + fi + + if [ "$1" = "--disable-MySQL" ] ; then + poco_data_mysql_support="disable" + poco_data_support="enable" + fi if [ "$1" = "--help" ] ; then showhelp @@ -147,6 +190,11 @@ echo "POCO_BASE = $base" >>$build/config.make echo "POCO_BUILD = $build" >>$build/config.make echo "POCO_PREFIX = $prefix" >>$build/config.make echo "POCO_FLAGS = $flags" >>$build/config.make +echo "POCO_NETSSL_SUPPORT = $poco_netssl_support" >>$build/config.make +echo "POCO_DATA_SUPPORT = $poco_data_support" >>$build/config.make +echo "POCO_DATA_ODBC_SUPPORT = $poco_data_odbc_support" >>$build/config.make +echo "POCO_DATA_SQLITE_SUPPORT = $poco_data_sqlite_support" >>$build/config.make +echo "POCO_DATA_MYSQL_SUPPORT = $poco_data_mysql_support" >>$build/config.make if [ "$stdcxx_base" != "" ] ; then echo "STDCXX_BASE = $stdcxx_base" >>$build/config.make fi @@ -156,6 +204,11 @@ echo "export POCO_BASE" >>$build/config.make echo "export POCO_BUILD" >>$build/config.make echo "export POCO_PREFIX" >>$build/config.make echo "export POCO_FLAGS" >>$build/config.make +echo "export POCO_NETSSL_SUPPORT = $poco_netssl_support" >>$build/config.make +echo "export POCO_DATA_SUPPORT = $poco_data_support" >>$build/config.make +echo "export POCO_DATA_ODBC_SUPPORT = $poco_data_odbc_support" >>$build/config.make +echo "export POCO_DATA_SQLITE_SUPPORT = $poco_data_sqlite_support" >>$build/config.make +echo "export POCO_DATA_MYSQL_SUPPORT = $poco_data_mysql_support" >>$build/config.make if [ "$stdcxx_base" != "" ] ; then echo "export STDCXX_BASE" >>$build/config.make fi