2012-09-21 07:06:37 +02:00
|
|
|
#
|
|
|
|
# ODBC.make
|
|
|
|
#
|
|
|
|
# Makefile fragment for finding ODBC library
|
|
|
|
#
|
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
ifndef POCO_ODBC_INCLUDE
|
2023-11-03 00:10:01 +01:00
|
|
|
ifeq (0, $(shell test -e /usr/include/sql.h; echo $$?))
|
2012-09-25 04:24:56 +02:00
|
|
|
POCO_ODBC_INCLUDE = /usr/include
|
2023-11-03 00:10:01 +01:00
|
|
|
else ifeq (0, $(shell test -e /opt/homebrew/include; echo $$?))
|
|
|
|
POCO_ODBC_INCLUDE = /opt/homebrew/include
|
|
|
|
endif
|
2012-09-25 04:24:56 +02:00
|
|
|
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
|
2023-11-03 00:10:01 +01:00
|
|
|
else ifeq (0, $(shell test -d /opt/homebrew/lib; echo $$?))
|
|
|
|
POCO_ODBC_LIB = /opt/homebrew/lib
|
2017-09-09 11:14:06 +02:00
|
|
|
else
|
2012-09-25 04:24:56 +02:00
|
|
|
POCO_ODBC_LIB = /usr/lib
|
|
|
|
endif
|
2012-09-21 07:06:37 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LINKMODE),STATIC)
|
|
|
|
LIBLINKEXT = .a
|
|
|
|
else
|
2015-11-10 14:05:12 +01:00
|
|
|
ifeq ($(OSNAME), CYGWIN)
|
|
|
|
LIBLINKEXT = $(IMPLIBLINKEXT)
|
|
|
|
else
|
2012-09-21 07:06:37 +02:00
|
|
|
LIBLINKEXT = $(SHAREDLIBLINKEXT)
|
|
|
|
endif
|
2015-11-10 14:05:12 +01:00
|
|
|
endif
|
2012-09-21 07:06:37 +02:00
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
INCLUDE += -I$(POCO_ODBC_INCLUDE)
|
|
|
|
SYSLIBS += -L$(POCO_ODBC_LIB)
|
2012-09-21 07:06:37 +02:00
|
|
|
|
2012-09-25 04:24:56 +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
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
##
|
|
|
|
## unixODBC
|
|
|
|
##
|
|
|
|
else ifeq (0, $(shell test -e $(POCO_ODBC_LIB)/libodbc$(LIBLINKEXT); echo $$?))
|
2014-04-30 06:06:01 +02:00
|
|
|
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
|
|
|
|
2012-09-25 04:24:56 +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
|
2012-09-25 04:24:56 +02:00
|
|
|
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
|
2012-09-22 16:58:14 +02:00
|
|
|
|
2012-09-21 07:06:37 +02:00
|
|
|
else
|
2012-09-25 04:24:56 +02:00
|
|
|
$(error No ODBC library found. Please install unixODBC or iODBC or specify POCO_ODBC_LIB and try again)
|
2012-09-21 07:06:37 +02:00
|
|
|
endif
|
2012-12-16 20:52:29 +01:00
|
|
|
|