1 # $NetBSD: Makefile.common,v 1.28 2012/12/07 21:19:51 adam Exp $
3 # used by databases/postgresql83-adminpack/Makefile
4 # used by databases/postgresql83-client/Makefile
5 # used by databases/postgresql83-plperl/Makefile
6 # used by databases/postgresql83-plpython/Makefile
7 # used by databases/postgresql83-pltcl/Makefile
8 # used by databases/postgresql83-server/Makefile
10 # This Makefile fragment is included by all PostgreSQL packages built from
11 # the main sources of the PostgreSQL distribution except jdbc-postgresql.
13 # The PostgreSQL package naming scheme, aside from the obvious piecewise
14 # packages, is as follows:
15 # <lang>-postgresql client-side interface to PostgreSQL
16 # postgresql-<lang> server-side module for PostgreSQL backend
18 DISTNAME= postgresql-8.3.23
20 MASTER_SITES= ${MASTER_SITE_PGSQL:=source/v${PKGVERSION_NOREV}/}
21 EXTRACT_SUFX= .tar.bz2
23 MAINTAINER?= adam@NetBSD.org
24 HOMEPAGE= http://www.postgresql.org/
25 LICENSE= postgresql-license
27 CONFLICTS+= postgresql-[0-9]*
28 CONFLICTS+= postgresql7[0-9]-*
29 CONFLICTS+= postgresql8[0-24-9]-*
30 CONFLICTS+= postgresql9[0-9]-*
32 .if !empty(PKGNAME:M*-*-*)
33 module= ${PKGNAME:C/-[0-9].*$//:C/^.*-//}
34 CONFLICTS+= postgresql8[0-24-9]-${module}-[0-9]*
35 CONFLICTS+= postgresql9[0-9]-${module}-[0-9]*
38 DISTINFO_FILE?= ${.CURDIR}/../postgresql83/distinfo
39 COMMON_FILESDIR?= ${.CURDIR}/../postgresql83/files
40 PATCHDIR?= ${.CURDIR}/../postgresql83/patches
43 USE_TOOLS+= bison gmake lex msgfmt
44 PKG_SYSCONFSUBDIR= postgresql
46 .include "../../mk/bsd.prefs.mk"
48 PG_TEMPLATE.SunOS= solaris
49 PG_TEMPLATE.IRIX= irix5
50 .if !defined(PG_TEMPLATE.${OPSYS})
51 PG_TEMPLATE.${OPSYS}= ${LOWER_OPSYS}
57 CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
58 CONFIGURE_ARGS+= --datadir=${PREFIX}/share/postgresql
59 CONFIGURE_ARGS+= --with-docdir=${PREFIX}/share/doc/postgresql
60 CONFIGURE_ARGS+= --with-template=${PG_TEMPLATE.${OPSYS}}
62 CONFIGURE_ARGS+= --enable-nls
63 CONFIGURE_ARGS+= --without-perl
64 CONFIGURE_ARGS+= --without-python
65 CONFIGURE_ARGS+= --without-readline
66 CONFIGURE_ARGS+= --without-tcl
67 CONFIGURE_ARGS+= --without-zlib
69 # PostgreSQL explicitly forbids any use of -ffast-math
70 BUILDLINK_TRANSFORM+= rm:-ffast-math
72 # USE_LIBLTDL is "yes" or "no" depending on whether we're using libltdl
73 # to provide "dlopen" functionality for the PostgreSQL backend.
74 .if ${OPSYS} == "Interix"
79 .include "../../devel/gettext-lib/buildlink3.mk"
82 .if !defined(META_PACKAGE)
84 . if !empty(USE_LIBLTDL:M[yY][eE][sS])
85 cp -f ${COMMON_FILESDIR}/dynloader-ltdl.h \
86 ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.h
87 ${ECHO} "static int dummy = 0;" \
88 > ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.c
90 touch ${WRKSRC}/src/template/dragonfly
91 cp ${WRKSRC}/src/backend/port/dynloader/freebsd.c \
92 ${WRKSRC}/src/backend/port/dynloader/dragonfly.c
93 cp ${WRKSRC}/src/backend/port/dynloader/freebsd.h \
94 ${WRKSRC}/src/backend/port/dynloader/dragonfly.h
95 cp ${WRKSRC}/src/include/port/freebsd.h \
96 ${WRKSRC}/src/include/port/dragonfly.h
97 cp ${WRKSRC}/src/makefiles/Makefile.freebsd \
98 ${WRKSRC}/src/makefiles/Makefile.dragonfly
101 # PGSQL_BLCKSZ is the size in bytes of a PostgreSQL disk page or block.
102 # This also limits the size of a tuple. The valid values are powers
103 # of 2 up to 32768, and the default size is 8196 (hardcoded in the
104 # PostgreSQL sources). Please don't change this value unless you know
105 # what you are doing.
106 BUILD_DEFS+= PGSQL_BLCKSZ
108 .if defined(PGSQL_BLCKSZ)
109 SUBST_CLASSES+= blcksz
110 SUBST_STAGE.blcksz= pre-configure
111 SUBST_MESSAGE.blcksz= Adjusting BLCKSZ.
112 SUBST_FILES.blcksz= src/include/pg_config_manual.h
113 SUBST_SED.blcksz= -e 's,define BLCKSZ.*,define BLCKSZ ${PGSQL_BLCKSZ},'
116 .include "../../databases/postgresql83/options.mk"