Makefile revision 3477
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
b0e8629055a766d4555a005a283c2889a5974945Mark Andrews# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or http://www.opensolaris.org/os/licensing.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/shared-macros.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# I want to override PERL_VERSION and PERL_ARCH because when building
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# a new version of perl it probably isn't installed so shared-macros.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# can't call it.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_NAME= perl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_VERSION= 5.12.5
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPERL_VERSION= 5.12
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PROJECT_URL= http://www.perl.org/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sha256:10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_URL= http://www.cpan.org/src/5.0/$(COMPONENT_ARCHIVE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUGDB= utility/perl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/prep.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/configure.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/ips.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Override these compiler settings because they are causing problems
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# in the ON build of the contrib components.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ON doesn't use or need these settings or the compiler has some of them
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# on by default.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This also produces a perl more inline with past perl's. For better
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or worse.
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_XBITS=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_XREGS=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_IROPTS=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_C99MODE=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_ALIGN=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsstudio_MT=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The extra Configure parameters (cf_email, cf_by, myhostname) and
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the gawk and sed that follow are attempting to sanatize the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# resulting config.sh of values from our build environment that
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# are discoverable in perl's config via "perl -V".
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# I'm assuming our compilers live on a path that contains "SUNWspro".
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews# If that changes the sed filter needs to change.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# That last bit re-runs bison to regenerate perly.h.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_SCRIPT = $(SOURCE_DIR)/Configure
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += MAKE=$(GMAKE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += PATH=$(dir $(CC)):$(PATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dprefix=/usr/perl5/$(PERL_VERSION) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dprivlib=/usr/perl5/$(PERL_VERSION)/lib \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dsitelib=/usr/perl5/site_perl/$(PERL_VERSION) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dvendorprefix=/usr/perl5/$(PERL_VERSION) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dvendorlib=/usr/perl5/vendor_perl/$(PERL_VERSION) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dlibperl=libperl.so \
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews -Duseshrplib \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dusedtrace \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Duse64bitint \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dcc="cc" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Doptimize="$(CFLAGS.studio)" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dcf_email="userland-discuss@opensolaris.org" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dcf_by="perl-bugs" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dmyhostname="localhost" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Dmksymlinks \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -O \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -de
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_THREAD_OPTIONS = -Dusethreads \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -Duseithreads
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_POST_CONFIGURE_ACTION = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(@D); \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp config.sh config.sh_orig ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews gawk \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '/^myuname=/{print $$1" localhost "$$3" "$$5" "$$6" "$$7"\047"} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews !/^myuname=/ {print}' config.sh_orig \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews | \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sed -e 's/[^ ]*SUNWspro[^ ]*//g' > config.sh ) ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ( $(RM) $(@D)/perly.act $(@D)/perly.tab $(@D)/perly.h; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cd $(@D) ; $(GMAKE) regen_perly )
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_INSTALL_ENV += DESTDIR="$(PROTO_DIR)"
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# perl's install path for sparc is based off the value of the
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews# "arch" command. So we must package that way also.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
1224c3b69b3d18f7127aa042644936af25a2d679Mark AndrewsPKG_MACROS += PERL_ARCH=$(shell arch)
1224c3b69b3d18f7127aa042644936af25a2d679Mark AndrewsPKG_MACROS += PERL_VERSION=$(PERL_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Put studio compilers in PATH so we can tell Configure and gmake just
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# use cc. Trying to avoid the full path so it doesn't end up in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# perl's config.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUILD_ENV += PATH=$(dir $(CC.studio.32)):$(PATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ST=single-thread. MT=multi-thread. The only difference in the build is that
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# $(CONFIGURE_THREAD_OPTIONS) gets added to $(CONFIGURE_OPTIONS) in the MT case.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsST_VARIANT = $(BUILD_DIR)/$(MACH32)-st
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMT_VARIANT = $(BUILD_DIR)/$(MACH32)-mt
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsVARIANTS = $(MT_VARIANT) $(ST_VARIANT)
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(VARIANTS:%=%/.configured): BITS=32
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(MT_VARIANT)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_THREAD_OPTIONS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_32 = $(VARIANTS:%=%/.built)
c247e3f281613fabe1af362e9f3157e35ebbe52cMark AndrewsINSTALL_32 = $(VARIANTS:%=%/.installed)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST_32 = $(VARIANTS:%=%/.tested)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsconfigure: $(CONFIGURE_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsbuild: $(BUILD_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall: $(INSTALL_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewstest: $(TEST_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews #
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews #
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # All tests should pass.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews #
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews #
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrewsinclude ../../make-rules/depend.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews