Makefile revision 4921
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Common Development and Distribution License (the "License").
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# or http://www.opensolaris.org/os/licensing.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# and limitations under the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# When distributing Covered Code, include this CDDL HEADER in each
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude ../../make-rules/shared-macros.mk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_NAME= hplip
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_VERSION= 3.15.7
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweTPNO= 24589
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_ARCHIVE_HASH= sha256:d310903048f3600f93422e5a8c39ddd682511e0849cd9abc5e943f9a10bdd49d
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_ARCHIVE_URL= http://prdownloads.sourceforge.net/hplip/$(COMPONENT_ARCHIVE)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_PROJECT_URL= http://hplipopensource.com/hplip-web/index.html
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_BUGDB= utility/hplip
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(WS_MAKE_RULES)/prep.mk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(WS_MAKE_RULES)/configure.mk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(WS_MAKE_RULES)/ips.mk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePKG_OPTIONS += -I $(COMPONENT_DIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Enable ASLR for this component
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweASLR_MODE = $(ASLR_ENABLE)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# We need to be able to return from void functions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCC += $(studio_FEATURES_EXTENSIONS)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCXX += $(studio_FEATURES_EXTENSIONS) $(studio_NORUNPATH) $(studio_CXXLIB_CSTD)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweROOTPPDCACHE = $(PROTO_DIR)/usr/lib/lp/caches/SUNWhpijs.cache
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePYTHON_VERSION = 2.7
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# common configure options
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --localedir=$(CONFIGURE_LOCALEDIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --disable-pp-build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --disable-gui-build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --disable-qt4
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += am_cv_python_pythondir="$(PYTHON_VENDOR_PACKAGES)"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += am_cv_python_pyexecdir="$(PYTHON_VENDOR_PACKAGES)"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_ENV += LDFLAGS=" -lnsl"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweHPLIP_VARIANT = $(BUILD_DIR)/$(MACH32)-hplip
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweHPIJS_VARIANT = $(BUILD_DIR)/$(MACH32)-hpijs
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIANTS = $(HPLIP_VARIANT) $(HPIJS_VARIANT)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# We build two variants: for the CUPS/SANE support
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# and for the HPIJS only support
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# use these options for the CUPS/SANE support
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --with-hpppddir=/usr/share/cups/model/SUNWhplip
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-libusb01_build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-fax-build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-hpcups-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --disable-new-hpcups
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-cups-drv-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# use these options for the HPIJS only support
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-foomatic-ppd-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --with-hpppddir=/usr/share/ppd/SUNWhpijs/HP
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --disable-cups-drv-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --disable-hpcups-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --disable-doc-build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-hpijs-only-build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPIJS_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-hpijs-install
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinstall: COMPONENT_INSTALL_ENV += halpredir=/etc/hal/fdi/preprobe/10osvendor
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_INSTALL_ARGS += -e
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_PRE_CONFIGURE_ACTION = \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ($(CLONEY) $(SOURCE_DIR) $(@D))
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Generate configuration scripts
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(HPLIP_VARIANT)/.built: COMPONENT_PREP_ACTION = \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe (cd $(@D) ; autoconf )
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(BUILD_DIR)/.allvariantsinstalled: $(VARIANTS:%=%/.installed)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(RM) $(ROOTPPDCACHE)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MKDIR) $(PROTO_DIR)/usr/lib/lp/caches
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ($(ENV) VER="$(BUILD_DIR)/$(MACH32)-hpijs" \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe PPDSRC="$(PROTO_DIR)/usr/share/ppd/SUNWhpijs" \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DONOTINSTALL="/dev/null" \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CACHE="$(ROOTPPDCACHE)" \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe IPATH="/usr/share/ppd/$(BUILD_DIR)/" \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(KSH93) cache.ksh)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # set version of python interpreter to calm the pkglint
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe find $(PROTO_DIR) -name \*.py -print0 | \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe while IFS= read -r -d $$'\0' file; do \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe /usr/bin/sed -e '1,1s&^#!.*python[:blank:]\{0,\}$$&#!$(PYTHON.$(PYTHON_VERSION))&' \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $$file > $$file.pyverset ; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe done
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe find $(PROTO_DIR) -name \*.py.pyverset -print0 | \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe while IFS= read -r -d $$'\0' file; do \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MV) $$file `echo $$file | sed -e 's/[.]pyverset$$//'` ; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe done
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(PYTHON.$(PYTHON_VERSION)) -m compileall $(PROTO_DIR)/usr/share/hplip/
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(TOUCH) $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePKG_MACROS += PYVER=$(PYTHON_VERSION)
#
# Since it looks like you can't build HPLIP with both HPIJS and CUPS support
# and seperate the HPIJS and CUPS PPD data, we need to replicate the code and
# build it twice. Once for the HPIJS support used by LP and once for the rest
# of the support used for CUPS and SANE.
#
configure: $(VARIANTS:%=%/.configured)
build: $(VARIANTS:%=%/.built)
install: $(BUILD_DIR)/.allvariantsinstalled
# empty test target
test: $(NO_TESTS)
system-test: $(NO_TESTS)
REQUIRED_PACKAGES += image/library/libjpeg
REQUIRED_PACKAGES += library/print/cups-libs
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += print/cups
REQUIRED_PACKAGES += image/scanner/xsane/sane-backends
REQUIRED_PACKAGES += runtime/perl-512
REQUIRED_PACKAGES += runtime/python-27
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/c++-runtime
REQUIRED_PACKAGES += system/library/libdbus
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/library/usb/libusb
REQUIRED_PACKAGES += system/linker
REQUIRED_PACKAGES += system/management/snmp/net-snmp