History

ghostscript v10.01.1

Ghostscript needs pread() and pwrite() to use tesseract, so it has to be disabled. The test binary fails to build with -pedantic: include/ghostscript/iapi.h:395:27: error: enumerator value for 'gs_spt_more_to_come' is not an integer constant expression [-Werror=pedantic]

darealshinji committed 3 years ago

Commit 2846c1e1 parent 82339a22 files · +11 −767Browse files

Unified · Split

2 files
  1. src/ghostscript-1-fixes.patch +0 −755
  2. src/ghostscript.mk +11 −12
src/ghostscript-1-fixes.patch+0−755
@@ -1,755 +0,0 @@
1This file is part of MXE. See LICENSE.md for licensing information.
2
3Contains ad hoc patches for cross building.
4
5From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6From: darealshinji <djcj@gmx.de>
7Date: Mon, 3 Dec 2018 21:05:41 +0100
8Subject: [PATCH 1/2] cross-build fixes, hide libgs symbols
9
10
11diff --git a/Makefile.in b/Makefile.in
12index 1111111..2222222 100644
13--- a/Makefile.in
14+++ b/Makefile.in
15@@ -172,6 +172,9 @@ CAPOPT= @HAVE_MKSTEMP@ @HAVE_FILE64@ @HAVE_FSEEKO@ @HAVE_MKSTEMP64@ @HAVE_FONTCO
16
17 GS=@GS@
18 GS_SO_BASE=@GS@
19+GS_SONAME=@GS_SONAME@
20+GS_SONAME_MAJOR=@GS_SONAME_MAJOR@
21+GS_SONAME_MAJOR_MINOR=@GS_SONAME_MAJOR_MINOR@
22
23 PCL=@PCL@
24 PCL_SO_BASE=@PCL@
25@@ -183,7 +186,7 @@ GPDL=@GPDL@
26 GPDL_SO_BASE=@GPDL@
27
28 XE=@EXEEXT@
29-XEAUX=@EXEEXT@
30+XEAUX=@AUXEXEEXT@
31
32 PCL_TARGET=@PCL_TARGET@
33 XPS_TARGET=@XPS_TARGET@
34diff --git a/base/gp_unix.c b/base/gp_unix.c
35index 1111111..2222222 100644
36--- a/base/gp_unix.c
37+++ b/base/gp_unix.c
38@@ -16,6 +16,9 @@
39
40 /* Unix-specific routines for Ghostscript */
41
42+#ifdef __MINGW32__
43+# include "windows_.h"
44+#endif
45 #include "pipe_.h"
46 #include "string_.h"
47 #include "time_.h"
48@@ -466,3 +469,54 @@ void gp_enumerate_fonts_free(void *enum_state)
49 }
50 #endif
51 }
52+
53+/* A function to decode the next codepoint of the supplied args from the
54+ * local windows codepage, or -1 for EOF.
55+ * (copied from gp_win32.c)
56+ */
57+
58+#ifdef __MINGW32__
59+int
60+gp_local_arg_encoding_get_codepoint(gp_file *file, const char **astr)
61+{
62+ int len;
63+ int c;
64+ char arg[3];
65+ wchar_t unicode[2];
66+ char utf8[4];
67+
68+ if (file) {
69+ c = fgetc(file);
70+ if (c == EOF)
71+ return EOF;
72+ } else if (**astr) {
73+ c = *(*astr)++;
74+ if (c == 0)
75+ return EOF;
76+ } else {
77+ return EOF;
78+ }
79+
80+ arg[0] = c;
81+ if (IsDBCSLeadByte(c)) {
82+ if (file) {
83+ c = fgetc(file);
84+ if (c == EOF)
85+ return EOF;
86+ } else if (**astr) {
87+ c = *(*astr)++;
88+ if (c == 0)
89+ return EOF;
90+ }
91+ arg[1] = c;
92+ len = 2;
93+ } else {
94+ len = 1;
95+ }
96+
97+ /* Convert the string (unterminated in, unterminated out) */
98+ len = MultiByteToWideChar(CP_ACP, 0, arg, len, unicode, 2);
99+
100+ return unicode[0];
101+}
102+#endif /* __MINGW32__ */
103diff --git a/base/unix-aux.mak b/base/unix-aux.mak
104index 1111111..2222222 100644
105--- a/base/unix-aux.mak
106+++ b/base/unix-aux.mak
107@@ -57,23 +57,29 @@ $(AUX)gp_stdia.$(OBJ): $(GLSRC)gp_stdia.c $(AK)\
108 # -------------------------- Auxiliary programs --------------------------- #
109
110 $(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
111+ test -e $(ECHOGS_XE) || \
112 $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
113
114 $(PACKPS_XE): $(GLSRC)pack_ps.c $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
115+ test -e $(PACKPS_XE) || \
116 $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(PACKPS_XE) $(GLSRC)pack_ps.c $(AUXEXTRALIBS)
117
118 # On the RS/6000 (at least), compiling genarch.c with gcc with -O
119 # produces a buggy executable.
120 $(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
121+ test -e $(GENARCH_XE) || \
122 $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
123
124 $(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
125+ test -e $(GENCONF_XE) || \
126 $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
127
128 $(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
129+ test -e $(GENDEV_XE) || \
130 $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
131
132 $(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
133+ test -e $(GENHT_XE) || \
134 $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
135
136 # To get GS to use the system zlib, you remove/hide the gs/zlib directory
137@@ -84,6 +90,7 @@ MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
138 $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
139
140 $(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS)
141+ test -e $(MKROMFS_XE)_0 || \
142 $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
143
144 # .... and one using the zlib library linked via the command line
145@@ -93,9 +100,11 @@ MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
146 $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
147
148 $(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS)
149+ test -e $(MKROMFS_XE)_1 || \
150 $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
151
152 $(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS)
153+ test -e $(MKROMFS_XE) || \
154 $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
155
156 # Query the environment to construct gconfig_.h.
157diff --git a/base/unix-dll.mak b/base/unix-dll.mak
158index 1111111..2222222 100644
159--- a/base/unix-dll.mak
160+++ b/base/unix-dll.mak
161@@ -66,9 +66,6 @@ GPDL_SONAME_BASE=lib$(GPDL_SO_BASE)
162 GS_SOEXT=$(SO_LIB_EXT)
163 GS_DLLEXT=$(DLL_EXT)
164
165-GS_SONAME=$(GS_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
166-GS_SONAME_MAJOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
167-GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MINOR)$(GS_DLLEXT)
168
169 PCL_SONAME=$(PCL_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
170 PCL_SONAME_MAJOR=$(PCL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
171diff --git a/configure.ac b/configure.ac
172index 1111111..2222222 100644
173--- a/configure.ac
174+++ b/configure.ac
175@@ -23,6 +23,7 @@ AC_INIT
176 AC_PREREQ(2.63)
177 AC_LANG(C)
178 AC_CONFIG_SRCDIR(psi/gs.c)
179+AC_CANONICAL_HOST
180
181 dnl Inherit compiler flags from the environment...
182 CFLAGS="${CFLAGS:=}"
183@@ -125,8 +126,11 @@ AUXEXTRALIBSTMP="\$(EXTRALIBS)"
184
185 # purposefully do not include "help" output for this
186 AC_ARG_ENABLE([save_confaux])
187+AC_ARG_ENABLE([auxtools_only])
188
189-if test x"$CCAUX" != x"" ; then
190+absolute_source_path=$(cd "$(dirname "$0")" && pwd)
191+
192+if test x"$host" != x"$build" ; then
193 # rerun configure for the AUX tools, disabling a load of tests not relevant for CCAUX
194 olddir=`pwd`
195 if test x"$enable_save_confaux" = x"yes"; then
196@@ -146,9 +150,10 @@ if test x"$CCAUX" != x"" ; then
197 echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in
198 echo $AUXFLAGS_MAK_LINE07 >> $AUXFLAGS_MAK.in
199
200- ../$0 CC="$CCAUX" CFLAGS="$CFLAGSAUX" LDFLAGS="$LDFLAGSAUX" CCAUX= CFLAGSAUX= CFLAGSAUX= MAKEFILE=$AUXFLAGS_MAK --host= --build= --without-libtiff --disable-contrib --disable-fontconfig --disable-dbus --disable-freetype --disable-fapi --disable-cups --disable-openjpeg --disable-gtk --with-libiconv=no --without-libidn --without-libpaper --without-pdftoraster --without-ijs --without-luratech --without-jbig2dec --without-x --with-drivers=""
201+ AC_MSG_NOTICE([Begin recursive call to configure script (for auxiliary tools)])
202+ "$absolute_source_path/configure" CC="$CCAUX" CFLAGS="$CFLAGSAUX" LDFLAGS="$LDFLAGSAUX" CCAUX= CFLAGSAUX= CFLAGSAUX= MAKEFILE=$AUXFLAGS_MAK --host=$build --build=$build --enable-auxtools_only --with-local-zlib --without-libtiff --disable-contrib --disable-fontconfig --disable-dbus --disable-freetype --disable-fapi --disable-cups --disable-openjpeg --disable-gtk --with-libiconv=no --without-libidn --without-libpaper --without-pdftoraster --without-ijs --without-luratech --without-jbig2dec --without-x --with-drivers=""
203 status=$?
204- cp config.log ../configaux.log
205+ cp config.log $olddir/configaux.log
206 if test $status -eq 0 ; then
207 CCAUX=$(grep CCAUX $AUXFLAGS_MAK | sed "s/CCAUX=//g")
208 GCFLAGSAUXTMP=$(grep GCFLAGSAUX $AUXFLAGS_MAK | sed "s/GCFLAGSAUX=//g")
209@@ -204,7 +209,7 @@ AC_PATH_TOOL(PKGCONFIG, pkg-config)
210 # but if we are cross compiling, and there isn't a matching
211 # pkconfig for the --host setting, then don't use the 'local'
212 # pkconfig at all
213-if test x"$cross_compiling" = x"yes"; then
214+if test x"$host" != x"$build" ; then
215 AC_PATH_PROG(BUILD_PKGCONFIG, pkg-config)
216 if test x"$BUILD_PKGCONFIG" = x"$PKGCONFIG" ; then
217 PKGCONFIG=
218@@ -217,7 +222,7 @@ AC_PATH_TOOL(STRIP_XE, strip)
219 # but if we are cross compiling, and there isn't a matching
220 # pkconfig for the --host setting, then don't use the 'local'
221 # pkconfig at all
222-if test x"$cross_compiling" = x"yes"; then
223+if test x"$host" != x"$build" ; then
224 AC_PATH_PROG(BUILD_STRIP_XE, strip)
225 if test x"$BUILD_STRIP_XE" = x"$STRIP_XE" ; then
226 STRIP_XE=
227@@ -234,18 +239,14 @@ CONTRIBINCLUDE="include $srcdir/contrib/contrib.mak"
228 INSTALL_CONTRIB="install-contrib-extras"
229
230 if test x"$enable_contrib" = x; then
231- if test x"$cross_compiling" = x"yes"; then
232- enable_contrib=
233- else
234- case `uname` in
235- MINGW*|MSYS*)
236+ case $host in
237+ *-mingw*|*-msys*|*-cygwin*)
238 AC_MSG_WARN([disabling contrib devices])
239 enable_contrib=no
240 ;;
241 *)
242 ;;
243 esac
244- fi
245 fi
246
247 if test x"$enable_contrib" != x"no"; then
248@@ -274,26 +275,27 @@ dnl --------------------------------------------------
249 CC_OPT_FLAGS_TO_TRY="-O"
250 SET_DT_SONAME="-soname="
251
252-if test x"$cross_compiling" = x"yes"; then
253- if test $ac_cv_prog_gcc = yes; then
254- CC_OPT_FLAGS_TO_TRY="-O2"
255- CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
256- fi
257-else
258- case `uname` in
259- Linux*|GNU*)
260+ case $host in
261+ *-mingw*|*-msys*|*-cygwin*)
262 if test $ac_cv_prog_gcc = yes; then
263 CC_OPT_FLAGS_TO_TRY="-O2"
264 CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
265 fi
266+ SET_DT_SONAME=""
267 ;;
268- *BSD)
269+ *-linux*|*-gnu)
270+ if test $ac_cv_prog_gcc = yes; then
271+ CC_OPT_FLAGS_TO_TRY="-O2"
272+ CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
273+ fi
274+ ;;
275+ *bsd*)
276 if test $ac_cv_prog_gcc = yes; then
277 CC_OPT_FLAGS_TO_TRY="-O2"
278 CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
279 fi
280 ;;
281- Darwin*)
282+ *-darwin*)
283 if test $ac_cv_prog_gcc = yes; then
284 CC_OPT_FLAGS_TO_TRY="-O2"
285 CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
286@@ -321,7 +323,6 @@ else
287 fi
288 ;;
289 esac
290-fi
291
292 AC_SUBST(SET_DT_SONAME)
293
294@@ -368,18 +369,20 @@ AC_ARG_WITH([arch_h], AC_HELP_STRING([--with-arch_h=<arch.h to use>],
295 ARCH_CONF_HEADER=
296
297 if test x"$with_arch_h" = x""; then
298- if test x"$cross_compiling" = x"yes"; then
299- ARCH_CONF_HEADER="\$(GLSRCDIR)/../$ARCH_AUTOCONF_HEADER"
300- else
301- case `uname` in
302- Darwin*)
303+ case $host in
304+ x86_64*-mingw*|x86_64*-msys*|x86_64*-cygwin*)
305+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/windows-x64-msvc.h"
306+ ;;
307+ *-mingw*|*-msys*|*-cygwin*)
308+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/windows-x86-msvc.h"
309+ ;;
310+ *-darwin*)
311 ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/osx-x86-x86_64-ppc-gcc.h"
312 ;;
313 *)
314 ARCH_CONF_HEADER=
315 ;;
316 esac
317- fi
318 else
319 ARCH_CONF_HEADER=$with_arch_h
320 fi
321@@ -658,15 +661,7 @@ dnl Set options that we want to pass into all other
322 dnl configure scripts we might call
323 dnl --------------------------------------------------
324
325-SUBCONFIG_OPTS=""
326-
327-if test x"$build_alias" != x""; then
328- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --build=$build_alias"
329-fi
330-
331-if test x"$host_alias" != x""; then
332- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host_alias"
333-fi
334+SUBCONFIG_OPTS="--build=$build --host=$host"
335
336 dnl --------------------------------------------------
337 dnl Check for libraries
338@@ -996,7 +991,7 @@ if test x"$enable_fapi" != xno; then
339 if $PKGCONFIG --atleast-version=12.0.6 freetype2; then
340 AC_MSG_RESULT(yes)
341 FT_CFLAGS="$CFLAGS `$PKGCONFIG --cflags freetype2`"
342- FT_LIBS="`$PKGCONFIG --libs freetype2`"
343+ FT_LIBS="`$PKGCONFIG --libs-only-l freetype2`"
344 FT_BRIDGE=1
345 SHARE_FT=1
346 else
347@@ -1047,6 +1042,14 @@ AC_SUBST(FTSRCDIR)
348 AC_SUBST(FT_CFLAGS)
349 AC_SUBST(FT_LIBS)
350
351+if test x"$enable_auxtools_only" = x"yes" ; then
352+ LIBJPEGDIR=
353+ SHARE_LIBJPEG=0
354+ AC_DEFINE([DONT_HAVE_JMEMSYS_H], 1, [])
355+ AC_SUBST(SHARE_LIBJPEG)
356+ AC_SUBST(LIBJPEGDIR)
357+else
358+
359 AC_MSG_CHECKING([for local jpeg library source])
360 dnl At present, we give the local source priority over the shared
361 dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied.
362@@ -1088,6 +1091,13 @@ else
363 [define if the libjpeg memory system prototypes aren't available])
364 fi
365
366+fi # $enable_auxtools_only
367+
368+# this option is useful if you're cross-compiling and want to use
369+# your toolchain's zlib for $host but the local one for $build
370+AC_ARG_WITH([local-zlib], AC_HELP_STRING([--without-local-zlib],
371+ [do not check for local zlib sources (has no effect on AUX toolchain when cross-building)]))
372+
373 AC_MSG_CHECKING([for local zlib source])
374 dnl zlib is needed for language level 3, and libpng
375 # we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR)
376@@ -1096,6 +1106,13 @@ ZLIBDIR=src
377 AUX_SHARED_ZLIB=
378 ZLIBCFLAGS=""
379
380+if test x"$with_local_zlib" = x"no" ; then
381+ AC_MSG_RESULT([skip])
382+ AC_CHECK_LIB(z, deflate, [
383+ AC_CHECK_HEADERS(zlib.h, [SHARE_ZLIB=1; AUX_SHARED_ZLIB="-l\$(ZLIB_NAME)"])
384+ ])
385+else
386+
387 if test -d $srcdir/zlib; then
388 AC_MSG_RESULT([yes])
389 SHARE_ZLIB=0
390@@ -1110,6 +1127,9 @@ else
391 AC_CHECK_HEADERS(zlib.h, [SHARE_ZLIB=1; AUX_SHARED_ZLIB="-l\$(ZLIB_NAME)"])
392 ])
393 fi
394+
395+fi # $with_local_zlib
396+
397 if test -z "$SHARE_ZLIB"; then
398 AC_MSG_ERROR([I did not find a copy of zlib on your system.
399 Please either install it, or unpack a copy of the source in a
400@@ -1136,6 +1156,11 @@ AC_SUBST(ZLIBDIR)
401 AC_SUBST(FT_SYS_ZLIB)
402
403 dnl png for the png output device; it also requires zlib
404+if test x"$enable_auxtools_only" = x"yes" ; then
405+ LIBPNGDIR=""
406+ SHARE_LIBPNG=0
407+else
408+
409 LIBPNGDIR=src
410 PNGDEVS=''
411 PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
412@@ -1157,12 +1182,21 @@ fi
413 if test -z "$PNGDEVS"; then
414 AC_MSG_NOTICE([disabling png output devices])
415 fi
416+
417+fi # $enable_auxtools_only
418+
419 AC_SUBST(SHARE_LIBPNG)
420 AC_SUBST(LIBPNGDIR)
421 #AC_SUBST(PNGDEVS)
422
423 WHICHLCMS=
424
425+if test x"$enable_auxtools_only" = x"yes" ; then
426+ SHARELCMS=0
427+ LCMS2DIR=
428+ LCMS2MTDIR=
429+else
430+
431 AC_MSG_CHECKING([for local lcms2mt library source])
432 LCMS2DIR=src
433 LCMS2MTDIR=src
434@@ -1197,6 +1231,8 @@ else
435 fi
436 fi
437
438+fi # $enable_auxtools_only
439+
440 AC_SUBST(SHARELCMS)
441 AC_SUBST(WHICHLCMS)
442 AC_SUBST(LCMS2DIR)
443@@ -1349,7 +1385,7 @@ EXPATDIR=src
444 EXPAT_CFLAGS=
445 EXPAT_LIBS=
446
447-if test x"$with_xps" != x"no" ; then
448+if test x"$with_xps" != x"no" -a x"$enable_auxtools_only" != x"yes" ; then
449 if test -f $srcdir/xps/xps.mak; then
450 AC_MSG_CHECKING([for local expat library source])
451 if test -f $srcdir/expat/lib/expat.h ; then
452@@ -1528,16 +1564,14 @@ dnl look for IJS implementation
453 AC_ARG_WITH([ijs], AC_HELP_STRING([--without-ijs],
454 [disable IJS driver support]))
455
456-if test x"$cross_compiling" != x"yes"; then
457- case `uname` in
458- MINGW*|MSYS*)
459+ case $host in
460+ *-mingw*|*-msys*|*-cygwin*)
461 AC_MSG_WARN([disabling the ijs device])
462 with_ijs=no
463 ;;
464 *)
465 ;;
466 esac
467-fi
468
469 dnl set safe defaults
470 IJSDIR=src
471@@ -1589,15 +1623,8 @@ if test x$with_luratech != xno; then
472 SHARE_JBIG2=0
473 JBIG2DIR=$srcdir/luratech/ldf_jb2
474
475- if test x"$cross_compiling" = x"yes"; then
476- if test x"$JBIG2_CFLAGS" != x""; then
477- JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char $JBIG2_CFLAGS"
478- else
479- JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
480- fi
481- else
482- case `uname` in
483- Darwin*)
484+ case $host in
485+ *-darwin*)
486 JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -DMAC -DMAC_OS_X_BUILD -fsigned-char"
487 ;;
488 AIX)
489@@ -1611,7 +1638,6 @@ if test x$with_luratech != xno; then
490 JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
491 ;;
492 esac
493- fi
494
495 JBIG2FILEDEVS='$(DD)gdevjbig2.dev'
496 JBIG2DEVS='$(PSD)jbig2.dev'
497@@ -1734,15 +1760,8 @@ if test x$with_luratech != xno; then
498 SHARE_JPX=0
499 JPXDIR=$srcdir/luratech/lwf_jp2
500
501- if test x"$cross_compiling" = x"yes"; then
502- if test x"$JPX_CFLAGS" != x""; then
503- JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 $JPX_CFLAGS"
504- else
505- JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DLINUX=1 -DFORTE"
506- fi
507- else
508- case `uname` in
509- Darwin*)
510+ case $host in
511+ *-darwin*)
512 JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DMAC -DMAC_OS_X_BUILD"
513 ;;
514 AIX)
515@@ -1756,7 +1775,6 @@ if test x$with_luratech != xno; then
516 JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DLINUX=1 -DFORTE"
517 ;;
518 esac
519- fi
520 JPXDEVS='$(PSD)jpx.dev'
521 else
522 AC_MSG_RESULT([no])
523@@ -2506,22 +2524,15 @@ SO_LIB_EXT=".so"
524 DLL_EXT=""
525 SO_LIB_VERSION_SEPARATOR="."
526
527-if test x"$cross_compiling" = x"yes"; then
528- DYNAMIC_CFLAGS="-fPIC"
529- GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
530- PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
531- XPS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR)"
532- PDL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GPDL_SONAME_MAJOR)"
533- if test $ac_cv_prog_gcc = yes; then
534- # GCC high level flag
535- DYNAMIC_LIBS="-rdynamic"
536- else
537- DYNAMIC_LIBS=""
538- fi
539- SO_LIB_EXT=".so"
540-else
541- case `uname` in
542- Linux*|GNU*)
543+libname1="_SO_BASE)\$(GS_SOEXT)\$(DLL_EXT)"
544+libname2="_SO_BASE)\$(GS_SOEXT)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MAJOR)\$(DLL_EXT)"
545+libname3="_SO_BASE)\$(GS_SOEXT)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MAJOR)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MINOR)\$(DLL_EXT)"
546+GS_SONAME="lib\$(GS${libname1}"
547+GS_SONAME_MAJOR="lib\$(GS${libname2}"
548+GS_SONAME_MAJOR_MINOR="lib\$(GS${libname3}"
549+
550+case $host in
551+ *-linux*|*-gnu)
552 DYNAMIC_CFLAGS="-fPIC"
553 GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
554 PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
555@@ -2535,17 +2546,21 @@ else
556 fi
557 SO_LIB_EXT=".so"
558 ;;
559- MINGW*|MSYS*)
560- DYNAMIC_CFLAGS=""
561- GS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(GS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
562+ *-mingw*|*-msys*|*-cygwin*)
563+ DYNAMIC_CFLAGS="-fvisibility=hidden -DGSDLLEXPORT=\"__declspec(dllexport)\""
564+ GS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(GS_SO_BASE).dll.a -Wl,--enable-auto-import"
565 PCL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PCL_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
566 XPS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(XPS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
567 PDL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PDL_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
568 SO_LIB_EXT=""
569 DLL_EXT=".dll"
570 SO_LIB_VERSION_SEPARATOR="-"
571+ # make sure the import library doesn't link a program against the DLL with the minor version in it
572+ GS_SONAME="lib\$(GS${libname1}"
573+ GS_SONAME_MAJOR="lib\$(GS${libname3}"
574+ GS_SONAME_MAJOR_MINOR="lib\$(GS${libname2}"
575 ;;
576- *BSD)
577+ *bsd*)
578 DYNAMIC_CFLAGS="-fPIC"
579 GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
580 PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
581@@ -2553,7 +2568,7 @@ else
582 DYNAMIC_LIBS=""
583 SO_LIB_EXT=".so"
584 ;;
585- Darwin*)
586+ *-darwin*)
587 GS_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(GS_SONAME_MAJOR_MINOR)"
588 PCL_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(PCL_SONAME_MAJOR_MINOR)"
589 XPS_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(XPS_SONAME_MAJOR_MINOR)"
590@@ -2591,15 +2606,18 @@ else
591 fi
592 SO_LIB_EXT=".so"
593 ;;
594- esac
595-fi
596+esac
597+
598+AC_SUBST(GS_SONAME)
599+AC_SUBST(GS_SONAME_MAJOR)
600+AC_SUBST(GS_SONAME_MAJOR_MINOR)
601
602 AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
603 [Enable dynamically loaded drivers]),
604 [
605 if test "x$enable_dynamic" != xno; then
606- case `uname` in
607- Linux*|GNU*)
608+ case $host in
609+ *-linux*|*-gnu)
610 INSTALL_SHARED="install-shared"
611 if test "x$X_DEVS" != x; then
612 DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
613@@ -2611,14 +2629,14 @@ AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
614 OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
615 DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
616 ;;
617- *BSD)
618+ *bsd*)
619 DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
620 DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
621 X11_DEVS=""
622 OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
623 DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
624 ;;
625- Darwin*)
626+ *-darwin*)
627 INSTALL_SHARED="install-shared"
628 DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
629 X11_DEVS=""
630@@ -2963,23 +2981,31 @@ AC_SUBST(AUXDIRPOSTFIX)
631 # usually empty on Unix-like systems
632 # --------------------------------------------------
633 EXEEXT=""
634+AUXEXEEXT=""
635+
636+case $host in
637+ *-mingw*|*-msys*|*-cygwin*)
638+ EXEEXT=".exe"
639+ ;;
640+ *)
641+ ;;
642+esac
643
644 AC_ARG_WITH([exe-ext], AC_HELP_STRING([--with-exe-ext=EXT],
645- [set the file name executable extension (must include any separator e.g. the period in ".exe")]),[], [exe_ext=])
646+ [set the file name executable extension (must include any separator e.g. the period in ".exe")]),
647+ [EXEEXT="$with_exe_ext"])
648
649-if test "x"$with_exe_ext != "x"; then
650- EXEEXT="$with_exe_ext"
651-else
652- if test x"$cross_compiling" != x"yes"; then
653- case `uname` in
654- MINGW*|MSYS*)
655- EXEEXT=".exe"
656- ;;
657- esac
658- fi
659-fi
660+case $build in
661+ *-mingw*|*-msys*|*-cygwin*)
662+ AUXEXEEXT=".exe"
663+ ;;
664+ *)
665+ AUXEXEEXT="$EXEEXT"
666+ ;;
667+esac
668
669 AC_SUBST(EXEEXT)
670+AC_SUBST(AUXEXEEXT)
671
672 # --------------------------------------------------
673 # Check for disabling of versioned path option.
674@@ -3034,7 +3060,7 @@ fi
675
676 AC_SUBST(CLUSTER_CFLAGS)
677
678-if test x"$CCAUX" != x"$CC"; then
679+if test x"$build" != x"$host"; then
680
681 ilog2()
682 {
683@@ -3174,7 +3200,7 @@ AC_SUBST(AUXEXTRALIBS)
684
685 CONFIG_FILES_LIST="$CONFIG_FILES_LIST $THEMAKEFILE"
686
687-if test x"$THEMAKEFILE" != x"$MAKEFILE" && test x"$CCAUX" = x"$CC"; then
688+if test x"$THEMAKEFILE" != x"$MAKEFILE" && test x"$build" = x"$host"; then
689 CONFIG_FILES_LIST="$CONFIG_FILES_LIST"
690 fi
691
692diff --git a/psi/iapi.h b/psi/iapi.h
693index 1111111..2222222 100644
694--- a/psi/iapi.h
695+++ b/psi/iapi.h
696@@ -68,6 +68,11 @@ extern "C" {
697 # define GSDLLEXPORT
698 # endif
699 # endif
700+# ifdef __MINGW32__
701+/* export stdcall functions as "name" instead of "_name@ordinal" */
702+# undef GSDLLAPI
703+# define GSDLLAPI
704+# endif
705 # ifndef GSDLLAPI
706 # define GSDLLAPI __stdcall
707 # endif
708
709From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
710From: Chris Liddell <chris.liddell@artifex.com>
711Date: Tue, 20 Oct 2020 08:49:45 +0100
712Subject: [PATCH 2/2] Bug 702985: drop use of FT_CALLBACK_DEF() def
713
714Taken from:
715https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=41ef9a0bc36b#patch1
716
717From 2.10.3, Freetype disappeared the FT_CALLBACK_DEF() macro, which is what
718we used when defining our callbacks from Freetype.
719
720No guidance forthcoming from the Freetype developer who made those changes,
721so change to explicitly declaring the callbacks file static.
722
723Should fix the reported build failures.
724
725diff --git a/base/fapi_ft.c b/base/fapi_ft.c
726index 1111111..2222222 100644
727--- a/base/fapi_ft.c
728+++ b/base/fapi_ft.c
729@@ -125,7 +125,7 @@ static void
730 delete_inc_int_info(gs_fapi_server * a_server,
731 FT_IncrementalRec * a_inc_int_info);
732
733-FT_CALLBACK_DEF(void *)
734+static void *
735 FF_alloc(FT_Memory memory, long size)
736 {
737 gs_memory_t *mem = (gs_memory_t *) memory->user;
738@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
739 return (gs_malloc(mem, size, 1, "FF_alloc"));
740 }
741
742-FT_CALLBACK_DEF(void *)
743+static void *
744 FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
745 {
746 gs_memory_t *mem = (gs_memory_t *) memory->user;
747@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
748 return (tmp);
749 }
750
751-FT_CALLBACK_DEF(void)
752+static void
753 FF_free(FT_Memory memory, void *block)
754 {
755 gs_memory_t *mem = (gs_memory_t *) memory->user;
src/ghostscript.mk+11−12
@@ -3,9 +3,10 @@ · 2 unmodified lines
3PKG := ghostscript3PKG := ghostscript
4$(PKG)_WEBSITE := https://www.ghostscript.com/4$(PKG)_WEBSITE := https://www.ghostscript.com/
5$(PKG)_IGNORE :=5$(PKG)_IGNORE :=
6$(PKG)_VERSION := 9.506$(PKG)_VERSION := 10.01.1
7$(PKG)_NODOTVER := $(subst .,,$($(PKG)_VERSION))7$(PKG)_NODOTVER := $(subst .,,$($(PKG)_VERSION))
8$(PKG)_CHECKSUM := db9bb0817b6f22974e6d5ad751975f346420c2c86a0afcfe6b4e09c47803e7d48$(PKG)_MAJORVER := $(firstword $(subst ., ,$($(PKG)_VERSION)))
9$(PKG)_CHECKSUM := c91193635aa2578f9508b8ba846106c1e3705fbd3fed5fd9a015f21b55f15d68
9$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)10$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
10$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz11$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz
11$(PKG)_URL := https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$($(PKG)_NODOTVER)/$($(PKG)_FILE)12$(PKG)_URL := https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$($(PKG)_NODOTVER)/$($(PKG)_FILE)
@@ -18,16 +19,14 @@ define $(PKG)_UPDATE · 6 unmodified lines
18endef19endef
19 20
20define $(PKG)_BUILD21define $(PKG)_BUILD
21 cp -f `automake --print-libdir`/{config.guess,config.sub,install-sh} '$(SOURCE_DIR)'
22 cd '$(SOURCE_DIR)' && rm -rf freetype jpeg lcms2mt libpng openjpeg tiff22 cd '$(SOURCE_DIR)' && rm -rf freetype jpeg lcms2mt libpng openjpeg tiff
23 cd '$(SOURCE_DIR)' && autoreconf -f -i
24 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \23 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
25 CPPFLAGS='$(CPPFLAGS) -DHAVE_SYS_TIMES_H=0' \
26 $(MXE_CONFIGURE_OPTS) \24 $(MXE_CONFIGURE_OPTS) \
27 --with-libiconv=gnu \25 --with-libiconv=gnu \
28 --without-local-zlib26 --without-local-zlib \
29 $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(if $(BUILD_STATIC),libgs,so) || \27 --without-tesseract
30 $(MAKE) -C '$(BUILD_DIR)' -j '1' $(if $(BUILD_STATIC),libgs,so)28 $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(if $(BUILD_STATIC),libgs,so-only) || \
29 $(MAKE) -C '$(BUILD_DIR)' -j '1' $(if $(BUILD_STATIC),libgs,so-only)
31 30
32 $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/ghostscript'31 $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/ghostscript'
33 $(INSTALL) '$(SOURCE_DIR)/devices/gdevdsp.h' '$(PREFIX)/$(TARGET)/include/ghostscript/gdevdsp.h'32 $(INSTALL) '$(SOURCE_DIR)/devices/gdevdsp.h' '$(PREFIX)/$(TARGET)/include/ghostscript/gdevdsp.h'
@@ -38,7 +37,7 @@ define $(PKG)_BUILD · 4 unmodified lines
38 $(INSTALL) -d '$(PREFIX)/$(TARGET)/bin'37 $(INSTALL) -d '$(PREFIX)/$(TARGET)/bin'
39 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'38 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
40 $(if $(BUILD_STATIC),$(INSTALL) '$(BUILD_DIR)/bin/gs.a' '$(PREFIX)/$(TARGET)/lib/libgs.a', \39 $(if $(BUILD_STATIC),$(INSTALL) '$(BUILD_DIR)/bin/gs.a' '$(PREFIX)/$(TARGET)/lib/libgs.a', \
41 $(INSTALL) '$(BUILD_DIR)/sobin/libgs-9.dll' '$(PREFIX)/$(TARGET)/bin/libgs-9.dll' && \40 $(INSTALL) '$(BUILD_DIR)/sobin/libgs-$($(PKG)_MAJORVER).dll' '$(PREFIX)/$(TARGET)/bin/libgs-$($(PKG)_MAJORVER).dll' && \
42 $(INSTALL) '$(BUILD_DIR)/sobin/libgs.dll.a' '$(PREFIX)/$(TARGET)/lib/libgs.dll.a')41 $(INSTALL) '$(BUILD_DIR)/sobin/libgs.dll.a' '$(PREFIX)/$(TARGET)/lib/libgs.dll.a')
43 42
44 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'43 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
@@ -47,13 +46,13 @@ define $(PKG)_BUILD · 2 unmodified lines
47 echo 'Description: Ghostscript library'; \46 echo 'Description: Ghostscript library'; \
48 echo 'Cflags: -I"$(PREFIX)/$(TARGET)/include/ghostscript"'; \47 echo 'Cflags: -I"$(PREFIX)/$(TARGET)/include/ghostscript"'; \
49 echo 'Libs: -L"$(PREFIX)/$(TARGET)/lib" -lgs'; \48 echo 'Libs: -L"$(PREFIX)/$(TARGET)/lib" -lgs'; \
50 echo 'Requires: fontconfig freetype2 lcms2 libidn libtiff-4 libpng libopenjp2 libjpeg zlib'; \49 echo 'Requires: dbus-1 fontconfig freetype2 lcms2 libidn libpaper libtiff-4 libpng libopenjp2 libjpeg zlib'; \
51 echo '# https://github.com/mxe/mxe/issues/1446'; \50 echo '# https://github.com/mxe/mxe/issues/1446'; \
52 echo 'Libs.private: -lm -liconv -lpaper -lwinspool';) \51 echo 'Libs.private: -lm -liconv -lwinspool';) \
53 > '$(PREFIX)/$(TARGET)/lib/pkgconfig/ghostscript.pc'52 > '$(PREFIX)/$(TARGET)/lib/pkgconfig/ghostscript.pc'
54 53
55 '$(TARGET)-gcc' \54 '$(TARGET)-gcc' \
56 -W -Wall -Werror -pedantic \55 -W -Wall -Werror \
57 '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-ghostscript.exe' \56 '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-ghostscript.exe' \
58 `$(TARGET)-pkg-config --cflags --libs ghostscript`57 `$(TARGET)-pkg-config --cflags --libs ghostscript`
59endef58endef

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t