Wed May 24 15:19:12 2017 UTC ()
Fix SunOS build with GCC 7 and newer.


(jperkin)
diff -r1.26 -r1.27 pkgsrc/print/ghostscript-gpl/Makefile

cvs diff -r1.26 -r1.27 pkgsrc/print/ghostscript-gpl/Makefile (switch to unified diff)

--- pkgsrc/print/ghostscript-gpl/Makefile 2017/05/19 13:29:04 1.26
+++ pkgsrc/print/ghostscript-gpl/Makefile 2017/05/24 15:19:12 1.27
@@ -1,122 +1,126 @@ @@ -1,122 +1,126 @@
1# $NetBSD: Makefile,v 1.26 2017/05/19 13:29:04 prlw1 Exp $ 1# $NetBSD: Makefile,v 1.27 2017/05/24 15:19:12 jperkin Exp $
2 2
3DISTNAME= ghostscript-${GS_VERSION} 3DISTNAME= ghostscript-${GS_VERSION}
4PKGNAME= ${DISTNAME:S/ghostscript/ghostscript-gpl/} 4PKGNAME= ${DISTNAME:S/ghostscript/ghostscript-gpl/}
5PKGREVISION= 13 5PKGREVISION= 13
6CATEGORIES= print 6CATEGORIES= print
7MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ghostscript/} 7MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ghostscript/}
8MASTER_SITES+= http://ghostscript.com/releases/ 8MASTER_SITES+= http://ghostscript.com/releases/
9EXTRACT_SUFX= .tar.bz2 9EXTRACT_SUFX= .tar.bz2
10 10
11MAINTAINER= pkgsrc-users@NetBSD.org 11MAINTAINER= pkgsrc-users@NetBSD.org
12HOMEPAGE= http://ghostscript.sourceforge.net/ 12HOMEPAGE= http://ghostscript.sourceforge.net/
13COMMENT= Postscript interpreter 13COMMENT= Postscript interpreter
14 14
15# Plus adobe verbatim for Resources/CMap. 15# Plus adobe verbatim for Resources/CMap.
16LICENSE= gnu-gpl-v3 16LICENSE= gnu-gpl-v3
17 17
18.include "Makefile.common" 18.include "Makefile.common"
19 19
20DEPENDS+= ghostscript-fonts>=6.0:../../fonts/ghostscript-fonts 20DEPENDS+= ghostscript-fonts>=6.0:../../fonts/ghostscript-fonts
21 21
22CONFLICTS+= ghostscript-afpl-[0-9]* 22CONFLICTS+= ghostscript-afpl-[0-9]*
23# To avoid flag from pkglint 23# To avoid flag from pkglint
24CONFLICTS+= ghostscript-esp-[0-9]* 24CONFLICTS+= ghostscript-esp-[0-9]*
25CONFLICTS+= ghostscript-esp-nox11-[0-9]* 25CONFLICTS+= ghostscript-esp-nox11-[0-9]*
26CONFLICTS+= ghostscript-gnu-x11-[0-9]* 26CONFLICTS+= ghostscript-gnu-x11-[0-9]*
27CONFLICTS+= ghostscript-gnu-nox11-[0-9]* 27CONFLICTS+= ghostscript-gnu-nox11-[0-9]*
28 28
29USE_TOOLS+= gmake perl:run lex pkg-config 29USE_TOOLS+= gmake perl:run lex pkg-config
30USE_LANGUAGES+= c c++ 30USE_LANGUAGES+= c c++
31GNU_CONFIGURE= yes 31GNU_CONFIGURE= yes
32UNLIMIT_RESOURCES+= datasize # gsromfs1.c 32UNLIMIT_RESOURCES+= datasize # gsromfs1.c
33 33
34BUILD_TARGET= so 34BUILD_TARGET= so
35INSTALL_TARGET= soinstall 35INSTALL_TARGET= soinstall
36CONFIGURE_ARGS+= --with-omni=no # otherwise pulls in libstdc++ 36CONFIGURE_ARGS+= --with-omni=no # otherwise pulls in libstdc++
37 37
38REPLACE_PERL+= toolbin/localcluster/clusterpush.pl 38REPLACE_PERL+= toolbin/localcluster/clusterpush.pl
39REPLACE_PERL+= toolbin/checkdeps.pl 39REPLACE_PERL+= toolbin/checkdeps.pl
40REPLACE_PERL+= toolbin/pscet_status.pl 40REPLACE_PERL+= toolbin/pscet_status.pl
41REPLACE_PERL+= toolbin/performance.pl 41REPLACE_PERL+= toolbin/performance.pl
42REPLACE_PERL+= toolbin/squeeze2html.pl 42REPLACE_PERL+= toolbin/squeeze2html.pl
43REPLACE_PERL+= toolbin/bugsByEngineer.pl 43REPLACE_PERL+= toolbin/bugsByEngineer.pl
44REPLACE_PERL+= toolbin/htmldiff.pl 44REPLACE_PERL+= toolbin/htmldiff.pl
45 45
46GS_RESOURCEDIR= ${PREFIX}/share/ghostscript/${PKGVERSION}/Resource 46GS_RESOURCEDIR= ${PREFIX}/share/ghostscript/${PKGVERSION}/Resource
47# MESSAGE file substitution 47# MESSAGE file substitution
48MESSAGE_SUBST+= GS_RESOURCEDIR=${GS_RESOURCEDIR} 48MESSAGE_SUBST+= GS_RESOURCEDIR=${GS_RESOURCEDIR}
49 49
50# XXX make sure the local jpeg headers are found before those pulled 50# XXX make sure the local jpeg headers are found before those pulled
51# in indirectly by cups bl3 51# in indirectly by cups bl3
52CPPFLAGS+= -Ijpeg 52CPPFLAGS+= -Ijpeg
53 53
54.include "../../mk/bsd.prefs.mk" 54.include "../../mk/bsd.prefs.mk"
55.include "../../mk/compiler.mk" 55.include "../../mk/compiler.mk"
56 56
57.if defined(PAPERSIZE) && (${PAPERSIZE} == "A4" || ${PAPERSIZE} == "a4") 57.if defined(PAPERSIZE) && (${PAPERSIZE} == "A4" || ${PAPERSIZE} == "a4")
58CFLAGS+= -DA4 58CFLAGS+= -DA4
59.endif 59.endif
60 60
61REQD_DIRS+= share/ghostscript 61REQD_DIRS+= share/ghostscript
62 62
63SUBST_CLASSES+= resdir 63SUBST_CLASSES+= resdir
64SUBST_STAGE.resdir= post-extract 64SUBST_STAGE.resdir= post-extract
65SUBST_MESSAGE.resdir= Fixing resource directory path 65SUBST_MESSAGE.resdir= Fixing resource directory path
66SUBST_FILES.resdir= Resource/Init/gs_res.ps 66SUBST_FILES.resdir= Resource/Init/gs_res.ps
67SUBST_SED.resdir= -e "s|/Resource/|${GS_RESOURCEDIR}/|g" 67SUBST_SED.resdir= -e "s|/Resource/|${GS_RESOURCEDIR}/|g"
68 68
69CONFIGURE_ENV.HPUX+= ac_cv_func_fopen64=no 69CONFIGURE_ENV.HPUX+= ac_cv_func_fopen64=no
70 70
71# On Linux-*-x86_64, there was an error message: 71# On Linux-*-x86_64, there was an error message:
72# gp_unix.o: relocation R_X86_64_32 against `a local symbol' can not be 72# gp_unix.o: relocation R_X86_64_32 against `a local symbol' can not be
73# used when making a shared object; recompile with -fPIC 73# used when making a shared object; recompile with -fPIC
74.if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang) 74.if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang)
75CFLAGS+= -fPIC 75CFLAGS+= -fPIC
76.endif 76.endif
77 77
 78.if ${OPSYS} == "SunOS" && !empty(CC_VERSION:Mgcc-[7-9]*)
 79CPPFLAGS+= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
 80.endif
 81
