usr/src/cmd/a2ps/Makefile.sfw
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
parent 141 1c5f15ab0714
permissions -rw-r--r--
Bash patch catchup including shellshock

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"@(#)Makefile.sfw	1.12	08/02/09 SMI"

#
# Note: psutils (SUNWpsutils) must be installed before building a2ps
#

VER=a2ps-4.14
TARBALL=$(VER).tar.gz

include ../Makefile.cmd

SFW_PATH="$(SPRO_VROOT)/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/bin:$(PATH)"

all: $(VER)/config.status
	(cd $(VER); env \
	    "CC=$(CC) -xc99=%all" \
	    "CXX=$(CCC)" \
	    CFLAGS="$(CFLAGS)" \
	    LD_LIBRARY_PATH=/usr/sfw/lib \
	    LD_OPTIONS="-L$(ROOT)/usr/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" \
	    PATH=$(SFW_PATH) \
	    $(MAKE) )
	@find . -name core -exec rm -f {} \;

# Leave in symlinks for compatibility
COMPAT= a2ps card composeglyphs fixnt fixps ogonkify pdiff psmandup \
  psset texi2dvi4a2ps

COMPATLINKS =	$(COMPAT:%=$(ROOTSFWBIN)/%)
$(COMPATLINKS):
	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@

ROOTETCLPFD = $(ROOTETC)/lp/fd
FILTERDEFS =	a2ps.fd
ROOTFILTERDEFS = $(FILTERDEFS:%=$(ROOTETCLPFD)/%)

$(ROOTETCLPFD)/%:	Solaris/%
	$(INS.file)

install: all $(COMPATLINKS) $(ROOTFILTERDEFS)
	# install the bits in the proto area
	cd $(VER); env SRC=$(SRC) DESTDIR=$(ROOT) \
		MANSCRIPT=$(SRC)/cmd/a2ps/sunman-stability \
		$(MAKE) install
	# fix the proto area
	$(SRC)/tools/protofix --pkg SUNWa2psr --pkg SUNWa2psu --perm
	# clean up the turds
	$(RM) -f $(ROOT)/usr/lib/liba2ps.a $(ROOT)/usr/lib/liba2ps.la \
		 $(ROOT)/a2ps.el $(ROOT)/a2ps-print.el

check: $(VER)/config.status
	(cd $(VER); env \
	    PATH=$(SFW_PATH) \
	    $(MAKE) check)

$(VER)/config.status: $(VER)/configure
	(cd $(VER); env \
	    "CC=$(CC) -xc99=%all" \
	    "CXX=$(CCC)" \
	    CFLAGS="$(CFLAGS)" \
	    INSTALL="$(SRC)/tools/install-proto" \
	    LD_OPTIONS="-L$(ROOT)/usr/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" \
	    EMACS=no \
	    PATH=$(SFW_PATH) \
	    MAKE=$(MAKE) \
	    ./configure \
			--with-medium=letter \
			--enable-shared \
			--sysconfdir=/etc/gnu \
			--prefix=/usr \
			--mandir=/usr/share/man \
			--infodir=/usr/share/info \
			)

#
# Patches applied:
#  1. sheets.map.patch
#     Fix so a2ps delegates conversion of tiff, gif and pdf files correctly.
#     The changes are due to the differences between the output from 
#     Sun's 'file' and from GNU 'file' utility for these file types.
#  2. configure.patch
#     Patch 'configure' so it uses a fontpath=/usr/sfw/share/ghostscript/fonts
#

$(VER)/configure: $(TARBALL)
	gzip -dc $(TARBALL) | tar xopf -
	/usr/bin/gpatch -p0 < Patches/configure.patch
	/usr/bin/gpatch -p0 < Patches/sheets.map.patch
	touch $(VER)/configure

clean:
	-rm -rf $(VER)

include ../Makefile.targ