Makefile revision 3901
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# CDDL HEADER START
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# The contents of this file are subject to the terms of the
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# Common Development and Distribution License (the "License").
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# You may not use this file except in compliance with the License.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# or http://www.opensolaris.org/os/licensing.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# See the License for the specific language governing permissions
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# and limitations under the License.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# When distributing Covered Code, include this CDDL HEADER in each
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# If applicable, add the following below this CDDL HEADER, with the
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# fields enclosed by brackets "[]" replaced with your own identifying
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# information: Portions Copyright [yyyy] [name of copyright owner]
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# CDDL HEADER END
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorceinclude ../../make-rules/shared-macros.mk
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorcePATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# I want to override PERL_VERSION and PERL_ARCH because when building
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# a new version of perl it probably isn't installed so shared-macros.mk
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# can't call it.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_NAME= perl
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_VERSION= 5.12.5
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorcePERL_VERSION= 5.12
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_PROJECT_URL= http://www.perl.org/
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_ARCHIVE_HASH= \
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce sha256:10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_ARCHIVE_URL= http://www.cpan.org/src/5.0/$(COMPONENT_ARCHIVE)
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_BUGDB= utility/perl
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceTPNO= 9223
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorceinclude $(WS_MAKE_RULES)/prep.mk
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorceinclude $(WS_MAKE_RULES)/configure.mk
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorceinclude $(WS_MAKE_RULES)/ips.mk
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# Override these compiler settings because they are causing problems
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# in the ON build of the contrib components.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# ON doesn't use or need these settings or the compiler has some of them
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# on by default.
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorce# This also produces a perl more inline with past perl's. For better
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorce# or worse.
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorce#
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorcestudio_XBITS=
7c69221077c780e62f6c536e78675f2dc1c131bcMichal Zidekstudio_XREGS=
22a21e910fd216ec1468fe769dcc29f1621a52a4Ondrej Kosstudio_IROPTS=
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorcestudio_C99MODE=
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorcestudio_ALIGN=
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorcestudio_MT=
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorce
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce# Sparc optimization -xO4 makes perl dtrace probes broken
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorcestudio_OPT.sparc.32=-xO3
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorce
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce#
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce# The extra Configure parameters (cf_email, cf_by, myhostname) and
c9b0071bfcb8eb8c71e40248de46d23aceecc0f3Pavel Reichl# the gawk and sed that follow are attempting to sanatize the
c9b0071bfcb8eb8c71e40248de46d23aceecc0f3Pavel Reichl# resulting config.sh of values from our build environment that
c9b0071bfcb8eb8c71e40248de46d23aceecc0f3Pavel Reichl# are discoverable in perl's config via "perl -V".
dfd71fc92db940b2892cc996911cec03d7b6c52bSimo Sorce# I'm assuming our compilers live on a path that contains "SUNWspro".
f9961e5f82e0ef474d6492371bfdf9e74e208a99Pavel Březina# If that changes the sed filter needs to change.
f9961e5f82e0ef474d6492371bfdf9e74e208a99Pavel Březina#
e5f455afbc2d149527bfd08f4e89903a3a8da17aPavel Březina
9cb46bc62f22e0104f1b41a423b014c281ef5fc2Jakub Hrozek# That last bit re-runs bison to regenerate perly.h.
9cb46bc62f22e0104f1b41a423b014c281ef5fc2Jakub Hrozek
9cb46bc62f22e0104f1b41a423b014c281ef5fc2Jakub HrozekCONFIGURE_SCRIPT = $(SOURCE_DIR)/Configure
7caf7ed4f2eae1ec1c0717b4ee6ce78bdacd5926Jakub HrozekCONFIGURE_ENV += MAKE=$(GMAKE)
dcc6877aa2e2dd63a9dc9c411a9c58feaeb36b9aStephen GallagherCONFIGURE_ENV += PATH=$(dir $(CC)):$(PATH)
bc30ce9b7d588a17e58012e699986f0d6898b791Pavel BřezinaCONFIGURE_OPTIONS = \
b5ee224324b0158641d9b110f81d2bc6eddddc13Pavel Reichl -Dprefix=/usr/perl5/$(PERL_VERSION) \
2a96981a0ac781d01e5bba473409ed2bdf4cd4e0Jakub Hrozek -Dprivlib=/usr/perl5/$(PERL_VERSION)/lib \
e81deec535d11912b87954c81a1edd768c1386c9Jakub Hrozek -Dsitelib=/usr/perl5/site_perl/$(PERL_VERSION) \
4dd38025efda88f123eac672f87d3cda12f050c8Jakub Hrozek -Dvendorprefix=/usr/perl5/$(PERL_VERSION) \
4dd38025efda88f123eac672f87d3cda12f050c8Jakub Hrozek -Dvendorlib=/usr/perl5/vendor_perl/$(PERL_VERSION) \
0161a3c5637a0c0092bf54c436bb3d6508d7df26Jakub Hrozek -Dlibperl=libperl.so \
0161a3c5637a0c0092bf54c436bb3d6508d7df26Jakub Hrozek -Duseshrplib \
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina -Dusedtrace \
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley -Duse64bitint \
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter -Dcc="cc" \
0c1d65998907930678da2d091789446f2c344d5dJakub Hrozek -Doptimize="$(CFLAGS.studio)" \
a2ea3f5d9ef9f17efbb61e942c2bc6cff7d1ebf2Jakub Hrozek -Dcf_email="perl@solaris-userland.java.net" \
f3a25949de81f80c136bb073e4a8f504b080c20cJakub Hrozek -Dcf_by="perl-bugs" \
8394eddba54b5d3e3fda868145e3751247bdbdb2Michal Zidek -Dmyhostname="localhost" \
5a5c5cdeb92f4012fc75fd717bfea06598f68f12Pavel Reichl -Dmksymlinks \
804df4040eb142f82a44c019c7a55b5ce524583cMichal Zidek -O \
1243e093fd31c5660adf1bb3dd477d6935a755beJakub Hrozek -de
1243e093fd31c5660adf1bb3dd477d6935a755beJakub Hrozek
82a958e6592c4a4078e45b7197bbe4751b70f511Pavel ReichlCONFIGURE_THREAD_OPTIONS = -Dusethreads \
979e8d8d6ed444007eeff6be5269e8dc5d2bdf68Pavel Reichl -Duseithreads
05d935cc9d04f03522d0bb44598d22d99b085926Jakub Hrozek
64ea4127f463798410a2c20e0261c6b15f60257fJakub HrozekCOMPONENT_POST_CONFIGURE_ACTION = \
64ea4127f463798410a2c20e0261c6b15f60257fJakub Hrozek (cd $(@D); \
a8d887323f83984679a7d9b827a70146656bb7b2Sumit Bose cp config.sh config.sh_orig ; \
b42bf6c0c01db08208fb81d8295a2909d307284aPavel Reichl gawk \
9118a539a5d59f669f551114f880fe91d6bb8741Jakub Hrozek '/^myuname=/{print $$1" localhost "$$3" "$$5" "$$6" "$$7"\047"} ; \
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek !/^myuname=/ {print}' config.sh_orig \
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce | \
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce sed -e 's/[^ ]*SUNWspro[^ ]*//g' > config.sh ) ; \
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce ( $(RM) $(@D)/perly.act $(@D)/perly.tab $(@D)/perly.h; \
0c16d2eefbc6ac8331078a4cdcecfee817a71bc6Simo Sorce cd $(@D) ; $(GMAKE) regen_perly )
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_INSTALL_ENV += DESTDIR="$(PROTO_DIR)"
7650ded4ffa87fcf7ce5adf00920fecf89cffcf5Michal Zidek#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# perl's install path for sparc is based off the value of the
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# "arch" command. So we must package that way also.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorcePKG_MACROS += PERL_ARCH=$(shell arch)
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorcePKG_MACROS += PERL_VERSION=$(PERL_VERSION)
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# Put studio compilers in PATH so we can tell Configure and gmake just
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# use cc. Trying to avoid the full path so it doesn't end up in
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# perl's config.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceCOMPONENT_BUILD_ENV += PATH=$(dir $(CC.studio.32)):$(PATH)
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# ST=single-thread. MT=multi-thread. The only difference in the build is that
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce# $(CONFIGURE_THREAD_OPTIONS) gets added to $(CONFIGURE_OPTIONS) in the MT case.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce#
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceST_VARIANT = $(BUILD_DIR)/$(MACH32)-st
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo SorceMT_VARIANT = $(BUILD_DIR)/$(MACH32)-mt
VARIANTS = $(MT_VARIANT) $(ST_VARIANT)
$(VARIANTS:%=%/.configured): BITS=32
$(MT_VARIANT)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_THREAD_OPTIONS)
BUILD_32 = $(VARIANTS:%=%/.built)
INSTALL_32 = $(VARIANTS:%=%/.installed)
TEST_32 = $(VARIANTS:%=%/.tested)
configure: $(CONFIGURE_32)
build: $(BUILD_32)
install: $(INSTALL_32)
test: $(TEST_32)
#
#
# All tests should pass.
#
#
REQUIRED_PACKAGES += developer/lexer/flex
REQUIRED_PACKAGES += developer/parser/bison
REQUIRED_PACKAGES += database/berkeleydb-5
REQUIRED_PACKAGES += library/database/gdbm
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/linker