Home | History | Annotate | Download | only in a2ps
      1 #
      2 # CDDL HEADER START
      3 #
      4 # The contents of this file are subject to the terms of the
      5 # Common Development and Distribution License (the "License").
      6 # You may not use this file except in compliance with the License.
      7 #
      8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 #
     21 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     22 # Use is subject to license terms.
     23 #
     24 #ident	"@(#)Makefile.sfw	1.12	08/02/09 SMI"
     25 
     26 #
     27 # Note: psutils (SUNWpsutils) must be installed before building a2ps
     28 #
     29 
     30 VER=a2ps-4.13
     31 TARBALL=$(VER).tar.gz
     32 
     33 include ../Makefile.cmd
     34 
     35 SFW_PATH="$(SPRO_VROOT)/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/bin:$(PATH)"
     36 
     37 all: $(VER)/config.status
     38 	(cd $(VER); env \
     39 	    "CC=$(CC) -xc99=%all" \
     40 	    "CXX=$(CCC)" \
     41 	    CFLAGS="$(CFLAGS)" \
     42 	    LD_LIBRARY_PATH=/usr/sfw/lib \
     43 	    LD_OPTIONS="-L$(ROOT)/usr/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" \
     44 	    PATH=$(SFW_PATH) \
     45 	    $(MAKE) )
     46 	@find . -name core -exec rm -f {} \;
     47 
     48 # Leave in symlinks for compatibility
     49 COMPAT= a2ps card composeglyphs fixnt fixps ogonkify pdiff psmandup \
     50   psset texi2dvi4a2ps
     51 
     52 COMPATLINKS =	$(COMPAT:%=$(ROOTSFWBIN)/%)
     53 $(COMPATLINKS):
     54 	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
     55 
     56 ROOTETCLPFD = $(ROOTETC)/lp/fd
     57 FILTERDEFS =	a2ps.fd
     58 ROOTFILTERDEFS = $(FILTERDEFS:%=$(ROOTETCLPFD)/%)
     59 
     60 $(ROOTETCLPFD)/%:	Solaris/%
     61 	$(INS.file)
     62 
     63 install: all $(COMPATLINKS) $(ROOTFILTERDEFS)
     64 	# install the bits in the proto area
     65 	cd $(VER); env SRC=$(SRC) DESTDIR=$(ROOT) \
     66 		MANSCRIPT=$(SRC)/cmd/a2ps/sunman-stability \
     67 		$(MAKE) install
     68 	# fix the proto area
     69 	$(SRC)/tools/protofix --pkg SUNWa2psr --pkg SUNWa2psu --perm
     70 	# clean up the turds
     71 	$(RM) -f $(ROOT)/usr/lib/liba2ps.a $(ROOT)/usr/lib/liba2ps.la \
     72 		 $(ROOT)/a2ps.el $(ROOT)/a2ps-print.el
     73 
     74 check: $(VER)/config.status
     75 	(cd $(VER); env \
     76 	    PATH=$(SFW_PATH) \
     77 	    $(MAKE) check)
     78 
     79 $(VER)/config.status: $(VER)/configure
     80 	(cd $(VER); env \
     81 	    "CC=$(CC) -xc99=%all" \
     82 	    "CXX=$(CCC)" \
     83 	    CFLAGS="$(CFLAGS)" \
     84 	    INSTALL="$(SRC)/tools/install-proto" \
     85 	    LD_OPTIONS="-L$(ROOT)/usr/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" \
     86 	    EMACS=no \
     87 	    PATH=$(SFW_PATH) \
     88 	    MAKE=$(MAKE) \
     89 	    ./configure \
     90 			--with-medium=letter \
     91 			--enable-shared \
     92 			--sysconfdir=/etc/gnu \
     93 			--prefix=/usr \
     94 			--mandir=/usr/share/man \
     95 			--infodir=/usr/share/info \
     96 			)
     97 
     98 #
     99 # Patches applied:
    100 #  1. sheets.map.patch
    101 #     Fix so a2ps delegates conversion of tiff, gif and pdf files correctly.
    102 #     The changes are due to the differences between the output from 
    103 #     Sun's 'file' and from GNU 'file' utility for these file types.
    104 #  2. configure.patch
    105 #     Patch 'configure' so it uses a fontpath=/usr/sfw/share/ghostscript/fonts
    106 #
    107 
    108 $(VER)/configure: $(TARBALL)
    109 	gzip -dc $(TARBALL) | tar xopf -
    110 	/usr/bin/gpatch -p0 < Patches/configure.patch
    111 	/usr/bin/gpatch -p0 < Patches/sheets.map.patch
    112 	touch $(VER)/configure
    113 
    114 clean:
    115 	-rm -rf $(VER)
    116 
    117 include ../Makefile.targ
    118