- Unify the way to choose between ODBC flavors (WITH_IODBC / WITH_UNIXODBC).
PR: ports/103293 Submitted by: Ganael Laplanche <ganael.laplanche@martymac.com> Approved by: girgen (databases/postgresql-odbc), fjoe (databases/libodbc++), sergey@network-asp.biz (databases/mysql-connector-odbc, timeout), delphij@FreeBSD.org (net/openldap23-server), mat@FreeBSD.org (databases/p5-DBD-ODBC)
This commit is contained in:
@@ -23,14 +23,20 @@ CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL}
|
||||
CONFIGURE_ARGS= --with-isqlxx
|
||||
|
||||
# libodbc++ needs an ODBC driver manager to be installed, and it supports
|
||||
# both iODBC and unixODBC. The following variable may be set at build-time
|
||||
# to either "iodbc" or "unixodbc", with the latter being the default:
|
||||
DRIVER_MANAGER?= unixodbc
|
||||
# both iODBC and unixODBC.
|
||||
|
||||
.if ${DRIVER_MANAGER} == "iodbc"
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_IODBC?= yes
|
||||
.endif
|
||||
|
||||
.if defined(WITH_IODBC)
|
||||
LIB_DEPENDS= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
CONFIGURE_ARGS+= --with-iodbc=${LOCALBASE}
|
||||
.else # assume we're using unixODBC
|
||||
.elif defined(WITH_UNIXODBC)
|
||||
LIB_DEPENDS= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
CONFIGURE_ARGS+= --with-odbc=${LOCALBASE}
|
||||
CONFIGURE_ENV= LIBS="${PTHREAD_LIBS}"
|
||||
|
||||
@@ -32,22 +32,30 @@ PLIST_SUB= VER=${PORTVERSION}
|
||||
PORTDOCS= README
|
||||
|
||||
# MyODBC needs an ODBC driver manager to be installed, and it supports both
|
||||
# iODBC and unixODBC. The following variable may be set at built-time to
|
||||
# either "iodbc" or "unixodbc", with the former being the default:
|
||||
DRIVER_MANAGER?= unixodbc
|
||||
# iODBC and unixODBC.
|
||||
|
||||
.if ${DRIVER_MANAGER} == "unixodbc"
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_UNIXODBC?= yes
|
||||
.endif
|
||||
|
||||
.if defined(WITH_UNIXODBC)
|
||||
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
CONFIGURE_ARGS+= --with-odbc-ini=${LOCALBASE}/etc/odbc.ini \
|
||||
--with-unixODBC=${LOCALBASE}
|
||||
CFLAGS+= ${PTHREAD_LIBS}
|
||||
.else # assume we're using iodbc
|
||||
DRIVER_MANAGER= unixodbc
|
||||
.elif defined(WITH_IODBC)
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
CONFIGURE_ARGS+= --with-iODBC=${LOCALBASE} \
|
||||
--with-iodbc-includes=${LOCALBASE}/include \
|
||||
--with-iodbc-libs=${LOCALBASE}/lib \
|
||||
--with-odbc-ini=${LOCALBASE}/etc/libiodbc/odbc.ini
|
||||
EXTRA_PATCHES= ${PATCHDIR}/myodbc-iodbc-patch
|
||||
DRIVER_MANAGER= iodbc
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
|
||||
@@ -21,23 +21,24 @@ CONFIGURE_ARGS+= -o ${LOCALBASE}
|
||||
|
||||
MAN3= DBD::ODBC.3
|
||||
|
||||
OPTIONS= IODBC "Link with libiodbc" on \
|
||||
ODBC "Link with unixODBC (Only with 5.x+)" off
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITH_IODBC) && defined(WITH_ODBC)
|
||||
BROKEN= "Should only select one of ODBC and IODBC"
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
.if defined(WITH_ODBC) && ${OSVERSION} < 500016
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_IODBC?= yes
|
||||
.endif
|
||||
|
||||
.if defined(WITH_UNIXODBC) && ${OSVERSION} < 500016
|
||||
IGNORE= Due to some obscure -pthread things, you can not have this work
|
||||
.endif
|
||||
|
||||
.if !defined(WITHOUT_IODBC)
|
||||
.if defined(WITH_IODBC)
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
MYODBC= iodbc
|
||||
.endif
|
||||
.if defined(WITH_ODBC)
|
||||
.elif defined(WITH_UNIXODBC)
|
||||
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
MYODBC= unixodbc
|
||||
post-configure:
|
||||
|
||||
@@ -19,23 +19,28 @@ MAINTAINER= girgen@FreeBSD.org
|
||||
COMMENT= PostgreSQL ODBC client support
|
||||
|
||||
# PostgreSQL ODBC support needs an ODBC driver manager to be
|
||||
# installed, and it supports both iODBC and unixODBC. The following
|
||||
# variable may be set at built-time to either "iodbc" or "unixodbc",
|
||||
# with the former being the default:
|
||||
DRIVER_MANAGER?= iodbc
|
||||
# installed, and it supports both iODBC and unixODBC.
|
||||
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_IODBC?= yes
|
||||
.endif
|
||||
|
||||
# Note that there is a potential conflict between unixODBC's and
|
||||
# postgres' libodbcpsql.so. unixODBC installs versions `1' & `2' of
|
||||
# the named lib, while postgres installs version `0'. The postgres
|
||||
# folks say their is the best, so you might be better off removing
|
||||
# the others?
|
||||
.if ${DRIVER_MANAGER} == "unixodbc"
|
||||
.if defined(WITH_IODBC)
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
CONFIGURE_ARGS+= --with-iodbc --with-odbcinst=${LOCALBASE}/etc/libiodbc
|
||||
.elif defined(WITH_UNIXODBC)
|
||||
PKGNAMESUFFIX= -unixodbc
|
||||
CONFIGURE_ARGS+= --with-unixodbc
|
||||
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
.else # assume we're using iodbc
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
CONFIGURE_ARGS+= --with-iodbc --with-odbcinst=${LOCALBASE}/etc/libiodbc
|
||||
.endif
|
||||
|
||||
USE_GMAKE= YES
|
||||
|
||||
@@ -57,15 +57,20 @@ CONFIGURE_ARGS+= --with-pthread="${PTHREAD_LIBS}"
|
||||
.endif
|
||||
|
||||
# The odbc module needs an ODBC driver manager to be installed, and it
|
||||
# supports both iODBC and unixODBC. The following variable may be set at
|
||||
# build-time to either "iodbc" or "unixodbc", with the former being the
|
||||
# default:
|
||||
ODBC?= iodbc
|
||||
# supports both iODBC and unixODBC.
|
||||
|
||||
.if ${ODBC} == "unixodbc"
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_IODBC?= yes
|
||||
.endif
|
||||
|
||||
.if defined(WITH_UNIXODBC)
|
||||
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
CONFIGURE_ARGS+= --with-odbc=-lodbc
|
||||
.else # assume we're using iodbc
|
||||
.elif defined(WITH_IODBC)
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
CONFIGURE_ARGS+= --with-odbc=-liodbc
|
||||
.endif
|
||||
|
||||
@@ -316,16 +316,21 @@ PLIST_SUB+= BACK_PERL="@comment "
|
||||
CONFIGURE_ARGS+= --enable-spasswd
|
||||
.endif
|
||||
|
||||
.if defined(WITH_IODBC) && defined(WITH_UNIXODBC)
|
||||
IGNORE= selected mutually exclusive options: WITH_IODBC and WITH_UNIXODBC
|
||||
.endif
|
||||
|
||||
.if !defined(WITH_IODBC) && !defined(WITH_UNIXODBC)
|
||||
WITH_IODBC?= yes
|
||||
.endif
|
||||
|
||||
.if defined(WITH_ODBC)
|
||||
CONFIGURE_ARGS+= --enable-sql=${BACKEND_ENABLE}
|
||||
PLIST_SUB+= BACK_SQL=${BACKEND_PLIST}
|
||||
WITH_ODBC_TYPE?= iODBC
|
||||
.if ${WITH_ODBC_TYPE:L} == iodbc
|
||||
.if defined(WITH_IODBC)
|
||||
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
|
||||
.elif ${WITH_ODBC_TYPE:L} == unixodbc
|
||||
.elif defined(WITH_UNIXODBC)
|
||||
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
||||
.else
|
||||
BROKEN= choose either iODBC or unixODBC for WITH_ODBC_TYPE
|
||||
.endif
|
||||
.else
|
||||
PLIST_SUB+= BACK_SQL="@comment "
|
||||
|
||||
Reference in New Issue
Block a user