poco/Data/ODBC/ODBC.make

64 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-09-21 07:06:37 +02:00
#
# ODBC.make
#
# $Id: //poco/1.4/Data/ODBC/ODBC.make#1 $
#
# Makefile fragment for finding ODBC library
#
ifndef POCO_ODBC_INCLUDE
POCO_ODBC_INCLUDE = /usr/include
endif
ifndef POCO_ODBC_LIB
ifeq (0, $(shell test -d /usr/lib/$(OSARCH)-linux-gnu; echo $$?))
POCO_ODBC_LIB = /usr/lib/$(OSARCH)-linux-gnu
else ifeq (0, $(shell test -d /usr/lib64; echo $$?))
POCO_ODBC_LIB = /usr/lib64
else
POCO_ODBC_LIB = /usr/lib
endif
2012-09-21 07:06:37 +02:00
endif
ifeq ($(LINKMODE),STATIC)
LIBLINKEXT = .a
else
LIBLINKEXT = $(SHAREDLIBLINKEXT)
endif
INCLUDE += -I$(POCO_ODBC_INCLUDE)
SYSLIBS += -L$(POCO_ODBC_LIB)
2012-09-21 07:06:37 +02:00
##
## MinGW
##
2012-09-21 07:06:37 +02:00
ifeq ($(POCO_CONFIG),MinGW)
# -DODBCVER=0x0300: SQLHandle declaration issue
# -DNOMINMAX : MIN/MAX macros defined in windows conflict with libstdc++
CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX
2012-09-22 16:58:14 +02:00
##
## unixODBC
##
else ifeq (0, $(shell test -e $(POCO_ODBC_LIB)/libodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbc
ifeq (0, $(shell test -e $(POCO_ODBC_LIB)/libodbcinst$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbcinst
endif
2012-09-21 07:06:37 +02:00
COMMONFLAGS += -DPOCO_UNIXODBC
2012-09-22 16:58:14 +02:00
##
## iODBC
##
else ifeq (0, $(shell test -e $(POCO_ODBC_LIB)/libiodbc$(LIBLINKEXT); echo $$?))
2012-09-21 07:06:37 +02:00
SYSLIBS += -liodbc -liodbcinst
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
2012-09-22 16:58:14 +02:00
2012-12-16 20:52:29 +01:00
# TODO: OSX >= 10.8 deprecated non-Unicode ODBC API functions, silence warnings until iODBC Unicode support
COMMONFLAGS += -Wno-deprecated-declarations
2012-09-21 07:06:37 +02:00
else
$(error No ODBC library found. Please install unixODBC or iODBC or specify POCO_ODBC_LIB or set the correct libodbc library path by using --odbc-lib as option to 'configure' script and try again)
2012-09-21 07:06:37 +02:00
endif
2012-12-16 20:52:29 +01:00