1
|
1 |
#
|
|
2 |
# CDDL HEADER START
|
|
3 |
#
|
|
4 |
# The contents of this file are subject to the terms of the
|
|
5 |
# Common Development and Distribution License (the "License").
|
|
6 |
# You may not use this file except in compliance with the License.
|
|
7 |
#
|
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
9 |
# or http://www.opensolaris.org/os/licensing.
|
|
10 |
# See the License for the specific language governing permissions
|
|
11 |
# and limitations under the License.
|
|
12 |
#
|
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
15 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
18 |
#
|
|
19 |
# CDDL HEADER END
|
|
20 |
#
|
|
21 |
|
|
22 |
#
|
6
|
23 |
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
1
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
6
|
26 |
#ident "@(#)Makefile.sfw 1.2 10/01/08 SMI"
|
1
|
27 |
#
|
|
28 |
|
|
29 |
include ../../Makefile.cmd
|
|
30 |
|
|
31 |
VER = $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
|
|
32 |
VER64 = $(VER)-64
|
|
33 |
TARBALL = $(VER).tar.bz2
|
|
34 |
PGMAJVER = `echo $(COMPONENT_VERSION:sh) | cut -d. -f-2`
|
|
35 |
PATCHES:sh = echo Patches/*.patch
|
|
36 |
|
|
37 |
# We disable rpath for all, because libpq is finally in /usr/lib.
|
|
38 |
# But we need still set rpath for libecpg. We need to patch libecpg
|
|
39 |
# Makefile separately.
|
|
40 |
|
|
41 |
CONFIGURE_OPTIONS = --prefix=/usr/postgres/$(PGMAJVER)
|
|
42 |
CONFIGURE_OPTIONS += --exec-prefix=/usr/postgres/$(PGMAJVER)
|
|
43 |
CONFIGURE_OPTIONS += --datadir=/usr/postgres/$(PGMAJVER)/share
|
|
44 |
CONFIGURE_OPTIONS += --sysconfdir=/etc/postgres
|
|
45 |
CONFIGURE_OPTIONS += --mandir=/usr/postgres/$(PGMAJVER)/man
|
|
46 |
CONFIGURE_OPTIONS += --includedir=/usr/postgres/$(PGMAJVER)/include
|
|
47 |
CONFIGURE_OPTIONS += --sharedstatedir=/var/postgres/$(PGMAJVER)
|
|
48 |
CONFIGURE_OPTIONS += --localstatedir=/var/postgres/$(PGMAJVER)
|
|
49 |
CONFIGURE_OPTIONS += --localedir=/usr/share/locale
|
|
50 |
CONFIGURE_OPTIONS += --docdir=/usr/postgres/$(PGMAJVER)/doc
|
|
51 |
CONFIGURE_OPTIONS += --htmldir=/usr/postgres/$(PGMAJVER)/doc
|
|
52 |
CONFIGURE_OPTIONS += --enable-nls
|
|
53 |
CONFIGURE_OPTIONS += --with-system-tzdata=/usr/share/lib/zoneinfo
|
|
54 |
CONFIGURE_OPTIONS += --with-tcl
|
|
55 |
CONFIGURE_OPTIONS += --with-python
|
|
56 |
CONFIGURE_OPTIONS += --with-pam
|
|
57 |
CONFIGURE_OPTIONS += --with-openssl
|
|
58 |
CONFIGURE_OPTIONS += --with-libedit-preferred
|
|
59 |
CONFIGURE_OPTIONS += --with-libxml
|
|
60 |
CONFIGURE_OPTIONS += --with-libxslt
|
|
61 |
CONFIGURE_OPTIONS += --with-gssapi
|
|
62 |
CONFIGURE_OPTIONS += --enable-thread-safety
|
|
63 |
CONFIGURE_OPTIONS += --enable-dtrace
|
|
64 |
CONFIGURE_OPTIONS += --enable-integer-datetimes
|
|
65 |
CONFIGURE_OPTIONS += --disable-rpath
|
|
66 |
CONFIGURE_OPTIONS += --with-includes=$(ROOT)/usr/include
|
|
67 |
CONFIGURE_OPTIONS += --with-tclconfig=$(ROOT)/usr/lib
|
|
68 |
|
|
69 |
CONFIGURE_OPTIONS32 = $(CONFIGURE_OPTIONS)
|
|
70 |
CONFIGURE_OPTIONS32 += --with-perl
|
|
71 |
CONFIGURE_OPTIONS32 += --bindir=/usr/postgres/$(PGMAJVER)/bin
|
|
72 |
CONFIGURE_OPTIONS32 += --libexecdir=/usr/postgres/$(PGMAJVER)/bin
|
|
73 |
CONFIGURE_OPTIONS32 += --sbindir=/usr/postgres/$(PGMAJVER)/bin
|
|
74 |
CONFIGURE_OPTIONS32 += --libdir=/usr/postgres/$(PGMAJVER)/lib
|
|
75 |
CONFIGURE_OPTIONS32 += --with-libs=$(ROOT)/lib:$(ROOT)/usr/lib:/usr/lib
|
|
76 |
|
|
77 |
CONFIGURE_OPTIONS64 = $(CONFIGURE_OPTIONS)
|
|
78 |
CONFIGURE_OPTIONS64 += --bindir=/usr/postgres/$(PGMAJVER)/bin/$(MACH64)
|
|
79 |
CONFIGURE_OPTIONS64 += --libexecdir=/usr/postgres/$(PGMAJVER)/bin/$(MACH64)
|
|
80 |
CONFIGURE_OPTIONS64 += --sbindir=/usr/postgres/$(PGMAJVER)/bin/$(MACH64)
|
|
81 |
CONFIGURE_OPTIONS64 += --libdir=/usr/postgres/$(PGMAJVER)/lib/$(MACH64)
|
|
82 |
CONFIGURE_OPTIONS64 += --with-libs=$(ROOT)/lib/$(MACH64):$(ROOT)/usr/lib/$(MACH64):/usr/lib/$(MACH64)
|
|
83 |
|
|
84 |
# We need /usr/sbin for dtrace
|
|
85 |
SFW_PATH="$(PATH):/usr/sbin"
|
|
86 |
CFLAGS_COM =-erroff=E_STATEMENT_NOT_REACHED
|
|
87 |
TARGET_ENV += CC="$(CC)"
|
|
88 |
TARGET_ENV += LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk"
|
|
89 |
TARGET_ENV += MAKE="$(GMAKE)"
|
6
|
90 |
TARGET_ENV += INSTALL="$(INSTALL_PROTO)"
|
1
|
91 |
TARGET_ENV += PATH="$(SFW_PATH)"
|
|
92 |
|
|
93 |
TARGET_ENV32 = $(TARGET_ENV)
|
6
|
94 |
TARGET_ENV32 += PYTHON="$(PYTHON24)"
|
1
|
95 |
TARGET_ENV32 += CFLAGS="$(CFLAGS) $(CFLAGS_COM)"
|
|
96 |
|
|
97 |
TARGET_ENV64 = $(TARGET_ENV)
|
6
|
98 |
TARGET_ENV64 += PYTHON="$(PYTHON24_64)"
|
1
|
99 |
TARGET_ENV64 += CFLAGS="$(CFLAGS64) $(CFLAGS_COM)"
|
|
100 |
|
|
101 |
all:= TARGET = all
|
|
102 |
install:= TARGET = install
|
|
103 |
|
|
104 |
all: pg32all pg64all
|
|
105 |
|
|
106 |
pg32all: pg32 pg32contrib
|
|
107 |
|
|
108 |
pg64all: pg64 pg64contrib
|
|
109 |
|
|
110 |
pg32: $(VER)/config.status
|
|
111 |
(cd $(VER); env - $(GMAKE) $(TARGET) PATH="$(SFW_PATH)")
|
|
112 |
|
|
113 |
pg32contrib: pg32
|
|
114 |
(cd $(VER)/contrib; env - $(GMAKE) $(TARGET) PATH="$(SFW_PATH)")
|
|
115 |
|
|
116 |
pg64: $(VER64)/config.status
|
|
117 |
(cd $(VER64); env - $(GMAKE) $(TARGET) PATH="$(SFW_PATH)")
|
|
118 |
|
|
119 |
pg64contrib: pg64
|
|
120 |
(cd $(VER64)/contrib; env - $(GMAKE) $(TARGET) PATH="$(SFW_PATH)")
|
|
121 |
|
|
122 |
install: install-protofix
|
|
123 |
|
|
124 |
install-target: pg32install pg64install
|
|
125 |
|
|
126 |
pg32install: $(VER)/config.status
|
|
127 |
(cd $(VER); env - $(GMAKE) $(TARGET) DESTDIR=$(ROOT) PATH="$(SFW_PATH)")
|
|
128 |
(cd $(VER)/contrib; env - $(GMAKE) $(TARGET) DESTDIR=$(ROOT) PATH="$(SFW_PATH)")
|
|
129 |
(cd $(VER)/src/test/regress; env - $(GMAKE) install-tests DESTDIR=$(ROOT) PATH="$(SFW_PATH)")
|
|
130 |
|
|
131 |
$(SH) ./install-sfw ${PGMAJVER} ${VER}
|
|
132 |
|
|
133 |
pg64install: $(VER64)/config.status
|
|
134 |
for SRCDIR in src config contrib; do\
|
|
135 |
(cd $(VER64)/$${SRCDIR}; env - $(GMAKE) $(TARGET) DESTDIR=$(ROOT) PATH="$(SFW_PATH)")\
|
|
136 |
done
|
|
137 |
(cd $(VER64)/src/test/regress; env - $(GMAKE) install-lib DESTDIR=$(ROOT) PATH="$(SFW_PATH)")
|
|
138 |
MACH64=$(MACH64) $(SH) ./install-sfw-64 ${PGMAJVER} ${VER}
|
|
139 |
|
|
140 |
install-protofix: install-target
|
|
141 |
for pkg in $(COMPONENT_PACKAGES:sh); do \
|
|
142 |
$(SRC)/tools/protofix --pkg $$pkg --perm ; \
|
|
143 |
done
|
|
144 |
|
|
145 |
$(VER)/config.status: $(VER)/.patched
|
|
146 |
(cd $(VER) ; env - ./configure $(CONFIGURE_OPTIONS32) $(TARGET_ENV32))
|
|
147 |
|
|
148 |
$(VER64)/config.status: $(VER64)/.patched
|
|
149 |
(cd $(VER64) ; env - ./configure $(CONFIGURE_OPTIONS64) $(TARGET_ENV64))
|
|
150 |
|
|
151 |
clean:
|
|
152 |
-rm -rf $(VER)
|
|
153 |
-rm -rf $(VER64)
|
|
154 |
|
|
155 |
include ../../Makefile.targ
|
|
156 |
|
|
157 |
FRC:
|
|
158 |
|