summaryrefslogtreecommitdiff
path: root/databases/freetds/Makefile
blob: 19d4ac1ab19bd1ec82defbebf4bdda5cca336295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# $NetBSD: Makefile,v 1.53 2015/04/26 11:52:18 ryoon Exp $

DISTNAME=	freetds-0.91
PKGREVISION=	3
CATEGORIES=	databases
MASTER_SITES=	ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.freetds.org/
COMMENT=	Implementation of TDS protocol used by Sybase and MS-SQL servers
LICENSE=	gnu-lgpl-v2

USE_LIBTOOL=		yes
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+=	--datadir=${PREFIX}/share
CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
CONFIGURE_ARGS+=	--with-tdsver=7.0
# no thread-safe resolver functions on NetBSD
CONFIGURE_ARGS+=	--disable-threadsafe

.include "../../mk/bsd.prefs.mk"

# Fails to build the shared lib on SunOS with -O2 or greater
.if ${OPSYS} == "SunOS"
BUILDLINK_TRANSFORM+=	rm:-O[23]
.endif

EGDIR=		${PREFIX}/share/examples/freetds
CONF_FILES+=	${EGDIR}/freetds.conf ${PKG_SYSCONFDIR}/freetds.conf
CONF_FILES+=	${EGDIR}/locales.conf ${PKG_SYSCONFDIR}/locales.conf
CONF_FILES+=	${EGDIR}/pool.conf ${PKG_SYSCONFDIR}/pool.conf

# doc/Makefile ignores TARGET_DOCDIR for the files listed in
# nobase_data_DATA.  Make the Makefiles think the documentation is
# in doc/freetds through symlinks and by overriding DOCDIR.
MAKE_FLAGS+=		DOCDIR=doc/freetds
INSTALL_MAKE_FLAGS+=	${MAKE_FLAGS} ETC=${DESTDIR}${EGDIR}

SUBST_CLASSES+=			visibility
SUBST_STAGE.visibility+=	pre-configure
SUBST_MESSAGE.visibility+=	Turn off visibility for GCC 4.2
SUBST_FILES.visibility+=	src/tds/tds_checks.h
SUBST_FILES.visibility+=	include/*.h
SUBST_FILES.visibility+=	include/*/*.h
SUBST_SED.visibility+=		-e 's,!defined(__MINGW32__),!defined(__MINGW32__) \&\& !(__GNUC__ == 4 \&\& __GNUC_MINOR__ == 2),g'

pre-build:
	cd ${WRKSRC}/doc/doc && ln -sf ${DISTNAME} freetds

.include "options.mk"

.include "../../converters/libiconv/buildlink3.mk"
# rl_on_new_line, rl_reset_line_state
.include "../../devel/readline/buildlink3.mk"
.include "../../devel/libltdl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"