1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-22 00:35:15 +00:00
freebsd-ports/databases/hk_classes/Makefile
Tijl Coosemans 9f8b4bcde3 Support LIBS like LDFLAGS.
- Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV.
- Add an option helper for LIBS.
- Adjust all ports that already use LIBS.  Also remove references to
  PTHREAD_CFLAGS and PTHREAD_LIBS while here.
- Some ports did not support having a LIBS environment variable and
  required additional patches.

Somewhat simplified a linker command line looks like:

${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS}

where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and
LIBS can be controlled by us.  If possible -L and -l flags need to be
added to LIBS to make sure they appear after any -L and -l flags set by
upstream.  Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this
may appear too early on the command line causing installed libraries to
be linked in instead of freshly built ones.

Additional changes:
benchmarks/netio: Replace WITH_IPV6 with an IPV6 option.
comms/gnokii: Replace some patches with USES=pathfix.  Also remove -fPIC.
graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR.
graphics/visionworkbench: Remove FreeBSD 7 support.
multimedia/libmovtar: New LIB_DEPENDS syntax.
multimedia/opencinematools: Use standard do-build.
net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins)
net-mgmt/nagios: Remove -fPIC.
net-mgmt/nagios4: Remove -fPIC.
print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036.
security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with
ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS.  This skips a test
in configure that falsely detects pthread_mutexattr_init in our libc.
sysutils/dar: Fix iconv detection.
x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD
hack and use $CXX as linker as on other platforms.

PR:		190592
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2014-06-11 14:49:59 +00:00

148 lines
4.1 KiB
Makefile