78# Interim IRIX build fix, the real problem is that fontconfig.pc doesn't 82# Interim IRIX build fix, the real problem is that fontconfig.pc doesn't
79# require linking against libiconv when it should do so. 83# require linking against libiconv when it should do so.
80BUILDLINK_TRANSFORM.IRIX+= l:fontconfig:fontconfig:iconv 84BUILDLINK_TRANSFORM.IRIX+= l:fontconfig:fontconfig:iconv
81 85
82CONFIGURE_ENV+= LPLIBDIR=${PREFIX}/lib 86CONFIGURE_ENV+= LPLIBDIR=${PREFIX}/lib
83 87
84# On OpenBSD 5.3, libxcb is required libXt. 88# On OpenBSD 5.3, libxcb is required libXt.
85LDFLAGS.OpenBSD+= -lxcb 89LDFLAGS.OpenBSD+= -lxcb
86 90
87.if ${OS_VARIANT} == "SCOOSR5" 91.if ${OS_VARIANT} == "SCOOSR5"
88# SCO OpenServer 5.0.7/3.2 has windows.h, and configure expacts it for MS Windows. 92# SCO OpenServer 5.0.7/3.2 has windows.h, and configure expacts it for MS Windows.
89CONFIGURE_ENV+= ac_cv_header_windows_h=no 93CONFIGURE_ENV+= ac_cv_header_windows_h=no
90.endif 94.endif
91 95
92.include "options.mk" 96.include "options.mk"
93 97
94post-extract: 98post-extract:
95 ${MKDIR} ${WRKSRC}/bin 99 ${MKDIR} ${WRKSRC}/bin
96 ${MKDIR} ${WRKSRC}/obj 100 ${MKDIR} ${WRKSRC}/obj
97# ${RM} -rf ${WRKSRC}/jasper 101# ${RM} -rf ${WRKSRC}/jasper
98 ${RM} -rf ${WRKSRC}/libpng 102 ${RM} -rf ${WRKSRC}/libpng
99# ${RM} -rf ${WRKSRC}/tiff 103# ${RM} -rf ${WRKSRC}/tiff
100# UX:i386ld: ERROR: symbol: 'deflate_copyright' defined in two shared objects: libgs.so: size = 53, libz.so.1: size = 68 104# UX:i386ld: ERROR: symbol: 'deflate_copyright' defined in two shared objects: libgs.so: size = 53, libz.so.1: size = 68
101.if ${OS_VARIANT} == "SCOOSR5" 105.if ${OS_VARIANT} == "SCOOSR5"
102 ${RM} -rf ${WRKSRC}/zlib 106 ${RM} -rf ${WRKSRC}/zlib
103.endif 107.endif
104 ${RM} -rf ${WRKSRC}/freetype 108 ${RM} -rf ${WRKSRC}/freetype
105# 109#
106# To allow outside customization, rename cidfmap 110# To allow outside customization, rename cidfmap
107# (if you look at inside of the file, it is logically empty) 111# (if you look at inside of the file, it is logically empty)
108.if !empty(PKG_OPTIONS:Mdisable-compile-inits) 112.if !empty(PKG_OPTIONS:Mdisable-compile-inits)
109 (cd ${WRKSRC}/Resource/Init/; ${MV} cidfmap cidfmap.dist) 113 (cd ${WRKSRC}/Resource/Init/; ${MV} cidfmap cidfmap.dist)
110.endif 114.endif
111 115
112post-install: 116post-install:
113 ${LN} -sf gsc ${DESTDIR}${PREFIX}/bin/gs 117 ${LN} -sf gsc ${DESTDIR}${PREFIX}/bin/gs
114 118
115.include "../../print/libpaper/buildlink3.mk" 119.include "../../print/libpaper/buildlink3.mk"
116.include "../../graphics/png/buildlink3.mk" 120.include "../../graphics/png/buildlink3.mk"
117.include "../../graphics/tiff/buildlink3.mk" 121.include "../../graphics/tiff/buildlink3.mk"
118.include "../../devel/zlib/buildlink3.mk" 122.include "../../devel/zlib/buildlink3.mk"
119.include "../../graphics/freetype2/buildlink3.mk" 123.include "../../graphics/freetype2/buildlink3.mk"
120# pkgsrc jasper is too new 124# pkgsrc jasper is too new
121#.include "../../graphics/jasper/buildlink3.mk" 125#.include "../../graphics/jasper/buildlink3.mk"
122.include "../../mk/bsd.pkg.mk" 126.include "../../mk/bsd.pkg.mk"