Norm Jacobs
2011-04-13 4158c02ccf09e2f646cf2e9e5599f186ec8c7302
commit | author | age
35a012 1 #
NJ 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 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
22 #
9aea33 23 include ../../../make-rules/shared-macros.mk
35a012 24
NJ 25 PATH=/usr/bin:/usr/gnu/bin:/usr/sbin
26
27 COMPONENT_NAME=        Python
28 COMPONENT_VERSION=    2.6.4
29 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
30 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.bz2
31 COMPONENT_ARCHIVE_HASH=    sha1:bee572680d1966501247cb2b26e0e51f94d1cd13
32 COMPONENT_ARCHIVE_URL=    http://python.org/ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
33
34 include $(WS_TOP)/make-rules/prep.mk
35 include $(WS_TOP)/make-rules/configure.mk
36 include $(WS_TOP)/make-rules/ips.mk
37
7eff8b 38 # We patch auto* files, so regenerate headers and configure
NJ 39 COMPONENT_PREP_ACTION = \
40     (cd $(@D) ; autoheader ; autoconf)
41
42 # This seems horribly wrong, but these defines break the ability to build c99
43 # compliant modules or with gcc.
44 COMPONENT_POST_CONFIGURE_ACTION = \
45     (cd $(@D) ; \
46      perl -pi -e 's/(^\#define _POSIX_C_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
47      perl -pi -e 's/^(\#define _XOPEN_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
48      perl -pi -e 's/^(\#define _XOPEN_SOURCE_EXTENDED.*)/\/* $$1 *\//' \
49             pyconfig.h)
50
35a012 51 # we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
NJ 52 # python-config
7eff8b 53 CC +=    $(CFLAGS)
35a012 54
NJ 55 C99MODE=
56 CPPFLAGS +=    -IPython
57
7eff8b 58 # so we find the ncurses headers
NJ 59 CPPFLAGS +=    -I/usr/include/ncurses
60 # enable large files how they did in JDS
61 CPPFLAGS +=    -D_LARGEFILE64_SOURCE
35a012 62 # libffi for _ctypes
NJ 63 CPPFLAGS +=    $(shell pkg-config --cflags-only-I libffi)
7eff8b 64
NJ 65 CCFLAGS +=        -norunpath -compat=5
35a012 66
NJ 67 CONFIGURE_OPTIONS  +=        --infodir=$(CONFIGURE_INFODIR)
68 CONFIGURE_OPTIONS  +=        --enable-shared
69 CONFIGURE_OPTIONS  +=        --disable-static
70 CONFIGURE_OPTIONS  +=        --with-system-ffi
71 CONFIGURE_OPTIONS  +=        --without-gcc
72 CONFIGURE_OPTIONS  +=        ac_cv_opt_olimit_ok=no
73 CONFIGURE_OPTIONS  +=        ac_cv_olimit_ok=no
74 CONFIGURE_OPTIONS  +=        CPPFLAGS="$(CPPFLAGS)"
7eff8b 75 CONFIGURE_OPTIONS  +=        CFLAGS="$(CFLAGS)"
NJ 76 CONFIGURE_OPTIONS  +=        CCSHARED="$(CC_PIC)"
77 CONFIGURE_OPTIONS  +=        CXX="$(CCC)"
78 CONFIGURE_OPTIONS  +=        CXXFLAGS="$(CCFLAGS)"
35a012 79 CONFIGURE_OPTIONS  +=        DFLAGS="-$(BITS)"
NJ 80 COMPONENT_BUILD_ENV  +=        DFLAGS="-$(BITS)"
81
4158c0 82 COMPONENT_TEST_TARGETS =    test
NJ 83
35a012 84 # 64 bit shared objects need to go in a 64-bit directory
NJ 85 COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.6/lib-dynload
86
87 # common targets
88 build:        $(BUILD_32_and_64)
89
90 $(INSTALL_32):    $(INSTALL_64)
91
92 install:    $(INSTALL_32_and_64)
93
4158c0 94 test:        $(TEST_32_and_64)
35a012 95
NJ 96 BUILD_PKG_DEPENDENCIES =    $(BUILD_TOOLS)
97
98 include $(WS_TOP)/make-rules/depend.mk