diff --git a/Data/ODBC/Makefile b/Data/ODBC/Makefile index 00165235c..cc45323c4 100644 --- a/Data/ODBC/Makefile +++ b/Data/ODBC/Makefile @@ -16,6 +16,11 @@ include $(POCO_BASE)/build/rules/global # adjust for the target system (usually '/usr/lib' or '/usr/local/lib') ODBCLIBDIR = /usr/lib$(LIB64SUFFIX) +ifeq ($(LINKMODE),STATIC) +LIBLINKEXT = $(STATICLIBLINKEXT) +else +LIBLINKEXT = $(SHAREDLIBLINKEXT) +endif INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc @@ -31,19 +36,19 @@ CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX # CYGWIN platform has its own ODBC library in /lib/w32api SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32 else -ifeq (0, $(shell test -e /usr/lib/libodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -lodbc -lodbcinst COMMONFLAGS += -DPOCO_UNIXODBC else -ifeq (0, $(shell test -h /usr/lib/libodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -lodbc -lodbcinst COMMONFLAGS += -DPOCO_UNIXODBC else -ifeq (0, $(shell test -e /usr/lib/libiodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -liodbc -liodbcinst COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc else -ifeq (0, $(shell test -h /usr/lib/libiodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc COMMONFLAGS += -DPOCO_IODBC else diff --git a/Data/ODBC/testsuite/Makefile b/Data/ODBC/testsuite/Makefile index 071f1c242..e73f4456e 100644 --- a/Data/ODBC/testsuite/Makefile +++ b/Data/ODBC/testsuite/Makefile @@ -16,30 +16,53 @@ include $(POCO_BASE)/build/rules/global # adjust for the target system (usually '/usr/lib' or '/usr/local/lib') ODBCLIBDIR = /usr/lib$(LIB64SUFFIX) +ifeq ($(LINKMODE),STATIC) +LIBLINKEXT = $(STATICLIBLINKEXT) +else +LIBLINKEXT = $(SHAREDLIBLINKEXT) +endif INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc -SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/odbc -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) +SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc ifeq ($(POCO_CONFIG),MinGW) -# Lack of unixODBC or iODBC is not an error for MinGW platform since it uses Windows odbc32.lib +# -DODBCVER=0x0300: SQLHandle declaration issue +# -DNOMINMAX : MIN/MAX macros defined in windows conflict with libstdc++ +CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX +else ifeq ($(POCO_CONFIG),CYGWIN) +# -DODBCVER=0x0300: SQLHandle declaration issue +# -DNOMINMAX : MIN/MAX macros defined in windows conflict with libstdc++ +CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX +# CYGWIN platform has its own ODBC library in /lib/w32api +SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32 else -ifeq (0, $(shell test -e /usr/lib/libodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -lodbc -lodbcinst COMMONFLAGS += -DPOCO_UNIXODBC else -ifeq (0, $(shell test -e /usr/lib/libiodbc$(SHAREDLIBLINKEXT); echo $$?)) +ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?)) +SYSLIBS += -lodbc -lodbcinst +COMMONFLAGS += -DPOCO_UNIXODBC +else +ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?)) SYSLIBS += -liodbc -liodbcinst COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc else +ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?)) +SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc +COMMONFLAGS += -DPOCO_IODBC +else $(error No ODBC library found. Please install unixODBC or iODBC and try again) endif endif endif +endif +endif -########################################################################################################### -# Note: # -# Do not change linking order or move this line up, these libs have to be linked in this order and last. # -########################################################################################################### +################################################################################################## +# Note: # +# Do not change linking order or move this line up, these libs have to be linked in this order. # +################################################################################################## SYSLIBS += -lltdl -ldl objects = ODBCTestSuite Driver \ diff --git a/Foundation/testsuite/Makefile b/Foundation/testsuite/Makefile index bee498c48..133ac34b3 100644 --- a/Foundation/testsuite/Makefile +++ b/Foundation/testsuite/Makefile @@ -10,5 +10,7 @@ clean all: projects projects: $(MAKE) -f Makefile-Driver $(MAKECMDGOALS) +ifneq ($(LINKMODE),STATIC) $(MAKE) -f Makefile-TestLibrary $(MAKECMDGOALS) +endif $(MAKE) -f Makefile-TestApp $(MAKECMDGOALS) diff --git a/build/rules/global b/build/rules/global index 2b65b3558..d76b67ace 100644 --- a/build/rules/global +++ b/build/rules/global @@ -162,6 +162,9 @@ else ifneq ($(DEBIANISH),) LIB64SUFFIX = $(if $(filter $(OSARCH),x86_64 sparc64 ppc64),/x86_64-linux-gnu,) endif +# Default static lib extension +STATICLIBLINKEXT = .a + # # Find out current component #