Makefile revision 3882
dd0228908543562781a4c0d8773ae87d4c530633Mark Andrews#
dd0228908543562781a4c0d8773ae87d4c530633Mark Andrews# CDDL HEADER START
dd0228908543562781a4c0d8773ae87d4c530633Mark Andrews#
dd0228908543562781a4c0d8773ae87d4c530633Mark Andrews# The contents of this file are subject to the terms of the
810e8d27763c5d8557239ab321eb125163af9236Mark Andrews# Common Development and Distribution License (the "License").
810e8d27763c5d8557239ab321eb125163af9236Mark Andrews# You may not use this file except in compliance with the License.
810e8d27763c5d8557239ab321eb125163af9236Mark Andrews#
15f358ed4ea081793041bbfba70849be472236d3Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
15f358ed4ea081793041bbfba70849be472236d3Mark Andrews# or http://www.opensolaris.org/os/licensing.
15f358ed4ea081793041bbfba70849be472236d3Mark Andrews# See the License for the specific language governing permissions
984c39beed2fee49dda75c4c8a37b7f32bf434bfMark Andrews# and limitations under the License.
984c39beed2fee49dda75c4c8a37b7f32bf434bfMark Andrews#
984c39beed2fee49dda75c4c8a37b7f32bf434bfMark Andrews# When distributing Covered Code, include this CDDL HEADER in each
c08a03a43116c21cf12dea7cbcb5465588f7955cMark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c08a03a43116c21cf12dea7cbcb5465588f7955cMark Andrews# If applicable, add the following below this CDDL HEADER, with the
c311ed52d45334e182a093efad827fe4cbe7e686Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c311ed52d45334e182a093efad827fe4cbe7e686Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
c311ed52d45334e182a093efad827fe4cbe7e686Mark Andrews#
79a6a33184abff1999ba13b10922ccb34a2758a5Mark Andrews# CDDL HEADER END
79a6a33184abff1999ba13b10922ccb34a2758a5Mark Andrews#
79a6a33184abff1999ba13b10922ccb34a2758a5Mark Andrews# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
79a6a33184abff1999ba13b10922ccb34a2758a5Mark Andrews#
5d26560e2b93e1aa0334931ec6ccb6045c3581fcMark Andrewsinclude ../../make-rules/shared-macros.mk
5d26560e2b93e1aa0334931ec6ccb6045c3581fcMark Andrews
5d26560e2b93e1aa0334931ec6ccb6045c3581fcMark AndrewsPATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
2b1c71b134eb92f2e297a56f778838e42f41c880Mark Andrews
2b1c71b134eb92f2e297a56f778838e42f41c880Mark Andrews# I want to override PERL_VERSION and PERL_ARCH because when building
2b1c71b134eb92f2e297a56f778838e42f41c880Mark Andrews# a new version of perl it probably isn't installed so shared-macros.mk
2b1c71b134eb92f2e297a56f778838e42f41c880Mark Andrews# can't call it.
d6fbfd28ea82e425740de903ddc67f7d9e9f82e7Mark Andrews
d6fbfd28ea82e425740de903ddc67f7d9e9f82e7Mark AndrewsCOMPONENT_NAME= perl
d6fbfd28ea82e425740de903ddc67f7d9e9f82e7Mark AndrewsCOMPONENT_VERSION= 5.12.5
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark AndrewsPERL_VERSION= 5.12
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark AndrewsCOMPONENT_PROJECT_URL= http://www.perl.org/
091b098b49a4f84f459abd46451955a18abd6d40Mark AndrewsCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
091b098b49a4f84f459abd46451955a18abd6d40Mark AndrewsCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
091b098b49a4f84f459abd46451955a18abd6d40Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
7d3458a972a902740eb142044655aba6c6ffb9acMark Andrews sha256:10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c
7d3458a972a902740eb142044655aba6c6ffb9acMark AndrewsCOMPONENT_ARCHIVE_URL= http://www.cpan.org/src/5.0/$(COMPONENT_ARCHIVE)
7d3458a972a902740eb142044655aba6c6ffb9acMark AndrewsCOMPONENT_BUGDB= utility/perl
7c441b7f4afdedb6e5a99f113a4f926a005fa950Mark AndrewsTPNO= 9223
7c441b7f4afdedb6e5a99f113a4f926a005fa950Mark Andrews
7c441b7f4afdedb6e5a99f113a4f926a005fa950Mark Andrewsinclude ../../make-rules/prep.mk
7c441b7f4afdedb6e5a99f113a4f926a005fa950Mark Andrewsinclude ../../make-rules/configure.mk
f0ffc28f61a68b350fef9257f5f50e1ac866e0abMark Andrewsinclude ../../make-rules/ips.mk
75e184e4b80c499859574257dd5781d62cfed0b3Mark Andrews
f0ffc28f61a68b350fef9257f5f50e1ac866e0abMark Andrews#
7f20fd8ebb0cabc8f935381d958f8371990c9212Mark Andrews# Override these compiler settings because they are causing problems
7f20fd8ebb0cabc8f935381d958f8371990c9212Mark Andrews# in the ON build of the contrib components.
8695d7b357789bedff63e5b19c5ab25cd58fcd4bMark Andrews# ON doesn't use or need these settings or the compiler has some of them
8695d7b357789bedff63e5b19c5ab25cd58fcd4bMark Andrews# on by default.
8695d7b357789bedff63e5b19c5ab25cd58fcd4bMark Andrews# This also produces a perl more inline with past perl's. For better
f76c4ebaf586a693521f018fbc617c292c1555d7Mark Andrews# or worse.
f76c4ebaf586a693521f018fbc617c292c1555d7Mark Andrews#
b597abd9cc44c7b9ecd0ff67df59a21ff45e88d5Mark Andrewsstudio_XBITS=
b597abd9cc44c7b9ecd0ff67df59a21ff45e88d5Mark Andrewsstudio_XREGS=
b597abd9cc44c7b9ecd0ff67df59a21ff45e88d5Mark Andrewsstudio_IROPTS=
b597abd9cc44c7b9ecd0ff67df59a21ff45e88d5Mark Andrewsstudio_C99MODE=
81e302788a444b81231a7cda721548a020ae5660Brian Wellingtonstudio_ALIGN=
81e302788a444b81231a7cda721548a020ae5660Brian Wellingtonstudio_MT=
81e302788a444b81231a7cda721548a020ae5660Brian Wellington
c00a1eb423623442aff428336bb55590f79013bbMark Andrews#
c00a1eb423623442aff428336bb55590f79013bbMark Andrews# The extra Configure parameters (cf_email, cf_by, myhostname) and
1e258716acade52396a8f260b5e19cbf6ca0290aMark Andrews# the gawk and sed that follow are attempting to sanatize the
1e258716acade52396a8f260b5e19cbf6ca0290aMark Andrews# resulting config.sh of values from our build environment that
d972fa317829804a692e46a34b6f27a33f861d9dMark Andrews# are discoverable in perl's config via "perl -V".
d972fa317829804a692e46a34b6f27a33f861d9dMark Andrews# I'm assuming our compilers live on a path that contains "SUNWspro".
4b171ebd702d72200a4d7609f11c5f79d6b6f964Brian Wellington# If that changes the sed filter needs to change.
4b171ebd702d72200a4d7609f11c5f79d6b6f964Brian Wellington#
4b171ebd702d72200a4d7609f11c5f79d6b6f964Brian Wellington
cceca51fec3b4af660d28e2d3df7242823312eb6Brian Wellington# That last bit re-runs bison to regenerate perly.h.
cceca51fec3b4af660d28e2d3df7242823312eb6Brian Wellington
03fae7ef2173cdf32918853b047d95d9046574ccMark AndrewsCONFIGURE_SCRIPT = $(SOURCE_DIR)/Configure
03fae7ef2173cdf32918853b047d95d9046574ccMark AndrewsCONFIGURE_ENV += MAKE=$(GMAKE)
03fae7ef2173cdf32918853b047d95d9046574ccMark AndrewsCONFIGURE_ENV += PATH=$(dir $(CC)):$(PATH)
03fae7ef2173cdf32918853b047d95d9046574ccMark AndrewsCONFIGURE_OPTIONS = \
ad611e746d6fdcbb9e67da361a3a039c226a9236Mark Andrews -Dprefix=/usr/perl5/$(PERL_VERSION) \
ad611e746d6fdcbb9e67da361a3a039c226a9236Mark Andrews -Dprivlib=/usr/perl5/$(PERL_VERSION)/lib \
603d1d1e20fbffc986b3aec93379bb4f6ac37afcMark Andrews -Dsitelib=/usr/perl5/site_perl/$(PERL_VERSION) \
603d1d1e20fbffc986b3aec93379bb4f6ac37afcMark Andrews -Dvendorprefix=/usr/perl5/$(PERL_VERSION) \
603d1d1e20fbffc986b3aec93379bb4f6ac37afcMark Andrews -Dvendorlib=/usr/perl5/vendor_perl/$(PERL_VERSION) \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Dlibperl=libperl.so \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Duseshrplib \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Dusedtrace \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Duse64bitint \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Dcc="cc" \
2dd99c098ca162f985b7ef3c8142a964ad8281aeMark Andrews -Doptimize="$(CFLAGS.studio)" \
1fb264ed3aa861a67d7bab9aeb5aea5836e03c14Mark Andrews -Dcf_email="perl@solaris-userland.java.net" \
1fb264ed3aa861a67d7bab9aeb5aea5836e03c14Mark Andrews -Dcf_by="perl-bugs" \
1fb264ed3aa861a67d7bab9aeb5aea5836e03c14Mark Andrews -Dmyhostname="localhost" \
608c703d1231e0b1f291637ca5361b773afcdbf1Mark Andrews -Dmksymlinks \
608c703d1231e0b1f291637ca5361b773afcdbf1Mark Andrews -O \
608c703d1231e0b1f291637ca5361b773afcdbf1Mark Andrews -de
feb8ae093115b36ac061e23d0227ea06f51950a3Mark Andrews
feb8ae093115b36ac061e23d0227ea06f51950a3Mark AndrewsCONFIGURE_THREAD_OPTIONS = -Dusethreads \
27151990b2b48f027f7f01972fe8e0dfa1df52d3Mark Andrews -Duseithreads
27151990b2b48f027f7f01972fe8e0dfa1df52d3Mark Andrews
27151990b2b48f027f7f01972fe8e0dfa1df52d3Mark AndrewsCOMPONENT_POST_CONFIGURE_ACTION = \
6b610836bc081fdadf7bc7a16ce27f422c6b5638Brian Wellington (cd $(@D); \
6b610836bc081fdadf7bc7a16ce27f422c6b5638Brian Wellington cp config.sh config.sh_orig ; \
95b604c5e972a5e9eb713bf45cf0b2d9b98da27eMark Andrews gawk \
2211bec6a0626b681fdf5a8e4406555ef76ddf70Mark Andrews '/^myuname=/{print $$1" localhost "$$3" "$$5" "$$6" "$$7"\047"} ; \
2211bec6a0626b681fdf5a8e4406555ef76ddf70Mark Andrews !/^myuname=/ {print}' config.sh_orig \
2211bec6a0626b681fdf5a8e4406555ef76ddf70Mark Andrews | \
fcb2ecdb52a594a5c0d07c2e98e67c14708c16dfMark Andrews sed -e 's/[^ ]*SUNWspro[^ ]*//g' > config.sh ) ; \
fcb2ecdb52a594a5c0d07c2e98e67c14708c16dfMark Andrews ( $(RM) $(@D)/perly.act $(@D)/perly.tab $(@D)/perly.h; \
fcb2ecdb52a594a5c0d07c2e98e67c14708c16dfMark Andrews cd $(@D) ; $(GMAKE) regen_perly )
3561e645d77448b20b1676680b08c76d559e5335Mark Andrews
3561e645d77448b20b1676680b08c76d559e5335Mark AndrewsCOMPONENT_INSTALL_ENV += DESTDIR="$(PROTO_DIR)"
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews#
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews# perl's install path for sparc is based off the value of the
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews# "arch" command. So we must package that way also.
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews#
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark AndrewsPKG_MACROS += PERL_ARCH=$(shell arch)
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark AndrewsPKG_MACROS += PERL_VERSION=$(PERL_VERSION)
27269e9dd45b619160f90db1a0f6b2b3f6f4bbb8Mark Andrews#
faf23095be9a0b5e2696f2b1f1a260af16e9ebeaMark Andrews# Put studio compilers in PATH so we can tell Configure and gmake just
27269e9dd45b619160f90db1a0f6b2b3f6f4bbb8Mark Andrews# use cc. Trying to avoid the full path so it doesn't end up in
faf23095be9a0b5e2696f2b1f1a260af16e9ebeaMark Andrews# perl's config.
f38c274c217d0a5b791786877422306a0e477e10Mark Andrews#
f38c274c217d0a5b791786877422306a0e477e10Mark AndrewsCOMPONENT_BUILD_ENV += PATH=$(dir $(CC.studio.32)):$(PATH)
84ef147b1fa0aed15cade55478ed647d15f7b094Mark Andrews
84ef147b1fa0aed15cade55478ed647d15f7b094Mark Andrews# ST=single-thread. MT=multi-thread. The only difference in the build is that
84ef147b1fa0aed15cade55478ed647d15f7b094Mark Andrews# $(CONFIGURE_THREAD_OPTIONS) gets added to $(CONFIGURE_OPTIONS) in the MT case.
e53a5a116fc531f730df0adb091278ff8a941dffMark Andrews#
e53a5a116fc531f730df0adb091278ff8a941dffMark AndrewsST_VARIANT = $(BUILD_DIR)/$(MACH32)-st
e53a5a116fc531f730df0adb091278ff8a941dffMark AndrewsMT_VARIANT = $(BUILD_DIR)/$(MACH32)-mt
fc7fbdf6e66fb496442ec4f99f5a84669ea4c6d3Mark Andrews
fc7fbdf6e66fb496442ec4f99f5a84669ea4c6d3Mark AndrewsVARIANTS = $(MT_VARIANT) $(ST_VARIANT)
fc7fbdf6e66fb496442ec4f99f5a84669ea4c6d3Mark Andrews
fc7fbdf6e66fb496442ec4f99f5a84669ea4c6d3Mark Andrews$(VARIANTS:%=%/.configured): BITS=32
986be654feec852eb9da0d15599f18d0035e569bMark Andrews
986be654feec852eb9da0d15599f18d0035e569bMark Andrews$(MT_VARIANT)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_THREAD_OPTIONS)
986be654feec852eb9da0d15599f18d0035e569bMark Andrews
3703473c4a2672af58b4f141e92067e969fd978eBrian WellingtonBUILD_32 = $(VARIANTS:%=%/.built)
3703473c4a2672af58b4f141e92067e969fd978eBrian WellingtonINSTALL_32 = $(VARIANTS:%=%/.installed)
c26c65b7a0d036e78bfc73f3e7e0817adb0365c0Mark AndrewsTEST_32 = $(VARIANTS:%=%/.tested)
43733a83ed92359555c0dcc766e04216ba858309Mark Andrews
43733a83ed92359555c0dcc766e04216ba858309Mark Andrewsconfigure: $(CONFIGURE_32)
43733a83ed92359555c0dcc766e04216ba858309Mark Andrews
bda64555f62216c3e785338f372a7ad9b79c197cMark Andrewsbuild: $(BUILD_32)
86e71d7e8626de37559265f0edac8451bef6d001Andreas Gustafsson
bda64555f62216c3e785338f372a7ad9b79c197cMark Andrewsinstall: $(INSTALL_32)
39c2b741427eedafe5054909773c2e121c078b72Mark Andrews
39c2b741427eedafe5054909773c2e121c078b72Mark Andrewstest: $(TEST_32)
39c2b741427eedafe5054909773c2e121c078b72Mark Andrews #
de36c606c52ad51e5abca6e42faf655937e5ed10Mark Andrews #
de36c606c52ad51e5abca6e42faf655937e5ed10Mark Andrews # All tests should pass.
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews #
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews #
7789eb1345bef03773a2530dce7f2709cc50aa2aAndreas Gustafsson
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews
28d8b4118da7abed531ca09136a6d1402837d721Mark AndrewsBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
28d8b4118da7abed531ca09136a6d1402837d721Mark Andrews
28d8b4118da7abed531ca09136a6d1402837d721Mark Andrewsinclude ../../make-rules/depend.mk
d6c0627d1e4d841eac9576427f2d4a0cf9a47e2cMark Andrews