# Created by: arved
# $FreeBSD$
PORTNAME= hk_classes
PORTVERSION= 0.8.3
PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= SF/hk-classes/${PORTNAME}/${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= C++ Library for rapid development of database applications
BUILD_DEPENDS= ${LOCALBASE}/include/argp.h:${PORTSDIR}/devel/argp-standalone
LIB_DEPENDS= libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig \
libxml2.so:${PORTSDIR}/textproc/libxml2
USES= pkgconfig gettext iconv tar:bzip2
USE_PYTHON= yes
LIBS+= -L${LOCALBASE}/lib -largp -lintl
USE_AUTOTOOLS= libtool
CONFIGURE_ENV+= PYTHON_VERSION=${PYTHON_VERSION:S/python//}
CONFIGURE_ARGS+=--with-python-libdir=${PYTHON_LIBDIR} \
--with-python-incdir=${PYTHON_INCLUDEDIR} \
--with-fontconfig-incdir=${LOCALBASE}/include/fontconfig \
--with-fontconfig-libdir=${LOCALBASE}/lib \
--without-firebird
USE_LDCONFIG= ${PREFIX}/lib/hk_classes/
INSTALLS_EGGINFO= yes
PYDISTUTILS_PKGVERSION= 1.1
NOT_FOR_ARCHS= ia64
NOT_FOR_ARCHS_REASON_ia64= Does not build
OPTIONS_DEFINE= MYSQL PGSQL ODBC PARADOX SQLITE2 SQLITE3 DBASE
OPTIONS_DEFAULT= MYSQL
SQLITE3_DESC= Enable SQLite 3 backend
SQLITE2_DESC= Enable SQLite 2 backend
PARADOX_DESC= Enable paradox backend
DBASE_DESC= Enable Dbase backend
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL= yes
CONFIGURE_ARGS+= --with-mysql-dir=${LOCALBASE} \
--with-mysql-incdir=${LOCALBASE}/include/mysql \
--with-mysql-libdir=${LOCALBASE}/lib/mysql
CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib -L${LOCALBASE}/lib/mysql"
CPPFLAGS+= -I${LOCALBASE}/include
PLIST_SUB+= MYSQL=""
.else
CONFIGURE_ARGS+= --without-mysql
PLIST_SUB+= MYSQL="@comment "
.endif
.if ${PORT_OPTIONS:MDBASE}
PLIST_SUB+= DBASE=""
.else
CONFIGURE_ARGS+= --without-dbase
PLIST_SUB+= DBASE="@comment "
.endif
.if ${PORT_OPTIONS:MPOSTGRESQL}
USES+= pgsql
CONFIGURE_ARGS+= --with-postgres-incdir=${LOCALBASE}/include/ \
--with-postgres-libdir=${LOCALBASE}/lib
CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib"
CPPFLAGS+= -I${LOCALBASE}/include
PLIST_SUB+= POSTGRESQL=""
.else
CONFIGURE_ARGS+= --without-postgres
PLIST_SUB+= POSTGRESQL="@comment "
.endif
.if ${PORT_OPTIONS:MODBC}
LIB_DEPENDS+= libodbc.so:${PORTSDIR}/databases/unixODBC
CONFIGURE_ARGS+= --with-odbc-incdir=${LOCALBASE}/include/\
--with-odbc-libdir=${LOCALBASE}/lib
PLIST_SUB+= ODBC=""
.else
CONFIGURE_ARGS+= --without-odbc
PLIST_SUB+= ODBC="@comment "
.endif
.if ${PORT_OPTIONS:MPARADOX}
LIB_DEPENDS+= libpx.so:${PORTSDIR}/databases/pxlib
CONFIGURE_ARGS+= --with-paradox-incdir=${LOCALBASE}/include/\
--with-paradox-libdir=${LOCALBASE}/lib
PLIST_SUB+= PARADOX=""
.else
CONFIGURE_ARGS+= --without-paradox
PLIST_SUB+= PARADOX="@comment "
.endif
# XXX does not work yet
.if ${PORT_OPTIONS:MMSACCESS}
LIB_DEPENDS+= libmdb.so:${PORTSDIR}/databases/mdbtools
CONFIGURE_ARGS+= --with-mdb-incdir=${LOCALBASE}/include/\
--with-mdb-libdir=${LOCALBASE}/lib
PLIST_SUB+= MSACCESS=""
.else
CONFIGURE_ARGS+= --without-mdb
PLIST_SUB+= MSACCESS="@comment "
.endif
# XXX does not work yet
CONFIGURE_ARGS+= --without-xbase
.if ${PORT_OPTIONS:MSQLITE2}
LIB_DEPENDS+= libsqlite.so.2:${PORTSDIR}/databases/sqlite2
CONFIGURE_ARGS+= --with-sqlite-incdir=${LOCALBASE}/include/\
--with-sqlite-libdir=${LOCALBASE}/lib
PLIST_SUB+= SQLITE2=""
.else
CONFIGURE_ARGS+= --without-sqlite
PLIST_SUB+= SQLITE2="@comment "
.endif
.if ${PORT_OPTIONS:MSQLITE3}
LIB_DEPENDS+= libsqlite3.so:${PORTSDIR}/databases/sqlite3
CONFIGURE_ARGS+= --with-sqlite-incdir3=${LOCALBASE}/include/\
--with-sqlite-libdir3=${LOCALBASE}/lib
PLIST_SUB+= SQLITE3=""
.else
CONFIGURE_ARGS+= --without-sqlite3
PLIST_SUB+= SQLITE3="@comment "
.endif
post-patch:
${REINPLACE_CMD} -e "s|INCLUDES = -I../hk_classes \
-I./pxlib|INCLUDES = -I../hk_classes -I./pxlib \
-I${LOCALBASE}/include|g" \
${WRKSRC}/hk_paradoxclasses/Makefile.in
${REINPLACE_CMD} -e "s|python setup.py|${PYTHON_CMD} setup.py|" \
${WRKSRC}/python/Makefile.in
post-configure:
${REINPLACE_CMD} -e "s| -I|','|g" ${WRKSRC}/python/setup.py
post-install:
@${SED} -e 's#%%PREFIX%%#${PREFIX}#' ${FILESDIR}/hk_classes.sh > \
${PREFIX}/etc/rc.d/hk_classes.sh; \
${CHMOD} a+x ${PREFIX}/etc/rc.d/hk_classes.sh
.include <bsd.port.mk>