Makefile.inc revision 1045
749N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
749N/A#
749N/A# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
749N/A#
749N/A# Permission is hereby granted, free of charge, to any person obtaining a
749N/A# copy of this software and associated documentation files (the "Software"),
749N/A# to deal in the Software without restriction, including without limitation
749N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
749N/A# and/or sell copies of the Software, and to permit persons to whom the
749N/A# Software is furnished to do so, subject to the following conditions:
749N/A#
749N/A# The above copyright notice and this permission notice (including the next
749N/A# paragraph) shall be included in all copies or substantial portions of the
749N/A# Software.
749N/A#
749N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
749N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
749N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
749N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
749N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
749N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
749N/A# DEALINGS IN THE SOFTWARE.
749N/A#
749N/A#
749N/A
749N/A### Default rules
749N/A
749N/A# Which compiler to use to build module
749N/AMODTYPE_COMPILER_DEFAULT = $(MODTYPE_COMPILER_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_COMPILER_DEFAULT) MODTYPE_COMPILER = $(DEFAULT_COMPILER)
749N/AMODULE_COMPILER_DEFAULT = $(MODULE_COMPILER_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_COMPILER_DEFAULT) MODULE_COMPILER = $(MODTYPE_COMPILER)
749N/A
749N/A# Which make to use to build module
749N/AMODTYPE_MAKE_DEFAULT = $(MODTYPE_MAKE_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_MAKE_DEFAULT) MODTYPE_MAKE = $(MAKE)
749N/AMODULE_MAKE_DEFAULT = $(MODULE_MAKE_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_MAKE_DEFAULT) MODULE_MAKE = $(MODTYPE_MAKE)
749N/A
749N/A# Where to install files
749N/AMODTYPE_PREFIX_DEFAULT = $(MODTYPE_PREFIX_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_PREFIX_DEFAULT) MODTYPE_PREFIX=$(X11_DIR)
749N/AMODULE_PREFIX_DEFAULT = $(MODULE_PREFIX_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_PREFIX_DEFAULT) MODULE_PREFIX=$(MODTYPE_PREFIX)
749N/A
749N/A# Where to install documentation files
749N/AMODTYPE_DOC_DIR_DEFAULT = $(MODTYPE_DOC_DIR_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_DOC_DIR_DEFAULT) MODTYPE_DOC_DIR=$(MODULE_PREFIX)/share/doc/$(MODULE_NAME)
749N/AMODULE_DOC_DIR_DEFAULT = $(MODULE_DOC_DIR_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_DOC_DIR_DEFAULT) MODULE_DOC_DIR=$(MODTYPE_DOC_DIR)
749N/A
749N/A# Where to install pkgconfig files
749N/AMODTYPE_PKGCONFIG_DIR_DEFAULT = $(MODTYPE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_PKGCONFIG_DIR_DEFAULT) MODTYPE_PKGCONFIG_DIR=$(PKGCONFIG_DIR)
749N/AMODULE_PKGCONFIG_DIR_DEFAULT = $(MODULE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_PKGCONFIG_DIR_DEFAULT) MODULE_PKGCONFIG_DIR=$(MODTYPE_PKGCONFIG_DIR)
749N/A
749N/A# Package files will be delivered in
749N/AMODTYPE_PKGHIER_DEFAULT = $(MODTYPE_PKGHIER_SET:yes=$(POUND_SIGN))
749N/A$(MODTYPE_PKGHIER_DEFAULT) MODTYPE_PKGHIER=x11/$(MODTYPE)
749N/AMODULE_PKGTAIL_DEFAULT = $(MODULE_PKGTAIL_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL_CMD=print $(MODULE_NAME) | \
749N/A tr '[:upper:]' '[:lower:]'
749N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL=$(MODULE_PKGTAIL_CMD:sh)
749N/AMODULE_PKGNAME_DEFAULT = $(MODULE_PKGNAME_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_PKGNAME_DEFAULT) MODULE_PKGNAME=$(MODTYPE_PKGHIER)/$(MODULE_PKGTAIL)
749N/A
749N/A# Package manifest file
749N/APKG_SRC_DIR = $(TOP)/pkg
749N/APKG_MANIFEST_DIR = $(PKG_SRC_DIR)/manifests
749N/APKG_LICENSE_DIR = $(PKG_SRC_DIR)/license_files
749N/AMODULE_PKG_MANIFEST_NAME_CMD = print $(MODULE_PKGNAME) | tr '/' '-'
749N/AMODULE_PKG_MANIFEST_NAME = $(MODULE_PKG_MANIFEST_NAME_CMD:sh)
749N/AMODULE_PKG_MANIFEST = $(PKG_MANIFEST_DIR)/$(MODULE_PKG_MANIFEST_NAME).mf
749N/A
749N/A# Package classification - must be a valid value recognized by pkg gui
749N/AMODULE_PKGCLASS_DEFAULT = $(MODULE_PKGCLASS_SET:yes=$(POUND_SIGN))
749N/A$(MODULE_PKGCLASS_DEFAULT) MODULE_PKGCLASS=System/X11
749N/A
749N/A# Directory created by unpacking source, if not set in module makefile
749N/ASOURCE_DIRNAME_DEFAULT = $(SOURCE_DIRNAME_SET:yes=$(POUND_SIGN))
749N/A$(SOURCE_DIRNAME_DEFAULT) SOURCE_DIRNAME=$(MODULE_NAME)-$(MODULE_VERSION)
749N/A
749N/ABUILD_DIR_$(BUILD_TYPE) = build-$(BUILD_TYPE)
749N/A# Special cases for 32-bit & 64-bit directory names to allow building
749N/A# both architectures in the same tree (serially - building both in
749N/A# parallel is likely to have race conditions)
749N/ABUILD_DIR_32 = build-$(MACH32)
749N/ABUILD_DIR_64 = build-$(MACH64)
749N/ABUILD_DIR = $(BUILD_DIR_$(BUILD_TYPE))
749N/A
749N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME)
749N/ASOURCE_DIR_32 = $(BUILD_DIR_32)/$(SOURCE_DIRNAME)
749N/ASOURCE_DIR_64 = $(BUILD_DIR_64)/$(SOURCE_DIRNAME)
749N/A
749N/A# Set default tarball if not set in module makefile
749N/ASOURCE_TARBALL_NAME_DEFAULT = $(SOURCE_TARBALL_NAME_SET:yes=$(POUND_SIGN))
749N/A$(SOURCE_TARBALL_NAME_DEFAULT) SOURCE_TARBALL_NAME=$(SOURCE_DIRNAME).tar.bz2
749N/A
749N/A# Tarballs for most modules built here are found in the X.Org archives/repos
749N/A# in a directory with the same name as what we use in our tree
749N/ASOURCE_TARBALL_DIR_DEFAULT = $(SOURCE_TARBALL_DIR_SET:yes=$(POUND_SIGN))
749N/A$(SOURCE_TARBALL_DIR_DEFAULT) SOURCE_TARBALL_DIR=$(MODTYPE)
749N/A
749N/A# Set default download location if not set in module makefile
749N/ASOURCE_URL_DEFAULT = $(SOURCE_URL_SET:yes=$(POUND_SIGN))
749N/A$(SOURCE_URL_DEFAULT) SOURCE_URL=$(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
749N/A
749N/A# Set default git repo location if not set in module makefile
749N/AGIT_URL_DEFAULT = $(GIT_URL_SET:yes=$(POUND_SIGN))
749N/A$(GIT_URL_DEFAULT) GIT_URL=$(XORG_GIT_URL)/$(SOURCE_TARBALL_DIR)/$(MODULE_NAME).git
749N/A
749N/A# Set default build type to 32-bit if not set in module makefile
749N/ABUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN))
749N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES=32
749N/A
749N/A# Set default rules if not set in module/modtype Makefile
749N/ASOURCE_TARGETS_DEFAULT = $(SOURCE_TARGETS_SET:yes=$(POUND_SIGN))
749N/A$(SOURCE_TARGETS_DEFAULT) SOURCE_TARGETS=$(UNPACK_TARGET) \
749N/A $(MODTYPE_ADD_SOURCE_TARGETS) \
749N/A $(MODULE_ADD_SOURCE_TARGETS)
749N/A
749N/ACONFIGURE_TARGETS_DEFAULT = $(CONFIGURE_TARGETS_SET:yes=$(POUND_SIGN))
749N/A$(CONFIGURE_TARGETS_DEFAULT) CONFIGURE_TARGETS=default_configure \
749N/A $(MODTYPE_ADD_CONFIGURE_TARGETS) \
749N/A $(MODULE_ADD_CONFIGURE_TARGETS)
749N/A
749N/ABUILD_TARGETS_DEFAULT = $(BUILD_TARGETS_SET:yes=$(POUND_SIGN))
749N/A$(BUILD_TARGETS_DEFAULT) BUILD_TARGETS=default_build \
749N/A $(MODTYPE_ADD_BUILD_TARGETS) \
749N/A $(MODULE_ADD_BUILD_TARGETS)
749N/A
749N/AINSTALL_TARGETS_DEFAULT = $(INSTALL_TARGETS_SET:yes=$(POUND_SIGN))
749N/A$(INSTALL_TARGETS_DEFAULT) INSTALL_TARGETS=default_install \
749N/A $(MODTYPE_ADD_INSTALL_TARGETS) \
749N/A $(MODULE_ADD_INSTALL_TARGETS)
749N/A
749N/A# Additional flags to pass to make in 32-bit & 64-bit builds
749N/ABUILD_32_FLAGS= ARCH_FLAGS="$(ARCH32_FLAGS)" \
749N/A $(MODTYPE_BUILD_32_FLAGS) $(MODULE_BUILD_32_FLAGS)
749N/A
749N/ABUILD_64_FLAGS= ARCH_FLAGS="$(ARCH64_FLAGS)" \
749N/A $(MODTYPE_BUILD_64_FLAGS) $(MODULE_BUILD_64_FLAGS)
749N/A
749N/Aall: $(BUILD_TYPES:%=build_%)
749N/Aall_%: build_%
749N/A
749N/ACLEAN_RULES = $(BUILD_TYPES:%=clean_%)
749N/Aclean: $(CLEAN_RULES)
749N/A.PARALLEL: $(CLEAN_RULES)
749N/A
749N/A# Remove directories with both styles of naming
749N/A$(CLEAN_RULES):
749N/A -rm -rf $(BUILD_DIR_$(@:clean_%=%)) $(@:clean_%=build_%) $(@:clean_%=build-%)
749N/A
749N/A# Tell dmake not to remove and create source in parallel
749N/A.NOPARALLEL: clean source
749N/A.NOPARALLEL: clean_$(BUILD_TYPE) source_$(BUILD_TYPE)
749N/A
749N/ASOURCE_RULES = $(BUILD_TYPES:%=source_%)
749N/Asource: $(SOURCE_RULES)
749N/A.PARALLEL: $(SOURCE_RULES)
749N/A
749N/Asource-gen: $(SOURCE_TARGETS)
749N/A
749N/A$(SOURCE_RULES):
749N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:source_%=%)" source-gen
749N/A
749N/ACONFIGURE_RULES = $(BUILD_TYPES:%=configure_%)
749N/Aconfigure: $(CONFIGURE_RULES)
749N/A.PARALLEL: $(CONFIGURE_RULES)
749N/A
749N/Aconfigure-gen: source-gen $(CONFIGURE_TARGETS)
749N/A
749N/A$(CONFIGURE_RULES):
749N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:configure_%=%)" \
749N/A $(BUILD_$(@:configure_%=%)_FLAGS) configure-gen
749N/A
749N/ABUILD_RULES = $(BUILD_TYPES:%=build_%)
749N/Abuild: $(BUILD_RULES)
749N/A.PARALLEL: $(BUILD_RULES)
749N/A
749N/Abuild-gen: configure-gen $(BUILD_TARGETS)
749N/A
749N/A$(BUILD_RULES):
749N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:build_%=%)" \
749N/A $(BUILD_$(@:build_%=%)_FLAGS) build-gen
749N/A
749N/AINSTALL_RULES = $(BUILD_TYPES:%=install_%)
749N/Ainstall: $(INSTALL_RULES)
749N/A
749N/Ainstall-gen: build-gen $(INSTALL_TARGETS) install_metadata
749N/Ainstall-gen: install_pkgconfig_uninstalled install_X11_compat_links
749N/A
749N/A$(INSTALL_RULES):
749N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:install_%=%)" \
749N/A $(BUILD_$(@:install_%=%)_FLAGS) install-gen
749N/A
749N/A$(PROTODIR)$(MODULE_DOC_DIR):
749N/A mkdir -p $@
749N/A
749N/ADEBUG_BUILD_FLAGS = BUILD_DEBUG=yes
749N/A
749N/A# Allow adding "debug-" prefix to rules like build_32, install, etc.
749N/Adebug-%:
749N/A $(MAKE) $(MAKEFLAGS) $(@:debug-%=%) $(DEBUG_BUILD_FLAGS)
749N/A
749N/A# Allow debug_XX to run "make all_XX" with debug flags (including without _XX)
749N/Adebug%:
749N/A $(MAKE) $(MAKEFLAGS) $(@:debug%=all%) $(DEBUG_BUILD_FLAGS)
749N/A
749N/A
749N/A### Source tarballs & downloading if necessary
749N/A
749N/ASOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME)
749N/A
749N/A# Allow downloading from local archive/mirror
749N/A# TARBALL_ARCHIVE is now set in Makefile.options
749N/AARCHIVE_URL=$(TARBALL_ARCHIVE)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
749N/A
749N/AGIT_CLONE_DIR=$(MODULE_NAME)-$(MODULE_VERSION)
749N/A
749N/A# Download if SOURCE_TARBALL_NAME is not set to NONE and the file either
749N/A# doesn't exist or is empty
749N/A# If MODULE_VERSION is git, checkout source from git repo instead of
749N/A# a tarball
749N/Adownload: $(SOURCE_TARBALL)
749N/A
749N/A$(SOURCE_TARBALL): $(TARBALLDIR)
749N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; $(START_CMD_ECHO) ; \
749N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
749N/A if [[ ! -d $(GIT_CLONE_DIR) ]] ; then \
749N/A $(GIT) clone $(GIT_URL) $(GIT_CLONE_DIR) ; \
749N/A if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
749N/A cd $(GIT_CLONE_DIR) && $(GIT) checkout $(GIT_BRANCH) ; \
749N/A fi ; \
749N/A fi ; \
749N/A else \
749N/A if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
749N/A if [[ ! -z "$(TARBALL_ARCHIVE)" ]] ; then \
749N/A $(WGET) -O $(SOURCE_TARBALL) $(ARCHIVE_URL) ; \
749N/A else \
749N/A $(WGET) -O $(SOURCE_TARBALL) $(SOURCE_URL) ; \
749N/A fi ; \
749N/A fi ; \
749N/A fi
749N/A
749N/ACHECKSUM_TARGET = .checksum_done.$(MODULE_VERSION)
749N/Acheck-checksums: $(CHECKSUM_TARGET)
749N/A
749N/A$(CHECKSUM_TARGET): $(SOURCE_TARBALL)
749N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
749N/A if [[ "$(MODULE_VERSION)" != "git" && \
749N/A "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
749N/A ACTUAL_MD5="$$(digest -a md5 $(SOURCE_TARBALL))" ; \
749N/A if [[ "$${ACTUAL_MD5}" != "${TARBALL_MD5}" ]] ; then \
749N/A print -u2 "ERROR: MD5 sum mismatch on ${SOURCE_TARBALL}\n" \
749N/A "$${ACTUAL_MD5} != ${TARBALL_MD5}" ; \
749N/A exit 1; \
749N/A fi ; \
749N/A ACTUAL_SHA1="$$(digest -a sha1 ${SOURCE_TARBALL})" ; \
749N/A if [[ "$${ACTUAL_SHA1}" != "${TARBALL_SHA1}" ]] ; then \
749N/A print -u2 "ERROR: SHA1 sum mismatch on ${SOURCE_TARBALL}\n" \
749N/A "$${ACTUAL_SHA1} != ${TARBALL_SHA1}" ; \
749N/A exit 1; \
749N/A fi ; \
749N/A fi
749N/A touch $(CHECKSUM_TARGET)
749N/A
749N/Aclean: clean-checksums
749N/A
749N/Aclean-checksums:
749N/A -rm -f .checksum_done.*
749N/A
749N/A
749N/A# Submit a tarball to the archive
749N/AARCHIVE_SUBMIT=/ws/x11/tarballs/bin/archive-tarballs
749N/A
749N/Aarchive-tarball:
749N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
749N/A if [[ "$(MODULE_VERSION)" != "git" && \
749N/A "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
749N/A $(ARCHIVE_SUBMIT) \
749N/A --modtype='$(SOURCE_TARBALL_DIR)' \
749N/A --tarball='$(SOURCE_TARBALL_NAME)' \
749N/A --url='$(SOURCE_URL)' \
749N/A --md5='$(TARBALL_MD5)' \
749N/A --sha1='$(TARBALL_SHA1)' ; \
749N/A fi
749N/A
749N/A$(TARBALLDIR):
749N/A mkdir -p $(TARBALLDIR)
749N/A
749N/A# Update a git cloned repo
749N/Agit-update:
749N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
749N/A if [[ -d $(GIT_CLONE_DIR) ]] ; then \
749N/A cd $(GIT_CLONE_DIR) ; \
749N/A if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
749N/A $(GIT) checkout master && \
749N/A $(GIT) fetch && \
749N/A $(GIT) checkout $(GIT_BRANCH) ; \
749N/A else \
749N/A $(GIT) fetch ; \
749N/A fi ; \
749N/A fi ; \
749N/A fi
749N/A
749N/A
749N/A### Unpack source and apply patches
749N/A
749N/ASOURCE_DEPS = $(SOURCE_TARBALL) $(CHECKSUM_TARGET) \
749N/A $(MODTYPE_SOURCE_DEPS) $(MODULE_SOURCE_DEPS)
749N/A
749N/A# Step 1: Initialize source dir with upstream sources
749N/A# - if there's a tarball, unpack it.
749N/A# - if using a git master, copy it.
749N/ASOURCE_INIT_TARGET_FILE=.source.init.done
749N/ASOURCE_INIT_TARGET=$(SOURCE_DIR)/$(SOURCE_INIT_TARGET_FILE)
749N/Ainit_source: $(SOURCE_INIT_TARGET)
749N/A
749N/A$(SOURCE_INIT_TARGET): $(SOURCE_DEPS)
749N/A mkdir -p $(BUILD_DIR)
749N/A @ if [[ "$(SOURCE_TARBALL_NAME)" == "NONE" ]] ; then \
749N/A $(START_CMD_ECHO); mkdir -p $(SOURCE_DIR) ; \
749N/A else \
749N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
749N/A SOURCE_CMD='gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
749N/A else \
749N/A UNCOMP_CMD="$(SOURCE_UNCOMPRESS)" ; \
749N/A SOURCE_CMD="$${UNCOMP_CMD:-bzcat} $(SOURCE_TARBALL)" ; \
749N/A fi ; \
749N/A $(START_CMD_ECHO) ; \
749N/A $${SOURCE_CMD} | \
749N/A gtar --directory="$(BUILD_DIR)" $(ADD_TAR_FLAGS) -xf - ; \
749N/A fi
749N/A touch $(SOURCE_INIT_TARGET)
749N/A
749N/A# Step 2: Add in any additional local sources from $(ADDITIONAL_SOURCE_DIR)
749N/A# (done after init source to avoid races in directory/file creation)
749N/ASOURCE_ADD_TARGET_FILE=.source.add.done
749N/ASOURCE_ADD_TARGET=$(SOURCE_DIR)/$(SOURCE_ADD_TARGET_FILE)
749N/Aadd_source: $(SOURCE_ADD_TARGET)
749N/A
749N/A$(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET)
749N/A @if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
749N/A if [[ ! -x $(LNDIR) ]] ; then \
749N/A (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
749N/A fi ; \
749N/A $(START_CMD_ECHO) ; \
749N/A cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ; \
749N/A fi
749N/A touch $(SOURCE_ADD_TARGET)
749N/A
749N/A# Step 3: Apply any local patches (may be done in parallel to add_source,
749N/A# but must come after init_source is finished)
749N/A#
749N/A# SOURCE_PATCHES is a list in the format: filename[,flags]
749N/A# $${p/*,} is ksh93 syntax to remove the comma and everything before it in $p
749N/A# $${p%,*} is ksh93 syntax to remove the comma and everything after it in $p
749N/APATCHED_TARGET_FILE=.patches.done
749N/APATCHED_TARGET=$(SOURCE_DIR)/$(PATCHED_TARGET_FILE)
749N/Apatched_source: $(PATCHED_TARGET)
749N/A
749N/A$(PATCHED_TARGET): $(SOURCE_INIT_TARGET)
749N/A @ if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
749N/A for p in $(SOURCE_PATCHES) x ; do \
749N/A if [[ "$$p" != "x" ]] ; then \
749N/A patch_file="$${p%,*}" ; \
749N/A if [[ "$$p" =~ "," ]] ; then \
749N/A patch_flags="$${p/*,}" ; \
749N/A else \
749N/A patch_flags="-p0" ; \
749N/A fi ; \
749N/A ($(START_CMD_ECHO) ; \
749N/A gpatch -d $(SOURCE_DIR) $${patch_flags} < "$${patch_file}" ) ; \
749N/A fi ; \
749N/A done ; \
749N/A fi
749N/A touch $(PATCHED_TARGET)
749N/A
749N/A# Step 4: Apply common Solaris changes to man pages in $(SUNTOUCHED_MANPAGES)
749N/AFIXED_MAN_SUFFIX=mantouch.done
749N/AFIXED_MAN_TARGET=$(SUNTOUCHED_MANPAGES:%=$(SOURCE_DIR)/%.$(FIXED_MAN_SUFFIX))
749N/Afixed_man: $(FIXED_MAN_TARGET)
749N/A
749N/ACOMMON_SUNTOUCH_MAN_FLAGS = \
749N/A -a '{Availability, $(MODULE_PKGNAME)}' \
749N/A -a '{Interface Stability, $(MODULE_STABILITY)}'
749N/A
749N/ADEFAULT_SUNTOUCH_MAN_FLAGS = \
749N/A $(COMMON_SUNTOUCH_MAN_FLAGS) \
749N/A $(MODTYPE_SUNTOUCH_MAN_FLAGS) \
749N/A $(MODULE_SUNTOUCH_MAN_FLAGS)
749N/A
749N/ASUNTOUCH_MAN_FLAGS_DEFAULT = $(SUNTOUCH_MAN_FLAGS_SET:yes=$(POUND_SIGN))
749N/A$(SUNTOUCH_MAN_FLAGS_DEFAULT) SUNTOUCH_MAN_FLAGS = $(DEFAULT_SUNTOUCH_MAN_FLAGS)
749N/A
749N/A$(FIXED_MAN_TARGET): $(PATCHED_TARGET) $(SOURCE_ADD_TARGET)
749N/A $(PERL) $(TOP)/open-src/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
749N/A $(@:%.$(FIXED_MAN_SUFFIX)=%)
749N/A touch $@
749N/A
749N/A# Step 5: Apply common Solaris changes to pkg-config *.pc files listed in
749N/A# $(FIX_PC_FILES)
749N/ASOURCE_PC_FILES = $(FIX_PC_FILES:%=$(SOURCE_DIR)/%)
749N/AORIG_PC_FILES = $(SOURCE_PC_FILES:%=%.orig)
749N/AFIXED_PC_TARGET = $(ORIG_PC_FILES)
749N/Afixed_pc: $(FIXED_PC_TARGET)
749N/A
749N/AFIX_PC_OPS= \
749N/A -e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
749N/A -e 's|-R\$${libdir}( .*)? -R\$${libdir}|-R\$${libdir}$$1|g;' \
749N/A -e 's|Requires.private: .*$$||;' \
749N/A $(MODTYPE_FIX_PC_FLAGS) \
749N/A $(MODULE_FIX_PC_FLAGS)
749N/A
749N/A$(ORIG_PC_FILES): $(PATCHED_TARGET)
749N/A $(PERL) -i.orig -p $(FIX_PC_OPS) $(@:.orig=)
749N/A
749N/A# Tie them all together
749N/AUNPACK_TARGETS = $(SOURCE_INIT_TARGET) $(PATCHED_TARGET) \
749N/A $(SOURCE_ADD_TARGET) $(FIXED_MAN_TARGET) $(FIXED_PC_TARGET)
749N/A
749N/Adefault_source: $(UNPACK_TARGET)
749N/A
749N/A$(UNPACK_TARGET): $(SOURCE_DEPS) $(UNPACK_TARGETS)
749N/A touch $(UNPACK_TARGET)
749N/A
749N/A### Run configure scripts
749N/A
749N/A# Include Xorg autoconf macros when rebuilding configure scripts
749N/A# and use automake 1.10 instead of the older 1.9.
749N/AACLOCAL_PATH=/usr/bin/aclocal-1.10
749N/AACLOCAL_INCLUDES = -I $(PROTODIR)$(X11_ACLOCAL_DIR) \
749N/A -I $(TOOLS_ACLOCAL_DIR) \
749N/A -I /usr/share/aclocal -I /usr/share/aclocal-1.10
749N/AAUTOMAKE_PATH=/usr/bin/automake-1.10
749N/AAUTORECONF_ENV= ACLOCAL="$(ACLOCAL_PATH) $(ACLOCAL_INCLUDES)" \
749N/A AUTOMAKE="$(AUTOMAKE_PATH)"
749N/A
749N/A# Dependencies for running configure to make a Makefile
749N/ACONFIGURE_DEPS = $(SOURCE_TARGETS) \
749N/A $(MODTYPE_CONFIGURE_DEPS) $(MODULE_CONFIGURE_DEPS)
749N/A
749N/A# Command line options to GNU autoconf configure script
749N/ADEFAULT_CONFIG_OPTS = --prefix=$(MODULE_PREFIX) \
749N/A --without-xmlto --without-asciidoc \
749N/A --mandir='$${prefix}/share/man' --localstatedir=/var
749N/A
749N/ACONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) \
749N/A $(MODTYPE_CONFIG_OPTS) $(MODULE_CONFIG_OPTS)
749N/A
749N/A# Environment variable options to GNU autoconf configure script
749N/A$(USE_DEFAULT_CONFIG_CPPFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_CPPFLAGS= \
749N/A -I$(PROTODIR)$(X11_INCLUDES_DIR) \
749N/A -I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/include/freetype2
749N/A$(USE_DEFAULT_CONFIG_LDFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_LDFLAGS= \
749N/A -L$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR) \
749N/A -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)
749N/A
749N/ADEFAULT_PKG_CONFIG_PATH=$(TOP)/open-src/common/pc-files/$(BUILD_DIR):$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE)
749N/A
749N/A# Set USE_DEFAULT_CONFIG_ENV=no in a Makefile to not use this default
749N/A# autoconfig environment
749N/A$(USE_DEFAULT_CONFIG_ENV:no=$(POUND_SIGN)) DEFAULT_CONFIG_ENV = \
749N/A CC="$(CC)" CXX="$(CXX)" \
749N/A LD="$(CC) $(LDFLAGS)" \
749N/A CFLAGS="$(MODTYPE_CFLAGS) $(MODULE_CFLAGS)" \
749N/A CXXFLAGS="$(MODTYPE_CXXFLAGS) $(MODULE_CXXFLAGS)" \
749N/A CPPFLAGS="$(DEFAULT_CONFIG_CPPFLAGS) $(MODTYPE_CPPFLAGS) $(MODULE_CPPFLAGS)" \
749N/A LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_CFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)" \
749N/A PKG_CONFIG_PATH="$(DEFAULT_PKG_CONFIG_PATH)" \
749N/A INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p" \
749N/A MAKE="$(MODULE_MAKE)" CONFIG_SHELL="$(SHELL)"
749N/A
749N/ACONFIG_ENV = $(DEFAULT_CONFIG_ENV) $(MODTYPE_CONFIG_ENV) $(MODULE_CONFIG_ENV)
749N/A
749N/A# File created by running configure - defaults to the top-level Makefile
749N/A# in a source directory unless AUTOCONF_TARGET_SET=yes is set
749N/AAUTOCONF_TARGET_DEFAULT = $(AUTOCONF_TARGET_SET:yes=$(POUND_SIGN))
749N/A$(AUTOCONF_TARGET_DEFAULT) AUTOCONF_TARGET=$(SOURCE_DIR)/Makefile
749N/A
749N/A$(AUTOCONF_TARGET): $(CONFIGURE_DEPS)
749N/A cd $(SOURCE_DIR) ; \
749N/A if [[ "$(AUTORECONF)" = "yes" || "$(MODULE_VERSION)" = "git" ]] ; then \
749N/A $(AUTORECONF_ENV) autoreconf -v --install --force ; \
749N/A fi ; \
749N/A chmod a+x configure ; \
749N/A $(CONFIG_ENV) $(SHELL) ./configure $(CONFIG_OPTS) ; \
749N/A if [[ "$(DELIBTOOLIZE)" = "yes" ]] ; then \
749N/A $(TOP)/open-src/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
749N/A fi
749N/A
749N/Adefault_configure: $(AUTOCONF_TARGET)
749N/A
749N/A
749N/A# Additional rule used in xserver/Makefile.inc & driver/Makefile.inc to
749N/A# edit the Makefiles generated by configure to override module subdirs
749N/A# for 64-bit x86 modules to be modules/xxx/amd64, not modules/amd64/xxx
749N/AFIXEDMODS_TARGET = $(AUTOCONF_TARGET).fixedmods
749N/ACONFIGURE_FIXEDMODS_/amd64 = $(FIXEDMODS_TARGET)
749N/ACONFIGURE_FIXEDMODS_TARGET = $(CONFIGURE_FIXEDMODS_$(SERVERMOD_subdir))
749N/A
749N/Afix-moduledirs: $(CONFIGURE_FIXEDMODS_TARGET)
749N/A
749N/AFIXEDMODS_SUBSTS = \
749N/A-e 's{\$$\(moduledir\)/(\w+|\$$\(\w+\))}{$(X11_SERVERMODS_DIR)/$$1$(SERVERMOD_subdir)}g;' \
749N/A-e 's{$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir)/([^\s/]+)}{$(X11_SERVERMODS_DIR)/$$1$(SERVERMOD_subdir)}g;'
749N/A
749N/A$(FIXEDMODS_TARGET): $(AUTOCONF_TARGET)
749N/A find $(SOURCE_DIR) -name Makefile | \
749N/A xargs $(PERL) -i.orig -p $(FIXEDMODS_SUBSTS)
749N/A
749N/A
749N/A### Default rules for common build pattern
749N/A
749N/ALD_OPTIONS = -L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) \
749N/A $(MODTYPE_LD_OPTIONS) $(MODULE_LD_OPTIONS)
749N/A
749N/A# MKDIRPROG - Workaround parallel build race condition
749N/A# in older upstream packaged install-sh
749N/A
749N/ABUILD_ENV = LD_OPTIONS='$(LD_OPTIONS)' \
749N/A PROTODIR='$(PROTODIR)' \
749N/A MAKE='$(MODULE_MAKE)' \
749N/A MKDIRPROG='mkdir -p' \
749N/A $(MODTYPE_BUILD_ENV) $(MODULE_BUILD_ENV)
749N/A
749N/ADEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
749N/A $(MODTYPE_BUILD_MAKEFLAGS) $(MODULE_BUILD_MAKEFLAGS)
749N/A
749N/A# Dependencies for make build step
749N/ABUILD_DEPS = $(SOURCE_TARGETS) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE)
749N/A
749N/Adefault_build: $(BUILD_DEPS)
749N/A (cd $(SOURCE_DIR) ; \
749N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
749N/A
749N/Aprint_default_build_flags:
749N/A @print "BUILD_ENV='$(BUILD_ENV)'" ; \
749N/A print "MAKE='$(MODULE_MAKE)'" ; \
749N/A print "MAKEFLAGS='$(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS)'"
749N/A
749N/Abuild-in-subdir:
749N/A (cd $(subdir) ; \
749N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) \
749N/A $(subdir_cmd) )
749N/A
749N/ADEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \
749N/A pkgconfigdir=$(MODULE_PKGCONFIG_DIR) \
749N/A $(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
749N/A $(MODTYPE_INSTALL_MAKEFLAGS) $(MODULE_INSTALL_MAKEFLAGS) \
749N/A
749N/A# Dependencies for make install step
749N/AINSTALL_DEPS = $(BUILD_TARGETS) $(MODTYPE_INSTALL_DEPS) $(MODULE_INSTALL_DEPS)
749N/A
749N/Adefault_install: $(INSTALL_DEPS)
749N/A (cd $(SOURCE_DIR) ; \
749N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
749N/A install)
749N/A
749N/Aprint_default_install_flags:
749N/A @print "BUILD_ENV='$(BUILD_ENV)'" ; \
749N/A print "MAKE='$(MODULE_MAKE)'" ; \
749N/A print "MAKE_FLAGS='$(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS)'"
749N/A
749N/Ainstall-in-subdir:
749N/A (cd $(subdir) ; \
749N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
749N/A $(subdir_cmd))
749N/A
749N/A# Adjust paths in pkg-config files for -uninstalled variants used during build
749N/AUNINSTALLED_PC_OPS= \
749N/A -e 'BEGIN {use Cwd; $$protodir=Cwd::realpath("$(PROTODIR)");}' \
749N/A -e 's|(-[LI]\s*)\$$|$$1$$protodir\$$|g;' \
749N/A -e 's|^sdkdir=|sdkdir=$$protodir|g;' \
749N/A -e 's|$$protodir\$${sdkdir}|\$${sdkdir}|g;' \
749N/A $(MODTYPE_ADD_UNINSTALLED_PC_OPS) $(MODULE_ADD_UNINSTALLED_PC_OPS)
749N/A
749N/AINSTALL_PCU_DEPS_DEFAULT = $(INSTALL_PCU_DEPS_SET:yes=$(POUND_SIGN))
749N/A$(INSTALL_PCU_DEPS_DEFAULT) INSTALL_PCU_DEPS = $(INSTALL_TARGETS)
749N/A
749N/Ainstall_pkgconfig_uninstalled: $(INSTALL_PCU_DEPS)
749N/A @ if [[ ! -z "$(FIX_PC_FILES)" ]] ; then \
749N/A cd $(SOURCE_DIR) ; \
749N/A for pcin in $(FIX_PC_FILES:.in=) ; do \
749N/A pc="$${pcin%%+(.pc|.in)}" ; \
749N/A pcu="$${pc##*/}-uninstalled.pc" ; \
749N/A ($(START_CMD_ECHO) ; \
749N/A rm -f $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ; \
749N/A $(PERL) -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
749N/A $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ) ; \
749N/A done ; \
749N/A fi
749N/A
749N/A# Add links if needed from /usr/X11/* to new locations in /usr/*
749N/AX11_BINCOMPAT_DIR = $(PROTODIR)/usr/X11/bin
749N/AX11_BINCOMPAT_LINKS = $(MODULE_X11_BINCOMPAT_LINKS:%=$(X11_BINCOMPAT_DIR)/%)
749N/AX11_LIBCOMPAT_DIR = $(PROTODIR)/usr/X11/lib$(ARCHLIBSUBDIR)
749N/AX11_LIBCOMPAT_LINKS = $(MODULE_X11_LIBCOMPAT_LINKS:%=$(X11_LIBCOMPAT_DIR)/%)
749N/A
749N/A$(X11_BINCOMPAT_DIR) $(X11_LIBCOMPAT_DIR):
749N/A mkdir -p $@
749N/A
749N/A$(X11_BINCOMPAT_LINKS): $(X11_BINCOMPAT_DIR)
749N/A @rm -f $@
749N/A ln -s ../../bin/$(@F) $@
749N/A
749N/A$(X11_LIBCOMPAT_LINKS): $(X11_LIBCOMPAT_DIR)
749N/A @rm -f $@
749N/A @if [[ -z "$(ARCHLIBSUBDIR)" ]] ; then \
749N/A TARGETDIR=../../lib ; \
749N/A else \
749N/A TARGETDIR=../../../lib$(ARCHLIBSUBDIR) ; \
749N/A fi ; $(START_CMD_ECHO) ; \
749N/A ln -s $${TARGETDIR}/$(@F) $@
749N/A
749N/Ainstall_X11_compat_links: $(X11_BINCOMPAT_LINKS) $(X11_LIBCOMPAT_LINKS)
749N/A
749N/A# Set comments in ELF binaries to help identify versions/builds
749N/AELF_COMMENTS = $(MODULE_NAME) $(MODULE_VERSION)
749N/AELF_COMMENTS += $(MODTYPE_ELF_COMMENTS)$(MODULE_ELF_COMMENTS)
749N/A
749N/A$(BUILD_DEBUG:yes=) DEBUG_ELF_COMMENTS=(DEBUG)
749N/A$(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS=
749N/AELF_COMMENTS += $(DEBUG_ELF_COMMENTS)
749N/A
749N/AELF_COMMENTS_FLAGS = -B 'hg id' -M '$(ELF_COMMENTS)'
749N/AELF_COMMENTS_FLAGS += $(MODTYPE_ELF_COMMENTS_FLAGS) $(MODULE_ELF_COMMENTS_FLAGS)
749N/A
749N/Aset-elf-comments: $(BUILD_TARGETS:set-elf-comments=)
749N/A $(TOP)/open-src/common/set-elf-comments.pl $(ELF_COMMENTS_FLAGS) \
749N/A $(SOURCE_DIR)
749N/A
749N/A# Help generate templates for package manifests
749N/ADEFAULT_LICENSE=$(PKG_LICENSE_DIR)/cr_Oracle $(PKG_LICENSE_DIR)/lic_X11
749N/A
749N/AMANIFEST_DEST=$(PWD)/tmp-proto-$(MACH)
749N/AMANIFEST_TMP=$(PWD)/tmp.mf
749N/A
749N/APKGFMT=/usr/bin/pkgfmt
749N/A
749N/AMANIFEST_TARGETS_DEFAULT = $(MANIFEST_TARGETS_SET:yes=$(POUND_SIGN))
749N/A$(MANIFEST_TARGETS_DEFAULT) MANIFEST_TARGETS=$(MODULE_PKG_MANIFEST)
749N/A
749N/Amanifest: $(MANIFEST_TARGETS)
749N/A
749N/Amanifest-per-type: $(MODULE_PKG_MANIFEST)
749N/A
749N/AMANIFEST_INSTALL_RULES = PROTOTOOLSDIR="$(PROTODIR)" \
749N/A PROTODIR="$(MANIFEST_DEST)"
749N/A
749N/A$(MANIFEST_DEST): install
749N/A /usr/xpg4/bin/make $(MAKEFLAGS) install $(MANIFEST_INSTALL_RULES) \
749N/A || (rm -rf $(MANIFEST_DEST) ; exit 1)
749N/A
749N/A$(MANIFEST_TMP): $(MANIFEST_DEST) $(PKGFMT)
749N/A $(PERL) $(TOP)/open-src/common/pkg-manifest-generate.pl \
749N/A input_manifest='$(MODULE_PKG_MANIFEST)' \
749N/A manifest_license='$(PKG_LICENSE_DIR)/cr_Oracle' \
749N/A manifest_license='$(PKG_LICENSE_DIR)/lic_X11' \
749N/A pkg_name='$(MODULE_PKGNAME)' \
749N/A source_dir='$(SOURCE_DIRNAME)' \
749N/A arch_64='$(ARCH64)' subdir_64='$(SUBDIR64)' \
749N/A proto_area='$(MANIFEST_DEST)' \
749N/A pkgfmt='$(PKGFMT)' \
749N/A > $(MANIFEST_TMP)
749N/A -rm -rf $(MANIFEST_DEST)
749N/A
749N/A$(MODULE_PKG_MANIFEST): $(MANIFEST_TMP) $(PKG_MANIFEST_DIR)
749N/A mv -f $(MANIFEST_TMP) $@
749N/A
749N/A$(PKG_MANIFEST_DIR):
749N/A mkdir -p $(PKG_MANIFEST_DIR)
749N/A
749N/A### Other tools/dependencies needed to build
749N/A
749N/A# Some modules (such as FreeType 2) require GNU make
749N/A$(GNUMAKE):
749N/A @print -n "Building with GNU make from $$(whence gmake): "
749N/A @$(GNUMAKE) --version
749N/A
749N/A$(MAKE):
749N/A @print "Building with make from $$(whence $(MAKE))"
749N/A
749N/A# Some modules use lndir to merge in sources from Sun specific directories
749N/A$(LNDIR):
749N/A (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install)
749N/A
749N/A# Some modules use these tools to convert DocBook docs to text or html
749N/A$(DOCBOOK2HTML) + $(DOCBOOK2TEXT):
749N/A cd $(TOP)/open-src/doc/docbook-utils && $(MAKE) $(MAKEFLAGS) install
749N/A
749N/A$(XORG_DEFS_ENT):
749N/A cd $(TOP)/open-src/doc/xorg-sgml-doctools && $(MAKE) $(MAKEFLAGS) install
749N/A
749N/A### Useful rules for maintaining patch sets
749N/A
749N/A# regenerate patches against new baseline to reduce messages about hunks
749N/A# having fuzz or offsets when applying patches - new patches will be in new/
749N/A
749N/Aregen-patches:
749N/A CUR_LIST=""
749N/A rm -rf tmp-regen
749N/A $(MAKE) SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen patched_source
749N/A mkdir -p new
749N/A for f in $(SOURCE_PATCHES) ; do \
749N/A p=$${f%,*} ; \
749N/A print '=================' $$p ; \
749N/A rm -rf prev ; \
749N/A mv tmp-regen prev ; \
749N/A $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen patched_source ; \
749N/A gawk '/^--- / {exit} \
749N/A /^diff -u/ {exit} \
749N/A {print}' $$p > new/$$p ; \
749N/A gdiff -urp -x '*~' -x '*.orig' ./prev ./tmp-regen \
749N/A | sed -e 's% \./prev/$(SOURCE_DIRNAME)/% %' -e 's% \./tmp-regen/$(SOURCE_DIRNAME)/% %' \
749N/A | grep -v '^Common subdirectories:' \
749N/A | grep -v '^Only in ' \
749N/A >> new/$$p ; \
749N/A CUR_LIST="$${CUR_LIST} new/$$p" ; \
749N/A done
749N/A rm -rf tmp-regen
749N/A
749N/A# Allows running "make list-patches" to get a list of all patches we
749N/A# currently apply in our builds
749N/Alist-patches:
749N/A @if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
749N/A THIS_MODULE="$${PWD##*/open-src/}" ; \
749N/A for p in $(SOURCE_PATCHES) x ; do \
749N/A if [[ "$$p" != "x" ]] ; then \
749N/A print "$${THIS_MODULE}/$${p%,*}" ; \
749N/A fi ; \
749N/A done ; \
749N/A fi
749N/A
749N/A### Metadata used in packaging
749N/A
749N/AMODULE_PKG_METADATA_DIR = $(PROTOMETA)/$(MODULE_PKG_MANIFEST_NAME)
749N/A
749N/A$(MODULE_PKG_METADATA_DIR):
749N/A mkdir -p $@
749N/A
749N/AMETADATA_TARGETS = $(MODULE_PKG_METADATA_DIR)
749N/A
749N/A# Base URL for ARC cases used in opensolaris.arc_url metadata
749N/A# Set to '$(ARC_URL)' here, resolved by pkgmogrify to the URL
749N/A# set in pkg/Makefile during the package building process
749N/AARC_URL_BASE = $$(ARC_URL)
749N/A
749N/A# Metadata about upstream
749N/AUPSTREAM_NONE = NONE
749N/AUPSTREAM_NONE_SET = yes
749N/A
749N/AUPSTREAM_xorg = X.Org Foundation
749N/AUPSTREAM_URL_xorg = http://www.x.org/
749N/A
749N/AUPSTREAM_DEFAULT = $(UPSTREAM_SET:yes=$(POUND_SIGN))
749N/A$(UPSTREAM_DEFAULT) UPSTREAM = $(UPSTREAM_$(SOURCE_TARBALL_NAME))
749N/A$(UPSTREAM_DEFAULT) UPSTREAM_SET_YET = $(UPSTREAM_$(SOURCE_TARBALL_NAME)_SET)
749N/A$(UPSTREAM_DEFAULT) UPSTREAM_NOTFOUND = $(UPSTREAM_SET_YET:yes=$(POUND_SIGN))
749N/A$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM = $(UPSTREAM_xorg)
749N/A$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM_URL = $(UPSTREAM_URL_xorg)
749N/A
749N/A## Attributes files
749N/A
749N/AATTRDATA_FILE_NAME = attributes_$(MODULE_NAME).mf
749N/AATTRDATA_FILE = $(MODULE_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
749N/A
749N/AMETADATA_TARGETS += $(ATTRDATA_FILE)
749N/A
749N/A# $${MODVERS//\.+(0)(\d)/.\2} - ksh93 pattern substitution to remove leading
749N/A# 0's from package version number components, to meet pkg(5) fmri requirements
749N/A%/$(ATTRDATA_FILE_NAME): %
749N/A -rm -f $@
749N/A @if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
749N/A $(START_CMD_ECHO) ; \
749N/A print 'set name=info.source_url value="$(SOURCE_URL)"' >> $@ ; \
fi
@if [[ "$(UPSTREAM)" != "NONE" ]] ; then \
$(START_CMD_ECHO) ; \
print 'set name=info.upstream value="$(UPSTREAM)"' >> $@ ; \
print 'set name=info.upstream_url value="$(UPSTREAM_URL)"' >> $@ ; \
fi
@if [[ ! -z "$(MODULE_ARC_CASES)" ]] ; then \
$(START_CMD_ECHO) ; \
print 'set name=opensolaris.arc_url' \
'$(MODULE_ARC_CASES:%=value="$(ARC_URL_BASE)%/")' >> $@ ; \
fi
@if [[ ! -z "$(MODULE_PKGCLASS)" ]] ; then \
$(START_CMD_ECHO) ; \
print 'set name=info.classification' \
'value="org.opensolaris.category.2008:$(MODULE_PKGCLASS)"' \
>> $@ ; \
fi
@ MODVERS="$(MODULE_VERSION)" ; $(START_CMD_ECHO) ; \
printf '<transform set -> edit value __version:$(MODULE_NAME)__ %s>\n' \
"$${MODVERS//\.+(0)(\d)/.\2}" >> $@
$(MODTYPE_ATTRDATA_COMMANDS)
$(MODULE_ATTRDATA_COMMANDS)
## License files
# Default license file name is COPYING (X.Org & GNU autoconf default)
# For other license file names, set LICENSE_FILE to the file name
# and set LICENSE_FILE_SET=yes
# A file in the same directory as the Makefile takes precedence
# over one that is delivered in the package.
LICENSE_FILE_DEFAULT = $(LICENSE_FILE_SET:yes=$(POUND_SIGN))
$(LICENSE_FILE_DEFAULT) LICENSE_FILE=COPYING
# Default is the MIT/X11 license
MIT_LICENSE_NAME = MIT License ($(MODULE_NAME))
MIT_LICENSE_FILE = $(PKG_SRC_DIR)/license_files/lic_X11
MODULE_LICENSE_DEFAULT = $(MODULE_LICENSE_SET:yes=$(POUND_SIGN))
$(MODULE_LICENSE_DEFAULT) MODULE_LICENSE = $(MIT_LICENSE_NAME)
# Some packages contain only code that Oracle owns all the rights to.
# For these, Makefile.options.oracle.com chooses to omit the license
# notice when Oracle is building its distros. Everyone else gets the
# notice required by open source license Oracle released the code under.
LICENSE_CHOICE_DEFAULT = $(LICENSE_CHOICE_SET:yes=$(POUND_SIGN))
$(LICENSE_CHOICE_DEFAULT) LICENSE_CHOICE=open
ORACLE_LICENSE_NAME_open = $(MIT_LICENSE_NAME)
ORACLE_LICENSE_APPEND_open = $(MIT_LICENSE_FILE)
ORACLE_LICENSE_NAME_Oracle = Oracle Copyright Notice ($(MODULE_NAME))
ORACLE_LICENSE_APPEND_Oracle = # Nothing to append to copyright notice
ORACLE_LICENSE_NAME = $(ORACLE_LICENSE_NAME_$(LICENSE_CHOICE))
ORACLE_LICENSE_PREPEND = # Nothing to prepend to copyright notice
ORACLE_LICENSE_APPEND = $(ORACLE_LICENSE_APPEND_$(LICENSE_CHOICE))
# Use default license info unless MODULE_LICENSE = "Oracle"
LICENSE_NAME = $(MODULE_LICENSE)
LICENSE_PREPEND = $(MODULE_LICENSE_PREPEND)
LICENSE_APPEND = $(MODULE_LICENSE_APPEND)
LICENSE_OVERRIDE_1 = $(POUND_SIGN)$(MODULE_LICENSE)
LICENSE_OVERRIDE = $(LICENSE_OVERRIDE_1:$(POUND_SIGN)Oracle%=)
$(LICENSE_OVERRIDE) LICENSE_NAME = $(ORACLE_LICENSE_NAME)
$(LICENSE_OVERRIDE) LICENSE_PREPEND = $(ORACLE_LICENSE_PREPEND)
$(LICENSE_OVERRIDE) LICENSE_APPEND = $(ORACLE_LICENSE_APPEND)
LICENSE_FILE_NAME = license_$(MODULE_NAME)
LICENSE_FILE_DEST = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
LICENSE_ATTR_FILE = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME).mf
install_license: $(LICENSE_FILE_DEST)
METADATA_TARGETS += $(LICENSE_FILE_DEST)
%/$(LICENSE_FILE_NAME): % $(SOURCE_TARGETS)
@ $(START_CMD_ECHO) ; \
if [[ -f "$(LICENSE_FILE)" ]] ; then \
license_to_copy="$(LICENSE_FILE)" ; \
elif [[ -f "$(SOURCE_DIR)/$(LICENSE_FILE)" ]] ; then \
license_to_copy="$(SOURCE_DIR)/$(LICENSE_FILE)" ; \
fi ; \
if [[ -n "$${license_to_copy}" ]] ; then \
cat $(LICENSE_PREPEND) "$${license_to_copy}" $(LICENSE_APPEND) > "$@" ; \
print 'license $(LICENSE_FILE_NAME) license="$(LICENSE_NAME)"' > "$@.mf" ; \
fi
install_metadata: $(METADATA_TARGETS)