Makefile revision 5204
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# CDDL HEADER START
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# The contents of this file are subject to the terms of the
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore# Common Development and Distribution License (the "License").
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# You may not use this file except in compliance with the License.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# or http://www.opensolaris.org/os/licensing.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# See the License for the specific language governing permissions
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# and limitations under the License.
02fc09f797e83e80199c96adc4751c230dccc973Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# When distributing Covered Code, include this CDDL HEADER in each
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# If applicable, add the following below this CDDL HEADER, with the
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore# fields enclosed by brackets "[]" replaced with your own identifying
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# information: Portions Copyright [yyyy] [name of copyright owner]
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# CDDL HEADER END
02fc09f797e83e80199c96adc4751c230dccc973Adam Moore#
08e054017132cdd838955bc0af15889f1f2a7b42Adam Moore# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
08e054017132cdd838955bc0af15889f1f2a7b42Adam Moore#
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Mooreinclude ../../make-rules/shared-macros.mk
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam MooreCOMPONENT_NAME= bind
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam MooreCOMPONENT_VERSION= 9.6-ESV-R11
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam MooreHUMAN_VERSION= $(COMPONENT_VERSION)-P4
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam MooreIPS_COMPONENT_VERSION= 9.6.3.11.4
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam MooreCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
02fc09f797e83e80199c96adc4751c230dccc973Adam MooreCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCOMPONENT_PROJECT_URL= http://www.isc.org/software/bind/
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# hash from: sha256sum $(COMPONENT_ARCHIVE) | sed 's/\(.[^ ]*\).*/sha256:\1/'
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCOMPONENT_ARCHIVE_HASH= \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore sha256:4f052195a62218c05a05033774452e6a9e329b865c01e594cc20a6adf11e0d0f
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCOMPONENT_ARCHIVE_URL= \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore http://ftp.isc.org/isc/bind9/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCOMPONENT_BUGDB= service/dns-server
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreTPNO= 25905
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooreinclude $(WS_MAKE_RULES)/prep.mk
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooreinclude $(WS_MAKE_RULES)/configure.mk
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooreinclude $(WS_MAKE_RULES)/ips.mk
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Build.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# FYI, The configure options are displayed by 'named -V'. Previously
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# that was overriden by setting CONFIGARGS to hide build server
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# pathnames.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Traditionally all BIND executables are installed in sbin not bin.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# DNS libraries are in usr/lib/dns - Override settings from configure.mk
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/sbin
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib/dns
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --with-libtool
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_BINDIR.$(BITS))
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --sysconfdir=/etc
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --localstatedir=/var
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --with-openssl
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --enable-threads=yes
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --enable-devpoll=yes
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --disable-openssl-version-check
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --enable-fixed-rrset
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam MooreCONFIGURE_OPTIONS += --with-pkcs11
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# Bind configure will check for libxml2 versions 2.6.x/2.7.x/2.8.x.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# To make it use version 2.9.x we need to skip this check by
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# specifying path where libxml2 is installed.
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += --with-libxml2=/usr
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Configure will add "-mt" to CC which is already set in CFLAGS, so override.
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreCONFIGURE_OPTIONS += CC="$(CC)"
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Enable ASLR for this component
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreASLR_MODE = $(ASLR_ENABLE)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: build
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moorebuild: $(BUILD_32)
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# Install.
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore#
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# Currently manual pages are distributed from pkg:/system/manual@.
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# While there are some changes in our manuals, for example section
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# numbering and additions to named(1M) for SMF - that could be fixed
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# by patch.
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore#
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# In addition to BIND deliverables we also deliver SMF files and
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# migration notes. There is no need to install these extras into the
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# prototype directory, they are simply referenced in relevant manifest
eab87f0881fdf3e80c2a1af9224c50f0bf033644Adam Moore# (p5m) file.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: install
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooreinstall: $(INSTALL_32)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Testing.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore#
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# sumarize nawk script; reads ISC output which is of the form:
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^T:/ = Start of a test.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^I:/ = Info from a test; colleced for possible use later.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^A:/ = About: summary of the test - not used here.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^R:/ = Result: If 'PASS' then continue, else print line and collected info.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Known issues may then be accounted for by adding tests, for example:
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^R:UNTESTED/ && name ~ /^T:dst:2:A/ {known++;}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# /^R:UNRESOLVED/ && name ~ /^T:dst:1:A/ {known++;}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# @ EOF = Display count of RESULTS: i.e. R:PASS=124 R:UNTESTED=26 Total=150
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# if not 100% pass rate and issue is not known the word 'issues!' is appended
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# to resulting string.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooresummarize= '\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /^T:/ {name=$$0;info="";}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /^I:/ {info=sprintf("%s%s\n", info, $$0);}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /^R:/ {test++; result[$$1]++;}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /^R:PASS/ {next;}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /^R:/ {printf("%s: %s\n%s\n", $$1, name, info);}\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore END{for (item in result)\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore printf("%s=%d ", item, result[item]);\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore printf("(known=%d) Total=%d%s\n", known, test, \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore ((result["R:PASS"] + known) < test)? \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore " issues!" : "");\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore }'
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooreisc_ifconfig= ./bin/tests/system/ifconfig.sh
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: test
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooretest: build $(TEST_32)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# fulltest requires sufficient privileges to configures IP addresses
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# 10.53.0.1 through 10.53.0.5 as aliases on the loopback interface.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Note PATH is being set so that isc_ifconfig can find ifconfig.
80d2034f65b9348e5fd36291f03b0819181efb89Adam MooreFULL_TEST_32= $(TEST_32:%=%_FULL)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: fulltest
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moorefulltest: build $(FULL_TEST_32)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore$(FULL_TEST_32):
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore cd $(COMPONENT_SRC) && PATH=/sbin:$(PATH) $(SHELL) $(isc_ifconfig) up
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore -cd $(@D) && $(MAKE) test 2>&1 | $(TEE) $@
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore -cd $(COMPONENT_SRC) && PATH=/sbin:$(PATH) $(SHELL) $(isc_ifconfig) down
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore $(NAWK) $(summarize) $@
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore$(TEST_32):
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore -cd $(@D) && $(MAKE) force-test 2>&1 | $(TEE) $@
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore $(NAWK) $(summarize) $@
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# test-summary shows summary for targets test and fulltest. Use target
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# test-clean to remove previous tests.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: test-summary
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooretest-summary:
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore @for file in $(TEST_32)*; do \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore if [ -f $$file ]; then \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore echo 'Summary for' $$file;\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore $(NAWK) $(summarize) $$file;\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore fi;\
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore done
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: test-version
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooretest-version:
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore @echo;echo 32 bit version
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore -LD_LIBRARY_PATH=$(PROTO_DIR)$(CONFIGURE_LIBDIR.32) \
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore $(PROTO_DIR)$(CONFIGURE_BINDIR.32)/named -V
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore.PHONY: test-clean
80d2034f65b9348e5fd36291f03b0819181efb89Adam Mooretest-clean:
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore $(RM) $(TEST_32) $(FULL_TEST_32)
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += library/libxml2
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += library/security/openssl
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += network/dns/bind
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += shell/ksh93
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += system/core-os
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam MooreREQUIRED_PACKAGES += system/library
9bc9c1474a84983bd254adc2bc425c5b24d25526Adam Moore