Makefile.inc revision 1176
0N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs 0N/A# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 651N/A# Permission is hereby granted, free of charge, to any person obtaining a 810N/A# copy of this software and associated documentation files (the "Software"), 0N/A# to deal in the Software without restriction, including without limitation 0N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 0N/A# and/or sell copies of the Software, and to permit persons to whom the 0N/A# Software is furnished to do so, subject to the following conditions: 0N/A# The above copyright notice and this permission notice (including the next 0N/A# paragraph) shall be included in all copies or substantial portions of the 0N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 0N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 0N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 0N/A# DEALINGS IN THE SOFTWARE. 0N/A# Which compiler to use to build module 0N/AMODTYPE_COMPILER_DEFAULT = $(MODTYPE_COMPILER_SET:yes=$(POUND_SIGN)) 0N/A$(MODTYPE_COMPILER_DEFAULT) MODTYPE_COMPILER = $(DEFAULT_COMPILER) 0N/AMODULE_COMPILER_DEFAULT = $(MODULE_COMPILER_SET:yes=$(POUND_SIGN)) 0N/A$(MODULE_COMPILER_DEFAULT) MODULE_COMPILER = $(MODTYPE_COMPILER) 0N/A# Which make to use to build module 0N/AMODTYPE_MAKE_DEFAULT = $(MODTYPE_MAKE_SET:yes=$(POUND_SIGN)) 493N/A$(MODTYPE_MAKE_DEFAULT) MODTYPE_MAKE = $(MAKE) 493N/AMODULE_MAKE_DEFAULT = $(MODULE_MAKE_SET:yes=$(POUND_SIGN)) 0N/A$(MODULE_MAKE_DEFAULT) MODULE_MAKE = $(MODTYPE_MAKE) 493N/A# Where to install files 0N/AMODTYPE_PREFIX_DEFAULT = $(MODTYPE_PREFIX_SET:yes=$(POUND_SIGN)) 0N/A$(MODTYPE_PREFIX_DEFAULT) MODTYPE_PREFIX=$(X11_DIR) 493N/AMODULE_PREFIX_DEFAULT = $(MODULE_PREFIX_SET:yes=$(POUND_SIGN)) 156N/A$(MODULE_PREFIX_DEFAULT) MODULE_PREFIX=$(MODTYPE_PREFIX) 0N/A# Where to install documentation files 0N/AMODTYPE_DOC_DIR_DEFAULT = $(MODTYPE_DOC_DIR_SET:yes=$(POUND_SIGN)) 0N/A$(MODTYPE_DOC_DIR_DEFAULT) MODTYPE_DOC_DIR=$(MODULE_PREFIX)/share/doc/$(MODULE_NAME) 0N/AMODULE_DOC_DIR_DEFAULT = $(MODULE_DOC_DIR_SET:yes=$(POUND_SIGN)) 837N/A$(MODULE_DOC_DIR_DEFAULT) MODULE_DOC_DIR=$(MODTYPE_DOC_DIR) 0N/A# Where to install pkgconfig files 355N/AMODTYPE_PKGCONFIG_DIR_DEFAULT = $(MODTYPE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN)) 355N/A$(MODTYPE_PKGCONFIG_DIR_DEFAULT) MODTYPE_PKGCONFIG_DIR=$(PKGCONFIG_DIR) 355N/AMODULE_PKGCONFIG_DIR_DEFAULT = $(MODULE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN)) 355N/A$(MODULE_PKGCONFIG_DIR_DEFAULT) MODULE_PKGCONFIG_DIR=$(MODTYPE_PKGCONFIG_DIR) 837N/A# Package files will be delivered in 0N/AMODTYPE_PKGHIER_DEFAULT = $(MODTYPE_PKGHIER_SET:yes=$(POUND_SIGN)) 0N/A$(MODTYPE_PKGHIER_DEFAULT) MODTYPE_PKGHIER=x11/$(MODTYPE) 0N/AMODULE_PKGTAIL_DEFAULT = $(MODULE_PKGTAIL_SET:yes=$(POUND_SIGN)) 0N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL_CMD=print $(MODULE_NAME) | \ 0N/A tr '[:upper:]' '[:lower:]' 0N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL=$(MODULE_PKGTAIL_CMD:sh) 0N/AMODULE_PKGNAME_DEFAULT = $(MODULE_PKGNAME_SET:yes=$(POUND_SIGN)) 0N/A$(MODULE_PKGNAME_DEFAULT) MODULE_PKGNAME=$(MODTYPE_PKGHIER)/$(MODULE_PKGTAIL) 0N/A# Package manifest file 0N/APKG_SRC_DIR = $(TOP)/pkg 837N/APKG_MANIFEST_DIR = $(PKG_SRC_DIR)/manifests 837N/APKG_LICENSE_DIR = $(PKG_SRC_DIR)/license_files 222N/AMODULE_PKG_MANIFEST_NAME_CMD = print $(MODULE_PKGNAME) | tr '/' '-' MODULE_PKG_MANIFEST_NAME = $(MODULE_PKG_MANIFEST_NAME_CMD:sh) MODULE_PKG_MANIFEST = $(PKG_MANIFEST_DIR)/$(MODULE_PKG_MANIFEST_NAME).p5m # Package classification - must be a valid value recognized by pkg gui MODULE_PKGCLASS_DEFAULT = $(MODULE_PKGCLASS_SET:yes=$(POUND_SIGN)) $(MODULE_PKGCLASS_DEFAULT) MODULE_PKGCLASS=System/X11 # Directory created by unpacking source, if not set in module makefile SOURCE_DIRNAME_DEFAULT = $(SOURCE_DIRNAME_SET:yes=$(POUND_SIGN)) $(SOURCE_DIRNAME_DEFAULT) SOURCE_DIRNAME=$(MODULE_NAME)-$(MODULE_VERSION) BUILD_DIR_$(BUILD_TYPE) = build-$(BUILD_TYPE) # Special cases for 32-bit & 64-bit directory names to allow building # both architectures in the same tree (serially - building both in # parallel is likely to have race conditions) BUILD_DIR_32 = build-$(MACH32) BUILD_DIR_64 = build-$(MACH64) BUILD_DIR = $(BUILD_DIR_$(BUILD_TYPE)) SOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME) SOURCE_DIR_32 = $(BUILD_DIR_32)/$(SOURCE_DIRNAME) SOURCE_DIR_64 = $(BUILD_DIR_64)/$(SOURCE_DIRNAME) # Set default tarball if not set in module makefile SOURCE_TARBALL_NAME_DEFAULT = $(SOURCE_TARBALL_NAME_SET:yes=$(POUND_SIGN)) $(SOURCE_TARBALL_NAME_DEFAULT) SOURCE_TARBALL_NAME=$(SOURCE_DIRNAME).tar.bz2 # Tarballs for most modules built here are found in the X.Org archives/repos # in a directory with the same name as what we use in our tree SOURCE_TARBALL_DIR_DEFAULT = $(SOURCE_TARBALL_DIR_SET:yes=$(POUND_SIGN)) $(SOURCE_TARBALL_DIR_DEFAULT) SOURCE_TARBALL_DIR=$(MODTYPE) # Set default download location if not set in module makefile SOURCE_URL_DEFAULT = $(SOURCE_URL_SET:yes=$(POUND_SIGN)) $(SOURCE_URL_DEFAULT) SOURCE_URL=$(SOURCE_URL_$(UPSTREAM_PROJECT)) # Set default git repo location if not set in module makefile GIT_URL_DEFAULT = $(GIT_URL_SET:yes=$(POUND_SIGN)) $(GIT_URL_DEFAULT) GIT_URL=$(XORG_GIT_URL)/$(SOURCE_TARBALL_DIR)/$(MODULE_NAME).git # Set default build type to 64-bit if not set in module makefile BUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN)) $(BUILD_TYPES_DEFAULT) BUILD_TYPES=64 # Set default rules if not set in module/modtype Makefile SOURCE_TARGETS_DEFAULT = $(SOURCE_TARGETS_SET:yes=$(POUND_SIGN)) $(SOURCE_TARGETS_DEFAULT) SOURCE_TARGETS=$(UNPACK_TARGET) \ CONFIGURE_TARGETS_DEFAULT = $(CONFIGURE_TARGETS_SET:yes=$(POUND_SIGN)) $(CONFIGURE_TARGETS_DEFAULT) CONFIGURE_TARGETS=default_configure \ BUILD_TARGETS_DEFAULT = $(BUILD_TARGETS_SET:yes=$(POUND_SIGN)) $(BUILD_TARGETS_DEFAULT) BUILD_TARGETS=default_build \ INSTALL_TARGETS_DEFAULT = $(INSTALL_TARGETS_SET:yes=$(POUND_SIGN)) $(INSTALL_TARGETS_DEFAULT) INSTALL_TARGETS=default_install \ # Additional flags to pass to make in 32-bit & 64-bit builds BUILD_32_FLAGS= ARCH_FLAGS="$(ARCH32_FLAGS)" \ BUILD_64_FLAGS= ARCH_FLAGS="$(ARCH64_FLAGS)" \ all: $(BUILD_TYPES:%=build_%) # We always want to clean 32 & 64 bit subdirs, plus any special ones # But if we just add clean_32 & clean_64, then make complains when they # end up having multiple targets, so we remove them if they're in the list # generated from $(BUILD_TYPES) CLEAN_RULES_1 = $(BUILD_TYPES:%=clean_%) CLEAN_RULES_2 = $(CLEAN_RULES_1:clean_32=) CLEAN_RULES_3 = $(CLEAN_RULES_2:clean_64=) CLEAN_RULES = clean_32 clean_64 $(CLEAN_RULES_3) .PARALLEL: $(CLEAN_RULES) # Remove directories with both styles of naming # Tell dmake not to remove and create source in parallel .NOPARALLEL: clean source .NOPARALLEL: clean_$(BUILD_TYPE) source_$(BUILD_TYPE) SOURCE_RULES = $(BUILD_TYPES:%=source_%) .PARALLEL: $(SOURCE_RULES) source-gen: $(SOURCE_TARGETS) CONFIGURE_RULES = $(BUILD_TYPES:%=configure_%) configure: $(CONFIGURE_RULES) .PARALLEL: $(CONFIGURE_RULES) configure-gen: source-gen $(CONFIGURE_TARGETS) BUILD_RULES = $(BUILD_TYPES:%=build_%) .PARALLEL: $(BUILD_RULES) build-gen: configure-gen $(BUILD_TARGETS) INSTALL_RULES = $(BUILD_TYPES:%=install_%) install: $(INSTALL_RULES) install-gen: build-gen $(INSTALL_TARGETS) install_metadata install-gen: install_pkgconfig_uninstalled install_X11_compat_links $(PROTODIR)$(MODULE_DOC_DIR): DEBUG_BUILD_FLAGS = BUILD_DEBUG=yes # Allow adding "debug-" prefix to rules like build_32, install, etc. # Allow debug_XX to run "make all_XX" with debug flags (including without _XX) ### Source tarballs & downloading if necessary SOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME) # Allow downloading from local archive/mirror # TARBALL_ARCHIVE is now set in Makefile.options ARCHIVE_URL=$(TARBALL_ARCHIVE)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME) GIT_CLONE_DIR=$(MODULE_NAME)-git # Download if SOURCE_TARBALL_NAME is not set to NONE and the file either # doesn't exist or is empty # If MODULE_VERSION is git, checkout source from git repo instead of download: $(SOURCE_TARBALL) $(SOURCE_TARBALL): $(TARBALLDIR) if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
if [[
! -d $(GIT_CLONE_DIR) ]] ; then \ if [[
! -z "$(GIT_BRANCH)" ]] ; then \ if [[
"$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ if [[
! -z "$(TARBALL_ARCHIVE)" ]] ; then \ $(
WGET) -O
'$(SOURCE_TARBALL)' "$${URL}" || \
(
status=$$? ;
rm -f
'$(SOURCE_TARBALL)' ; \
CHECKSUM_TARGET = .checksum_done.$(MODULE_VERSION) check-checksums: $(CHECKSUM_TARGET) $(CHECKSUM_TARGET): $(SOURCE_TARBALL) if [[
"$(MODULE_VERSION)" != "git" && \ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ ACTUAL_MD5=
"$$(digest -a md5 $(SOURCE_TARBALL))" ; \
if [[
"$${ACTUAL_MD5}" != "${TARBALL_MD5}" ]] ; then \ print -
u2 "ERROR: MD5 sum mismatch on ${SOURCE_TARBALL}\n" \
"$${ACTUAL_MD5} != ${TARBALL_MD5}" ; \
if [[
"$${ACTUAL_SHA1}" != "${TARBALL_SHA1}" ]] ; then \ print -
u2 "ERROR: SHA1 sum mismatch on ${SOURCE_TARBALL}\n" \
"$${ACTUAL_SHA1} != ${TARBALL_SHA1}" ; \
# Submit a tarball to the archive ARCHIVE_SUBMIT=/ws/x11/tarballs/bin/archive-tarballs if [[
"$(MODULE_VERSION)" != "git" && \ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ --
modtype=
'$(SOURCE_TARBALL_DIR)' \
--
tarball=
'$(SOURCE_TARBALL_NAME)' \
--
sha1=
'$(TARBALL_SHA1)' ; \
# Update a git cloned repo if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
if [[
! -z "$(GIT_BRANCH)" ]] ; then \ # Create a local git repo from tarball and patches, to ease generating # patches for submission to upstream git or rebasing to new tarballs git commit -a -m
'Initialized from $(SOURCE_TARBALL_NAME)' \
&&
git tag '$(MODULE_NAME)-$(MODULE_VERSION)' print '=================' $$p ; \
ggrep -
Eq '^From .* Mon Sep 17 00:00:00 2001' ;
then \
### Unpack source and apply patches SOURCE_DEPS = $(SOURCE_TARBALL) $(CHECKSUM_TARGET) \ # Step 1: Initialize source dir with upstream sources # - if there's a tarball, unpack it. # - if using a git master, copy it. SOURCE_INIT_TARGET_FILE=.source.init.done SOURCE_INIT_TARGET=$(SOURCE_DIR)/$(SOURCE_INIT_TARGET_FILE) init_source: $(SOURCE_INIT_TARGET) $(SOURCE_INIT_TARGET): $(SOURCE_DEPS) @
if [[
"$(SOURCE_TARBALL_NAME)" ==
"NONE" ]] ;
then \
if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
SOURCE_CMD=
'gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
SOURCE_CMD=
"$${UNCOMP_CMD:-bzcat} $(SOURCE_TARBALL)" ; \
# Step 2: Add in any additional local sources from $(ADDITIONAL_SOURCE_DIR) # (done after init source to avoid races in directory/file creation) SOURCE_ADD_TARGET_FILE=.source.add.done SOURCE_ADD_TARGET=$(SOURCE_DIR)/$(SOURCE_ADD_TARGET_FILE) add_source: $(SOURCE_ADD_TARGET) $(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET) @
if [[
"$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \ if [[
! -x $(LNDIR) ]] ; then \ # Step 3: Apply any local patches (may be done in parallel to add_source, # but must come after init_source is finished) # SOURCE_PATCHES is a list in the format: filename[,flags] # $${p/*,} is ksh93 syntax to remove the comma and everything before it in $p # $${p%,*} is ksh93 syntax to remove the comma and everything after it in $p PATCHED_TARGET_FILE=.patches.done PATCHED_TARGET=$(SOURCE_DIR)/$(PATCHED_TARGET_FILE) patched_source: $(PATCHED_TARGET) $(PATCHED_TARGET): $(SOURCE_INIT_TARGET) @
if [[
"$(SOURCE_PATCHES)" != "" ]] ; then \ if [[
"$$p" != "x" ]] ; then \ if [[
"$$p" =~
"," ]] ;
then \
# Step 4: Apply common Solaris changes to man pages in $(SUNTOUCHED_MANPAGES) FIXED_MAN_SUFFIX=mantouch.done FIXED_MAN_TARGET=$(SUNTOUCHED_MANPAGES:%=$(SOURCE_DIR)/%.$(FIXED_MAN_SUFFIX)) fixed_man: $(FIXED_MAN_TARGET) COMMON_SUNTOUCH_MAN_FLAGS = -a '{Availability, $(MODULE_PKGNAME)}' COMMON_SUNTOUCH_MAN_FLAGS += -a '{Interface Stability, $(MODULE_STABILITY)}' COMMON_SUNTOUCH_MAN_FLAGS += -r '{__distroname__, $(DISTRO_NAME)}' DEFAULT_SUNTOUCH_MAN_FLAGS = \ SUNTOUCH_MAN_FLAGS_DEFAULT = $(SUNTOUCH_MAN_FLAGS_SET:yes=$(POUND_SIGN)) $(SUNTOUCH_MAN_FLAGS_DEFAULT) SUNTOUCH_MAN_FLAGS = $(DEFAULT_SUNTOUCH_MAN_FLAGS) $(FIXED_MAN_TARGET): $(PATCHED_TARGET) $(SOURCE_ADD_TARGET) # Step 5: Apply common Solaris changes to pkg-config *.pc files listed in SOURCE_PC_FILES = $(FIX_PC_FILES:%=$(SOURCE_DIR)/%) ORIG_PC_FILES = $(SOURCE_PC_FILES:%=%.orig) FIXED_PC_TARGET = $(ORIG_PC_FILES) fixed_pc: $(FIXED_PC_TARGET) -e
's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
-e
's|-R\$${libdir}( .*)? -R\$${libdir}|-R\$${libdir}$$1|g;' \
$(ORIG_PC_FILES): $(PATCHED_TARGET) UNPACK_TARGETS = $(SOURCE_INIT_TARGET) $(PATCHED_TARGET) \ default_source: $(UNPACK_TARGET) $(UNPACK_TARGET): $(SOURCE_DEPS) $(UNPACK_TARGETS) ### Run configure scripts # Include Xorg autoconf macros when rebuilding configure scripts # and use automake 1.10 instead of the older 1.9. ACLOCAL_PATH=/usr/bin/aclocal-1.10 ACLOCAL_INCLUDES = -I $(PROTODIR)$(X11_ACLOCAL_DIR) \ AUTOMAKE_PATH=/usr/bin/automake-1.10 AUTORECONF_ENV= ACLOCAL="$(ACLOCAL_PATH) $(ACLOCAL_INCLUDES)" \ # Dependencies for running configure to make a Makefile CONFIGURE_DEPS = $(SOURCE_TARGETS) \ # Command line options to GNU autoconf configure script DEFAULT_CONFIG_OPTS = --prefix=$(MODULE_PREFIX) \ CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) \ # Environment variable options to GNU autoconf configure script $(USE_DEFAULT_CONFIG_CPPFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_CPPFLAGS= \ $(USE_DEFAULT_CONFIG_LDFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_LDFLAGS= \ DEFAULT_PKG_CONFIG_PATH=$(TOP)/open-src/common/pc-files/$(BUILD_DIR):$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE) # Most upstream software is written by developers using bash as /bin/sh, so # we run configure scripts with that to minimize problems and work around # some ksh93 bugs we've hit CONFIG_SHELL_DEFAULT = $(CONFIG_SHELL_SET:yes=$(POUND_SIGN)) $(CONFIG_SHELL_DEFAULT) CONFIG_SHELL = /usr/bin/bash # Set USE_DEFAULT_CONFIG_ENV=no in a Makefile to not use this default $(USE_DEFAULT_CONFIG_ENV:no=$(POUND_SIGN)) DEFAULT_CONFIG_ENV = \ CC=
"$(CC)" CXX=
"$(CXX)" \
LD=
"$(CC) $(ARCH_FLAGS) $(LDFLAGS)" \
CFLAGS=
"$(MODTYPE_CFLAGS) $(MODULE_CFLAGS)" \
CXXFLAGS=
"$(MODTYPE_CXXFLAGS) $(MODULE_CXXFLAGS)" \
CPPFLAGS=
"$(DEFAULT_CONFIG_CPPFLAGS) $(MODTYPE_CPPFLAGS) $(MODULE_CPPFLAGS)" \
LDFLAGS=
"$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_CFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)" \
CONFIG_ENV = $(DEFAULT_CONFIG_ENV) $(MODTYPE_CONFIG_ENV) $(MODULE_CONFIG_ENV) # File created by running configure - defaults to the top-level Makefile # in a source directory unless AUTOCONF_TARGET_SET=yes is set AUTOCONF_TARGET_DEFAULT = $(AUTOCONF_TARGET_SET:yes=$(POUND_SIGN)) $(AUTOCONF_TARGET_DEFAULT) AUTOCONF_TARGET=$(SOURCE_DIR)/Makefile $(AUTOCONF_TARGET): $(CONFIGURE_DEPS) if [[
"$(AUTORECONF)" =
"yes" ||
"$(MODULE_VERSION)" =
"git" ]] ;
then \
if [[
"$(DELIBTOOLIZE)" =
"yes" ]] ;
then \
default_configure: $(AUTOCONF_TARGET) ### Default rules for common build pattern LD_OPTIONS = -L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) \ # MKDIRPROG - Workaround parallel build race condition # in older upstream packaged install-sh BUILD_ENV = LD_OPTIONS='$(LD_OPTIONS)' \ DEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \ # Dependencies for make build step BUILD_DEPS = $(SOURCE_TARGETS) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE) DEFAULT_BUILD_COMMAND = cd @DIR@ ; \ default_build: $(BUILD_DEPS) INSTALL_ENV = $(BUILD_ENV) \ DEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \ # Dependencies for make install step INSTALL_DEPS = $(BUILD_TARGETS) $(MODTYPE_INSTALL_DEPS) $(MODULE_INSTALL_DEPS) DEFAULT_INSTALL_COMMAND = cd @DIR@ ; \ default_install: $(INSTALL_DEPS) # Adjust paths in pkg-config files for -uninstalled variants used during build -e
'BEGIN {use Cwd; $$protodir=Cwd::realpath("$(PROTODIR)");}' \
-e
's|(-[LI]\s*)\$$|$$1$$protodir\$$|g;' \
-e
's|^sdkdir=|sdkdir=$$protodir|g;' \
-e
's|$$protodir\$${sdkdir}|\$${sdkdir}|g;' \
INSTALL_PCU_DEPS_DEFAULT = $(INSTALL_PCU_DEPS_SET:yes=$(POUND_SIGN)) $(INSTALL_PCU_DEPS_DEFAULT) INSTALL_PCU_DEPS = $(INSTALL_TARGETS) install_pkgconfig_uninstalled: $(INSTALL_PCU_DEPS) @
if [[
! -z "$(FIX_PC_FILES)" ]] ; then \ pc=
"$${pcin%%+(.pc|.in)}" ; \
pcu=
"$${pc##*/}-uninstalled.pc" ; \
# Add links if needed from /usr/X11/* to new locations in /usr/* X11_BINCOMPAT_DIR = $(PROTODIR)/usr/X11/bin X11_BINCOMPAT_LINKS = $(MODULE_X11_BINCOMPAT_LINKS:%=$(X11_BINCOMPAT_DIR)/%) X11_LIBCOMPAT_DIR = $(PROTODIR)/usr/X11/lib$(ARCHLIBSUBDIR) X11_LIBCOMPAT_LINKS = $(MODULE_X11_LIBCOMPAT_LINKS:%=$(X11_LIBCOMPAT_DIR)/%) $(X11_BINCOMPAT_DIR) $(X11_LIBCOMPAT_DIR): $(X11_BINCOMPAT_LINKS): $(X11_BINCOMPAT_DIR) $(X11_LIBCOMPAT_LINKS): $(X11_LIBCOMPAT_DIR) @
if [[ -z
"$(ARCHLIBSUBDIR)" ]] ;
then \
install_X11_compat_links: $(X11_BINCOMPAT_LINKS) $(X11_LIBCOMPAT_LINKS) # Set comments in ELF binaries to help identify versions/builds $(BUILD_DEBUG:yes=) DEBUG_ELF_COMMENTS=(DEBUG) $(BUILD_DEBUG:yes=) DEBUG_ELF_COMMENTS_FLAGS=-b -B 'hg id' $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS= $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS_FLAGS= ELF_COMMENTS = $(MODULE_NAME) $(MODULE_VERSION) ELF_COMMENTS += $(DEBUG_ELF_COMMENTS) ELF_COMMENTS += $(MODTYPE_ELF_COMMENTS)$(MODULE_ELF_COMMENTS) ELF_COMMENTS_FLAGS = -M '$(ELF_COMMENTS)' ELF_COMMENTS_FLAGS += $(DEBUG_ELF_COMMENTS_FLAGS) ELF_COMMENTS_FLAGS += $(MODTYPE_ELF_COMMENTS_FLAGS) $(MODULE_ELF_COMMENTS_FLAGS) set-elf-comments: $(BUILD_TARGETS:set-elf-comments=) # Help generate templates for package manifests DEFAULT_LICENSE=$(PKG_LICENSE_DIR)/cr_Oracle $(PKG_LICENSE_DIR)/lic_X11 MANIFEST_DEST=$(PWD)/tmp-proto-$(MACH) MANIFEST_TMP=$(PWD)/tmp.p5m MANIFEST_TARGETS_DEFAULT = $(MANIFEST_TARGETS_SET:yes=$(POUND_SIGN)) $(MANIFEST_TARGETS_DEFAULT) MANIFEST_TARGETS=$(MODULE_PKG_MANIFEST) manifest: $(MANIFEST_TARGETS) manifest-per-type: $(MODULE_PKG_MANIFEST) MANIFEST_INSTALL_RULES = PROTOTOOLSDIR="$(PROTODIR)" \ $(MANIFEST_DEST): install $(MANIFEST_TMP): $(MANIFEST_DEST) $(PKGFMT) version=
'__version:$(MODULE_NAME)__' \
$(MODULE_PKG_MANIFEST): $(MANIFEST_TMP) $(PKG_MANIFEST_DIR) ### Other tools/dependencies needed to build # Some modules (such as FreeType 2) require GNU make @
print -n
"Building with GNU make from $$(whence gmake): " @
print "Building with make from $$(whence $(MAKE))"# Some modules use lndir to merge in sources from Sun specific directories ### Useful rules for maintaining patch sets # regenerate patches against new baseline to reduce messages about hunks # having fuzz or offsets when applying patches - new patches will be in new/ print '=================' $$p ; \
{print}' $$p >
new/$$p ; \
|
sed -e
's% a/\./prev/$(SOURCE_DIRNAME)/% a/%' -e
's% b/\./tmp-regen/$(SOURCE_DIRNAME)/% b/%' \
|
grep -v
'^Common subdirectories:' \
# Allows running "make list-patches" to get a list of all patches we # currently apply in our builds @
if [[
"$(SOURCE_PATCHES)" != "" ]] ; then \ if [[
"$$p" != "x" ]] ; then \ print "$${THIS_MODULE}/$${p%,*}" ; \
### Metadata used in packaging MODULE_PKG_METADATA_DIR = $(PROTOMETA)/$(MODULE_PKG_MANIFEST_NAME) $(MODULE_PKG_METADATA_DIR): METADATA_TARGETS = $(MODULE_PKG_METADATA_DIR) # Base URL for ARC cases used in opensolaris.arc_url metadata # Set to '$(ARC_URL)' here, resolved by pkgmogrify to the URL # set in pkg/Makefile during the package building process ARC_URL_BASE = $$(ARC_URL) # Metadata about upstream UPSTREAM_xorg = X.Org Foundation UPSTREAM_URL_xorg = http://www.x.org/ SOURCE_URL_xorg = $(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME) UPSTREAM_xcb = The XCB Project UPSTREAM_URL_xcb = http://xcb.freedesktop.org/ SOURCE_URL_xcb = http://xcb.freedesktop.org/dist/$(SOURCE_TARBALL_NAME) UPSTREAM_PROJECT_DEFAULT = $(UPSTREAM_PROJECT_SET:yes=$(POUND_SIGN)) $(UPSTREAM_PROJECT_DEFAULT) UPSTREAM_PROJECT = xorg UPSTREAM_DEFAULT = $(UPSTREAM_SET:yes=$(POUND_SIGN)) $(UPSTREAM_DEFAULT) UPSTREAM = $(UPSTREAM_$(SOURCE_TARBALL_NAME)) $(UPSTREAM_DEFAULT) UPSTREAM_SET_YET = $(UPSTREAM_$(SOURCE_TARBALL_NAME)_SET) $(UPSTREAM_DEFAULT) UPSTREAM_NOTFOUND = $(UPSTREAM_SET_YET:yes=$(POUND_SIGN)) $(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM = $(UPSTREAM_$(UPSTREAM_PROJECT)) $(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM_URL = $(UPSTREAM_URL_$(UPSTREAM_PROJECT)) ATTRDATA_FILE_NAME = attributes_$(MODULE_NAME).p5m ATTRDATA_FILE = $(MODULE_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME) METADATA_TARGETS += $(ATTRDATA_FILE) # $${MODVERS//\.+(0)(\d)/.\2} - ksh93 pattern substitution to remove leading # 0's from package version number components, to meet pkg(5) fmri requirements %/$(ATTRDATA_FILE_NAME): % @
if [[
"$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ print 'set name=info.source-url value="$(SOURCE_URL)"' >> $@ ; \
@
if [[
"$(UPSTREAM)" != "NONE" ]] ; then \ print 'set name=info.upstream value="$(UPSTREAM)"' >> $@ ; \
print 'set name=info.upstream-url value="$(UPSTREAM_URL)"' >> $@ ; \
@
if [[
! -z "$(MODULE_ARC_CASES)" ]] ; then \ print 'set name=org.opensolaris.arc-caseid' \
'$(MODULE_ARC_CASES:%=value="%")' >> $@ ; \
@
if [[
! -z "$(MODULE_PKGCLASS)" ]] ; then \ print 'set name=info.classification' \
'value="org.opensolaris.category.2008:$(MODULE_PKGCLASS)"' \
printf '<transform set -> edit value __version:$(MODULE_NAME)__ %s>\n' \
"$${MODVERS//\.+(0)(\d)/.\2}" >> $@
# 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).p5m install_license: $(LICENSE_FILE_DEST) METADATA_TARGETS += $(LICENSE_FILE_DEST) %/$(LICENSE_FILE_NAME): % $(SOURCE_TARGETS) if [[ -f
"$(LICENSE_FILE)" ]] ;
then \
elif [[ -f
"$(SOURCE_DIR)/$(LICENSE_FILE)" ]] ;
then \
if [[ -n
"$${license_to_copy}" ]] ;
then \
print 'license $(LICENSE_FILE_NAME) license="$(LICENSE_NAME)"' >
"$@.p5m" ; \
install_metadata: $(METADATA_TARGETS)