Makefile revision 4337
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# CDDL HEADER START
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# 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.
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]
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# CDDL HEADER END
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
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 Reed sha256:ed1f9e0f2a1a58c9ff94950264a2fc186d6fd237bac66b175d79a2b89a950746
59c0977bedf9af5a47682655d36c6000ac1a3a4aJeremy ReedCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas Gustafssoninclude $(WS_MAKE_RULES)/lint-libraries.mk
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)/obj.SunOS.$(OS_VERSION).$(ARCH)
35b61b8fb1f377ec9b68bbc8e4e43fbd2756a04dAndreas GustafssonPKG_PROTO_DIRS += $(COMPONENT_DIR)/files/man
074ae7bf0993ced96b32e3e85553a401f3f3eca9Andreas Gustafsson# Userland default includes -mt which links with libthread which we don't need.
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 GustafssonSM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
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)
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/' \
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_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 GustafssonCOMPONENT_BUILD_ARGS += CCOPTS="$(CCOPTS)"
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_BUILD_ARGS += CC_PIC="$(CC_PIC)"
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas GustafssonCOMPONENT_BUILD_ARGS += LDOPTS="$(CC_BITS)"
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
708477e4a5b87c9b6338c7d995392c070a78bd45Mark AndrewsCOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
8f9d22f92aae318244392e217bd53c6173ee6079Andreas GustafssonCOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
d8417b5f3406f4ace0f3bdb228b05a7b701976d6Andreas Gustafsson $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
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 Gustafsson m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
4e0ab18258915b14c163aa9087390402f5ff599bAndreas Gustafsson m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ARGS += LDOPTS="$(CC_BITS)"
4e0ab18258915b14c163aa9087390402f5ff599bAndreas GustafssonCOMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
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
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" '
9769d3146777ca71af80b459ecec1ef8e2d05950Andreas Gustafsson# common targets
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas Gustafssonsystem-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
a488e91e5dedfd055b6a6e6dc3018866478facceAndreas GustafssonREQUIRED_PACKAGES += database/berkeleydb-5