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