Makefile revision 4337
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy Reed#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# CDDL HEADER START
816e576f77e2c46df3e3d97d65822aa8aded7c4bDavid Lawrence#
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# The contents of this file are subject to the terms of the
69b641bf31d95fd79a50dcea2cdb0fcb23fe22c6David Lawrence# Common Development and Distribution License (the "License").
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# You may not use this file except in compliance with the License.
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson#
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# or http://www.opensolaris.org/os/licensing.
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# See the License for the specific language governing permissions
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# and limitations under the License.
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson#
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# When distributing Covered Code, include this CDDL HEADER in each
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# If applicable, add the following below this CDDL HEADER, with the
0f7bbb64ea71e1226c34fb433731eebf4b395333Andreas Gustafsson# fields enclosed by brackets "[]" replaced with your own identifying
adb6b4397091d2380f0cb412c603816610638f95Brian Wellington# information: Portions Copyright [yyyy] [name of copyright owner]
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson#
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# CDDL HEADER END
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson#
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson#
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas Gustafssoninclude ../../make-rules/shared-macros.mk
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas Gustafsson
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas GustafssonCOMPONENT_NAME= sendmail
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas GustafssonCOMPONENT_VERSION= 8.15.1
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas GustafssonCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
59ddb53fd74be6c4d76536e45465f34f1a08b834Andreas GustafssonCOMPONENT_PROJECT_URL= ftp://ftp.sendmail.org/pub/sendmail/
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_ARCHIVE= $(COMPONENT_NAME).$(COMPONENT_VERSION).tar.gz
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_ARCHIVE_HASH= \
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy Reed sha256:ed1f9e0f2a1a58c9ff94950264a2fc186d6fd237bac66b175d79a2b89a950746
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_BUGDB= utility/sendmail
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy Reed
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedTPNO= 21799
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy Reed
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy Reedinclude $(WS_MAKE_RULES)/prep.mk
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafssoninclude $(WS_MAKE_RULES)/justmake.mk
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafssoninclude $(WS_MAKE_RULES)/ips.mk
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafssoninclude $(WS_MAKE_RULES)/lint-libraries.mk
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafsson
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafsson# Although we build 32_and_64, everything except libmilter just wants 64,
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafsson# which is why the macros just below only have values for 64. libmilter
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafsson# is dealt with further below.
a9568c0abbda42b95482d581647de0a950ed8438Andreas GustafssonPKG_PROTO_DIRS += $(BUILD_DIR_64)
a9568c0abbda42b95482d581647de0a950ed8438Andreas GustafssonPKG_PROTO_DIRS += $(BUILD_DIR_64)/obj.SunOS.$(OS_VERSION).$(ARCH)
5c62008dee307058a7f70511bf260fdea6f5b1d6Andreas GustafssonPKG_PROTO_DIRS += $(COMPONENT_DIR)/files
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas GustafssonPKG_PROTO_DIRS += $(COMPONENT_DIR)/files/man
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson# Userland default includes -mt which links with libthread which we don't need.
708477e4a5b87c9b6338c7d995392c070a78bd45Mark Andrewsstudio_MT =
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson# We set ARCH to match sendmail's configure-like script: on x86, it simply
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson# uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonARCH := $(shell uname -m)
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafssonifeq ($(findstring sun4,$(ARCH)),sun4)
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonARCH = sun4
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafssonendif
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonFILE_DIR=$(COMPONENT_DIR)/files
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonM4_ARG=-DSUN_HIDE_INTERNAL_DETAILS
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonSM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas GustafssonSM_BUILD_DIR=$(@D)/$(SM_BUILD_SUB_DIR)
708477e4a5b87c9b6338c7d995392c070a78bd45Mark Andrews
533df4efdafcf7a8b7292a298f45df9ab7f7f7f9Mark Andrews# libmilter is built 32- and 64-bit, but its Makefile installs into a common
533df4efdafcf7a8b7292a298f45df9ab7f7f7f9Mark Andrews# location, so we use the macro below in its manifest to distinguish between
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas Gustafsson# the different built objects.
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonPKG_MACROS += LIBMILTER_BUILD_DIR=$(SM_BUILD_SUB_DIR)
95940593a680fd37704b74849902ca7fd2ff8f2aAndreas Gustafsson
322445da85b6a318cb2506d216442b3e5af7c3c0Andreas GustafssonCLEAN_PATHS += $(FILE_DIR)/aux/mailq
692f5c282d13b6a0276e5a60c87ab4af013d3b80Mark Andrews
692f5c282d13b6a0276e5a60c87ab4af013d3b80Mark Andrews# This appends "+Sun" to the version string, which we do for historical
692f5c282d13b6a0276e5a60c87ab4af013d3b80Mark Andrews# reasons. If we did this via patch, then we would have to revise the patch
47871e33fb84e286e8e938caa1fccd18deee0d0dAndreas Gustafsson# with every new release, since the version string changes every time.
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas GustafssonCOMPONENT_PREP_ACTION = $(GSED) -i -e 's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson $(COMPONENT_SRC)/sendmail/version.c
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# libmilter and sendmail must come before include, so appending to the default
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson# value of LINT_FLAGS will not work; we must redefine it here.
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonSM_DEFS= -DSOLARIS=21200
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonSM_INCLUDES= -I$(SM_BUILD_DIR)/libmilter -I$(SOURCE_DIR)/sendmail \
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson -I$(SOURCE_DIR)/include -I$(SOURCE_DIR) -I.
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonLINT_FLAGS = -nsvx $(SM_DEFS) $(SM_INCLUDES)
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonCCOPTS = -erroff=E_STATEMENT_NOT_REACHED $(CC_BITS)
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_BUILD_ARGS += CC="$(CC)"
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_BUILD_ARGS += CCOPTS="$(CCOPTS)"
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_BUILD_ARGS += CCLINK="$(CC)"
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_BUILD_ARGS += CC_PIC="$(CC_PIC)"
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonCOMPONENT_BUILD_ARGS += LDOPTS="$(CC_BITS)"
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson
708477e4a5b87c9b6338c7d995392c070a78bd45Mark Andrews# mailq's Makefile doesn't grok the 32- and 64-bit build. We just want 64.
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson# So we clean before we build, and the last build (64) wins, which is what
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson# we want.
708477e4a5b87c9b6338c7d995392c070a78bd45Mark AndrewsCOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson $(GMAKE) BITS=$(BITS) clean build
8f9d22f92aae318244392e217bd53c6173ee6079Andreas Gustafsson
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonCOMPONENT_POST_INSTALL_ACTION += \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas GustafssonCOMPONENT_POST_INSTALL_ACTION += \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# Without the two $(CP)s below we would pick up the version of submit.cf
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# from under $(COMPONENT_SRC), which is not what we want because it contains
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# information (user, hostname, date, build path) from the upstream machine
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# where the distro was created. So we build our own version here, using
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# $(M4_ARG), which suppresses the inclusion of all that information.
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# Then we copy it to $(PROTO_DIR)/cf/cf instead of the more intuitive
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# $(PROTOETCDIR)/mail/cf/cf to match the transform in the manifest that
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# picks up everything under etc/mail/cf/ from cf/ instead.
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas GustafssonCOMPONENT_POST_INSTALL_ACTION += \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson cd $(@D)/cf/cf ; \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson $(RM) submit.cf ; \
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson $(CP) submit.cf $(PROTOETCDIR)/mail ; \
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson $(MKDIR) $(PROTO_DIR)/cf/cf ; \
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson $(CP) submit.cf $(PROTO_DIR)/cf/cf ; \
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += CC="$(CC)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += CCOPTS="$(CCOPTS)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += CCLINK="$(CC)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += CC_PIC="$(CC_PIC)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += LDOPTS="$(CC_BITS)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
8011cb06c90d9b87e241b3efeb8a2eca2b8edddcAndreas Gustafsson
8011cb06c90d9b87e241b3efeb8a2eca2b8edddcAndreas Gustafsson# The transforms below abstract out the 32- or 64-bit specific parts of
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas Gustafsson# the results, so we can use a common "all" master file.
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark AndrewsCOMPONENT_TEST_TRANSFORMS += \
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews '-e "s|$(SM_BUILD_SUB_DIR)|\\$$(SM_BUILD_SUB_DIR)|g" ' \
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews '-e "s|$(OS_VERSION)|\\$$(OS_VERSION)|g" ' \
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews '-e "s|$(ARCH)|\\$$(ARCH)|g" ' \
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews '-e "s|^$(CC).*$$|XXX_CC_XXX|g" ' \
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews '-e "/^XXX_CC_XXX\\$$/d" '
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark AndrewsASLR_MODE = $(ASLR_ENABLE)
b9f6bf5fdfbaaf2bd9a62af0ce6d358c9905ab77Mark Andrews
47871e33fb84e286e8e938caa1fccd18deee0d0dAndreas GustafssonINSTALL_64=
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# common targets
5dbccb84737c96fef00663919c83ee8f3d6e887aAndreas Gustafssonbuild: $(BUILD_32_and_64)
5dbccb84737c96fef00663919c83ee8f3d6e887aAndreas Gustafsson
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafssoninstall: $(INSTALL_32_and_64)
64b0479a910055c6e16843fbd80897ac926e69e0Mark Andrews
64b0479a910055c6e16843fbd80897ac926e69e0Mark Andrewstest: $(TEST_32_and_64)
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas Gustafssonsystem-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas Gustafsson
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonREQUIRED_PACKAGES += database/berkeleydb-5
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonREQUIRED_PACKAGES += library/libmilter
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += library/openldap
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += library/security/openssl
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += runtime/perl-512
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += shell/ksh93
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += system/core-os
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonREQUIRED_PACKAGES += system/library
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonREQUIRED_PACKAGES += system/network
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson