Makefile revision 5051
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen# CDDL HEADER START
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# The contents of this file are subject to the terms of the
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# Common Development and Distribution License (the "License").
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# You may not use this file except in compliance with the License.
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# or http://www.opensolaris.org/os/licensing.
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# See the License for the specific language governing permissions
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# and limitations under the License.
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# If applicable, add the following below this CDDL HEADER, with the
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen#
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# CDDL HEADER END
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen#
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
3fe44a0df5a0bdd80c495f79cbf0e384441d6fccTimo Sirainen#
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Siraineninclude ../../make-rules/shared-macros.mk
3fe44a0df5a0bdd80c495f79cbf0e384441d6fccTimo Sirainen
3fe44a0df5a0bdd80c495f79cbf0e384441d6fccTimo SirainenCOMPONENT_NAME= sendmail
62300a38f91227b9de043a9a8ec1d4f1978e1138Timo SirainenCOMPONENT_VERSION= 8.15.2
b87436ebb957a9eb182be72ba00e2c8eae59a2e4Timo SirainenCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
fc84f8af4794f4bb6caf6e5ec3fb1f8cebd0462aTimo SirainenCOMPONENT_PROJECT_URL= ftp://ftp.sendmail.org/pub/sendmail/
b8a4aab1f117f6760184ad50b1af41ba810b51f9Timo SirainenCOMPONENT_ARCHIVE= $(COMPONENT_NAME).$(COMPONENT_VERSION).tar.gz
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCOMPONENT_ARCHIVE_HASH= \
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen sha256:24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439
12dc81583d1958cb301a617e19fbd40e8d376397Timo SirainenCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
12dc81583d1958cb301a617e19fbd40e8d376397Timo SirainenCOMPONENT_BUGDB= utility/sendmail
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen
3851ad9fcb25635f02b46d44586742ef1081876bTimo SirainenTPNO= 23958
d7babe048f9ae1afa5357973b8de8c929753a216Timo Sirainen
2b682d8d3661800f16aceaa45fa4de9b6b140a59Timo Siraineninclude $(WS_MAKE_RULES)/prep.mk
2b682d8d3661800f16aceaa45fa4de9b6b140a59Timo Siraineninclude $(WS_MAKE_RULES)/justmake.mk
2b682d8d3661800f16aceaa45fa4de9b6b140a59Timo Sirainen
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen# Mostly but not completely migrated from ON in S12.
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainenifeq ($(BUILD_TYPE), evaluation)
503e5ef896c7b4a51cf73efb0d132860a8c747e6Timo SirainenPUBLISH_STAMP=
3851ad9fcb25635f02b46d44586742ef1081876bTimo Sirainenendif
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen
ad4f1b0666975c57dd2d8d3492b223ec814791cdTimo Siraineninclude $(WS_MAKE_RULES)/ips.mk
503e5ef896c7b4a51cf73efb0d132860a8c747e6Timo Siraineninclude $(WS_MAKE_RULES)/lint-libraries.mk
503e5ef896c7b4a51cf73efb0d132860a8c747e6Timo Sirainen
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# Although we build 32_and_64, everything except libmilter just wants 64,
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen# which is why the macros just below only have values for 64. libmilter
9b61a6db87c026656f8d2ae214e4486b98a069c0Timo Sirainen# is dealt with further below.
9b61a6db87c026656f8d2ae214e4486b98a069c0Timo SirainenPKG_PROTO_DIRS += $(BUILD_DIR_64)
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenPKG_PROTO_DIRS += $(BUILD_DIR_64)/obj.SunOS.$(OS_VERSION).$(ARCH)
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo SirainenPKG_PROTO_DIRS += $(COMPONENT_DIR)/files
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenPKG_PROTO_DIRS += $(COMPONENT_DIR)/files/man
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen# Userland default includes -mt which links with libthread which we don't need.
cb931f84e3ec8e3deda253a1c0ae0409023de096Timo Sirainenstudio_MT =
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# We set ARCH to match sendmail's configure-like script: on x86, it simply
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenARCH := $(shell uname -m)
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainenifeq ($(findstring sun4,$(ARCH)),sun4)
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenARCH = sun4
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainenendif
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenFILE_DIR=$(COMPONENT_DIR)/files
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenM4_ARG=-D_NO_MAKEINFO_
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_BUILD_DIR=$(@D)/$(SM_BUILD_SUB_DIR)
6d6bbe8787354bbb69d0c03187adfe0f497d70b8Timo Sirainen
048e40f9364fa68482bc276dd4a5d595a3d742e9Timo Sirainen# libmilter is built 32- and 64-bit, but its Makefile installs into a common
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# location, so we use the macro below in its manifest to distinguish between
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# the different built objects.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenPKG_MACROS += LIBMILTER_BUILD_DIR=$(SM_BUILD_SUB_DIR)
3fe44a0df5a0bdd80c495f79cbf0e384441d6fccTimo Sirainen
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCLEAN_PATHS += $(FILE_DIR)/aux/mailq
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# This appends "+Sun" to the version string, which we do for historical
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# reasons. If we did this via patch, then we would have to revise the patch
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# with every new release, since the version string changes every time.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCOMPONENT_PREP_ACTION = $(GSED) -i -e 's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
73583cff4f0ca9ee87204256ca1994adf17cb94cTimo Sirainen $(COMPONENT_SRC)/sendmail/version.c
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# libmilter and sendmail must come before include, so appending to the default
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# value of LINT_FLAGS will not work; we must redefine it here.
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_DEFS= -DSOLARIS=$(shell echo $(SOLARIS_VERSION) | \
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen $(GSED) -e 's/\.//' -e 's/$$/00/')
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_INCLUDES= -I$(SM_BUILD_DIR)/libmilter -I$(SOURCE_DIR)/sendmail \
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen -I$(SOURCE_DIR)/include -I$(SOURCE_DIR) -I.
4ee00532a265bdfb38539d811fcd12d51210ac35Timo SirainenLINT_FLAGS = -nsvx $(SM_DEFS) $(SM_INCLUDES)
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCCOPTS = -erroff=E_STATEMENT_NOT_REACHED $(CC_BITS)
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo SirainenCOMPONENT_BUILD_ARGS += CC="$(CC)"
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo SirainenCOMPONENT_BUILD_ARGS += CCOPTS="$(CCOPTS)"
ad0fe438255666726723a93f3112df6e103028afTimo SirainenCOMPONENT_BUILD_ARGS += CCLINK="$(CC)"
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo SirainenCOMPONENT_BUILD_ARGS += CC_PIC="$(CC_PIC)"
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_BUILD_ARGS += LDOPTS="$(CC_BITS)"
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# mailq's Makefile doesn't grok the 32- and 64-bit build. We just want 64.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# So we clean before we build, and the last build (64) wins, which is what
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# we want.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen $(GMAKE) BITS=$(BITS) clean build
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_POST_INSTALL_ACTION += \
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
2d8b23805db6f06b8b38174fb6e135386694f429Timo SirainenCOMPONENT_POST_INSTALL_ACTION += \
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# Without the two $(CP)s below we would pick up the version of submit.cf
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# from under $(COMPONENT_SRC), which is not what we want because it contains
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# information (user, hostname, date, build path) from the upstream machine
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# where the distro was created. So we build our own version here, using
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# $(M4_ARG), which suppresses the inclusion of all that information.
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# Then we copy it to $(PROTO_DIR)/cf/cf instead of the more intuitive
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# $(PROTOETCDIR)/mail/cf/cf to match the transform in the manifest that
b1678954f83e1059b981e2def52a70054fa71399Timo Sirainen# picks up everything under etc/mail/cf/ from cf/ instead.
b1678954f83e1059b981e2def52a70054fa71399Timo SirainenCOMPONENT_POST_INSTALL_ACTION += \
b1678954f83e1059b981e2def52a70054fa71399Timo Sirainen cd $(@D)/cf/cf ; \
b1678954f83e1059b981e2def52a70054fa71399Timo Sirainen $(RM) submit.cf ; \
0e5819a061034f1636b124c03a89f67d37c852b1Timo Sirainen m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
0e5819a061034f1636b124c03a89f67d37c852b1Timo Sirainen $(CP) submit.cf $(PROTOETCDIR)/mail ; \
0e5819a061034f1636b124c03a89f67d37c852b1Timo Sirainen $(MKDIR) $(PROTO_DIR)/cf/cf ; \
b1678954f83e1059b981e2def52a70054fa71399Timo Sirainen $(CP) submit.cf $(PROTO_DIR)/cf/cf ; \
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen
d5d23d5ff8b7a06d2ead489ddcf55ee8fb5ca7b6Timo SirainenCOMPONENT_TEST_ARGS += CC="$(CC)"
d5d23d5ff8b7a06d2ead489ddcf55ee8fb5ca7b6Timo SirainenCOMPONENT_TEST_ARGS += CCOPTS="$(CCOPTS)"
d5d23d5ff8b7a06d2ead489ddcf55ee8fb5ca7b6Timo SirainenCOMPONENT_TEST_ARGS += CCLINK="$(CC)"
d19d3aa4eafa34b48b7d7d311c9db31e1898576aTimo SirainenCOMPONENT_TEST_ARGS += CC_PIC="$(CC_PIC)"
d19d3aa4eafa34b48b7d7d311c9db31e1898576aTimo SirainenCOMPONENT_TEST_ARGS += LDOPTS="$(CC_BITS)"
8eb223b84389a7b75a39d46484f5166d221305ebTimo Sirainen
8eb223b84389a7b75a39d46484f5166d221305ebTimo SirainenCOMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# The transforms below abstract out the 32- or 64-bit specific parts of
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# the results, so we can use a common "all" master file.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo SirainenCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo SirainenCOMPONENT_TEST_TRANSFORMS += \
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen '-e "s|$(SM_BUILD_SUB_DIR)|\\$$(SM_BUILD_SUB_DIR)|g" ' \
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen '-e "s|$(OS_VERSION)|\\$$(OS_VERSION)|g" ' \
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen '-e "s|$(ARCH)|\\$$(ARCH)|g" ' \
30ad2b0309119501efad06c72ec9b1561b90d4afTimo Sirainen '-e "s|^$(CC).*$$|XXX_CC_XXX|g" ' \
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen '-e "/^XXX_CC_XXX\\$$/d" '
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo SirainenASLR_MODE = $(ASLR_ENABLE)
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo SirainenINSTALL_64=
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen# common targets
269370f66e320a071700e33d9f2584eb46d96a90Timo Sirainenbuild: $(BUILD_32_and_64)
269370f66e320a071700e33d9f2584eb46d96a90Timo Sirainen
269370f66e320a071700e33d9f2584eb46d96a90Timo Siraineninstall: $(INSTALL_32_and_64)
fbdd091ef000e3ec4db34c054736c91ef9bc48ceTimo Sirainen
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainentest: $(TEST_32_and_64)
6800c6607013d4fdef5a4f764bae407301c6cce8Timo Sirainen
b2e181e33889f0a4a3ba9dc23d676cbfe1bf7782Timo Sirainensystem-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen
bd7b1a9000b12349e2a99bb43b3ce8b96a18e92bTimo SirainenREQUIRED_PACKAGES += database/berkeleydb-5
aaebcf0da12df7216be69961204fa64ec24c54b9Timo SirainenREQUIRED_PACKAGES += library/libmilter
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo SirainenREQUIRED_PACKAGES += library/openldap
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo SirainenREQUIRED_PACKAGES += library/security/openssl
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenREQUIRED_PACKAGES += runtime/perl-512
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenREQUIRED_PACKAGES += shell/ksh93
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenREQUIRED_PACKAGES += system/core-os
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenREQUIRED_PACKAGES += system/library
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenREQUIRED_PACKAGES += system/network
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen