summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarealshinji <djcj@gmx.de>2018-05-24 22:54:16 (GMT)
committerTony Theodore <tonyt@logyst.com>2018-05-28 02:08:07 (GMT)
commit10b0ac88fca237aca4ec62930d047477db7f891b (patch)
treeb0b073cb82201f9029d4fff3127d774ed52ce840
parentd705818b753abca51a0a1b87bdc3b523281261d6 (diff)
downloadmxe-10b0ac88fca237aca4ec62930d047477db7f891b.zip
mxe-10b0ac88fca237aca4ec62930d047477db7f891b.tar.gz
mxe-10b0ac88fca237aca4ec62930d047477db7f891b.tar.bz2
more cross-build fixes for Ghostscript
-rw-r--r--src/ghostscript-1-fixes.patch694
-rw-r--r--src/ghostscript.mk41
2 files changed, 396 insertions, 339 deletions
diff --git a/src/ghostscript-1-fixes.patch b/src/ghostscript-1-fixes.patch
index 5e5c2ec..f21c717 100644
--- a/src/ghostscript-1-fixes.patch
+++ b/src/ghostscript-1-fixes.patch
@@ -4,33 +4,58 @@ Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:01:00 +0200
-Subject: [PATCH 1/8] source code fixes
+Date: Fri, 25 May 2018 00:43:55 +0200
+Subject: [PATCH 1/1] cross-build fixes, symbol visibility option
-diff --git a/psi/iapi.c b/psi/iapi.c
+diff --git a/Makefile.in b/Makefile.in
+index 1111111..2222222 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -173,6 +173,9 @@ CAPOPT= @HAVE_MKSTEMP@ @HAVE_FILE64@ @HAVE_FSEEKO@ @HAVE_MKSTEMP64@ @HAVE_FONTCO
+
+ GS=@GS@
+ GS_SO_BASE=@GS@
++GS_SONAME=@GS_SONAME@
++GS_SONAME_MAJOR=@GS_SONAME_MAJOR@
++GS_SONAME_MAJOR_MINOR=@GS_SONAME_MAJOR_MINOR@
+
+ PCL=@PCL@
+ PCL_SO_BASE=@PCL@
+@@ -184,7 +187,7 @@ GPDL=@GPDL@
+ GPDL_SO_BASE=@GPDL@
+
+ XE=@EXEEXT@
+-XEAUX=@EXEEXT@
++XEAUX=@AUXEXEEXT@
+
+ PCL_TARGET=@PCL_TARGET@
+ XPS_TARGET=@XPS_TARGET@
+diff --git a/base/gp_unix.c b/base/gp_unix.c
index 1111111..2222222 100644
---- a/psi/iapi.c
-+++ b/psi/iapi.c
-@@ -17,6 +17,9 @@
+--- a/base/gp_unix.c
++++ b/base/gp_unix.c
+@@ -16,6 +16,9 @@
- /* Public Application Programming Interface to Ghostscript interpreter */
+ /* Unix-specific routines for Ghostscript */
-+#ifdef __WIN32__
-+#include "windows_.h"
++#ifdef __MINGW32__
++# include "windows_.h"
+#endif
+ #include "pipe_.h"
#include "string_.h"
- #include "ierrors.h"
- #include "gscdefs.h"
-@@ -41,6 +44,55 @@ static int gsapi_instance_counter = 0;
- static const int gsapi_instance_max = 1;
+ #include "time_.h"
+@@ -454,3 +457,54 @@ void gp_enumerate_fonts_free(void *enum_state)
+ }
#endif
-
+ }
++
+/* A function to decode the next codepoint of the supplied args from the
+ * local windows codepage, or -1 for EOF.
-+ * (copied from base/gp_win32.c)
++ * (copied from gp_win32.c)
+ */
-+#if defined(__WIN32__) && !defined(METRO)
++
++#ifdef __MINGW32__
+int
+gp_local_arg_encoding_get_codepoint(FILE *file, const char **astr)
+{
@@ -74,83 +99,7 @@ index 1111111..2222222 100644
+
+ return unicode[0];
+}
-+#endif /* __WIN32__ */
-
- /* Return revision numbers and strings of Ghostscript. */
- /* Used for determining if wrong GSDLL loaded. */
-diff --git a/psi/iapi.h b/psi/iapi.h
-index 1111111..2222222 100644
---- a/psi/iapi.h
-+++ b/psi/iapi.h
-@@ -68,6 +68,11 @@ extern "C" {
- # define GSDLLEXPORT
- # endif
- # endif
-+# ifdef __MINGW32__
-+/* export stdcall functions as "name" instead of "_name@ordinal" */
-+# undef GSDLLAPI
-+# define GSDLLAPI
-+# endif
- # ifndef GSDLLAPI
- # define GSDLLAPI __stdcall
- # endif
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:02:00 +0200
-Subject: [PATCH 2/8] aux tools will choke on -L linker flags
-
-
-diff --git a/configure.ac b/configure.ac
-index 1111111..2222222 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -974,7 +974,7 @@ if test x"$enable_fapi" != xno; then
- if $PKGCONFIG --atleast-version=12.0.6 freetype2; then
- AC_MSG_RESULT(yes)
- FT_CFLAGS="$CFLAGS `$PKGCONFIG --cflags freetype2`"
-- FT_LIBS="`$PKGCONFIG --libs freetype2`"
-+ FT_LIBS="`$PKGCONFIG --libs-only-l freetype2`"
- FT_BRIDGE=1
- SHARE_FT=1
- else
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:03:00 +0200
-Subject: [PATCH 3/8] enable out-of-tree builds
-
-
-diff --git a/configure.ac b/configure.ac
-index 1111111..2222222 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -146,9 +146,16 @@ if test x"$CCAUX" != x"" ; then
- echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in
- echo $AUXFLAGS_MAK_LINE07 >> $AUXFLAGS_MAK.in
-
-- ../$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=""
-+ if test "$0" = "./configure" ; then
-+ basedir=".."
-+ configure="../configure"
-+ else
-+ basedir="$(basename "$0")"
-+ configure="$0"
-+ fi
-+ "$configure" 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=""
- status=$?
-- cp config.log ../configaux.log
-+ cp config.log "$basedir/configaux.log"
- if test $status -eq 0 ; then
- CCAUX=$(grep CCAUX $AUXFLAGS_MAK | sed "s/CCAUX=//g")
- GCFLAGSAUXTMP=$(grep GCFLAGSAUX $AUXFLAGS_MAK | sed "s/GCFLAGSAUX=//g")
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:04:00 +0200
-Subject: [PATCH 4/8] don't rebuild aux tools if they already exist
-
-
++#endif /* __MINGW32__ */
diff --git a/base/unix-aux.mak b/base/unix-aux.mak
index 1111111..2222222 100644
--- a/base/unix-aux.mak
@@ -159,29 +108,29 @@ index 1111111..2222222 100644
# -------------------------- Auxiliary programs --------------------------- #
$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(ECHOGS_XE) || \
$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
$(PACKPS_XE): $(GLSRC)pack_ps.c $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(PACKPS_XE) || \
$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(PACKPS_XE) $(GLSRC)pack_ps.c $(AUXEXTRALIBS)
# On the RS/6000 (at least), compiling genarch.c with gcc with -O
# produces a buggy executable.
$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(GENARCH_XE) || \
$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(GENCONF_XE) || \
$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(GENDEV_XE) || \
$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(GENHT_XE) || \
$(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
# To get GS to use the system zlib, you remove/hide the gs/zlib directory
@@ -189,7 +138,7 @@ index 1111111..2222222 100644
$(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(MKROMFS_XE)_0 || \
$(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
# .... and one using the zlib library linked via the command line
@@ -197,22 +146,29 @@ index 1111111..2222222 100644
$(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(MKROMFS_XE)_1 || \
$(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS)
-+ test -e $@ || \
++ test -e $(MKROMFS_XE) || \
$(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
# Query the environment to construct gconfig_.h.
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:05:00 +0200
-Subject: [PATCH 5/8] replace uname command with $host variable; always enable
- directory name workarounds
-
-
+diff --git a/base/unix-dll.mak b/base/unix-dll.mak
+index 1111111..2222222 100644
+--- a/base/unix-dll.mak
++++ b/base/unix-dll.mak
+@@ -66,10 +66,6 @@ GPDL_SONAME_BASE=lib$(GPDL_SO_BASE)
+ GS_SOEXT=$(SO_LIB_EXT)
+ GS_DLLEXT=$(DLL_EXT)
+
+-GS_SONAME=$(GS_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
+-GS_SONAME_MAJOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
+-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)
+-
+ PCL_SONAME=$(PCL_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
+ PCL_SONAME_MAJOR=$(PCL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
+ PCL_SONAME_MAJOR_MINOR=$(PCL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MINOR)$(GS_DLLEXT)
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
@@ -225,7 +181,61 @@ index 1111111..2222222 100644
dnl Inherit compiler flags from the environment...
CFLAGS="${CFLAGS:=}"
-@@ -241,18 +242,14 @@ CONTRIBINCLUDE="include $srcdir/contrib/contrib.mak"
+@@ -125,8 +126,11 @@ AUXEXTRALIBSTMP="\$(EXTRALIBS)"
+
+ # purposefully do not include "help" output for this
+ AC_ARG_ENABLE([save_confaux])
++AC_ARG_ENABLE([auxtools_only])
+
+-if test x"$CCAUX" != x"" ; then
++absolute_source_path=$(cd "$(dirname "$0")" && pwd)
++
++if test x"$host" != x"$build" ; then
+ # rerun configure for the AUX tools, disabling a load of tests not relevant for CCAUX
+ olddir=`pwd`
+ if test x"$enable_save_confaux" = x"yes"; then
+@@ -146,9 +150,10 @@ if test x"$CCAUX" != x"" ; then
+ echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in
+ echo $AUXFLAGS_MAK_LINE07 >> $AUXFLAGS_MAK.in
+
+- ../$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=""
+- status=$?
+- cp config.log ../configaux.log
++ AC_MSG_NOTICE([Begin recursive call to configure script (for auxiliary tools)])
++ "$absolute_source_path/configure" CC="$CCAUX" CFLAGS="$CFLAGSAUX" LDFLAGS="$LDFLAGSAUX" CCAUX= CFLAGSAUX= CFLAGSAUX= MAKEFILE=$AUXFLAGS_MAK --host=$build --build=$build --enable-auxtools_only --disable-hidden-visibility --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=""
++ status=$?
++ cp config.log $olddir/configaux.log
+ if test $status -eq 0 ; then
+ CCAUX=$(grep CCAUX $AUXFLAGS_MAK | sed "s/CCAUX=//g")
+ GCFLAGSAUXTMP=$(grep GCFLAGSAUX $AUXFLAGS_MAK | sed "s/GCFLAGSAUX=//g")
+@@ -167,6 +172,8 @@ if test x"$CCAUX" != x"" ; then
+
+ if test $status -ne 0 ; then
+ AC_MSG_ERROR([Recursive call to configure (for auxiliary tools) script failed], $status)
++ else
++ AC_MSG_NOTICE([Recursive call to configure script succeeded])
+ fi
+ fi
+
+@@ -204,7 +211,7 @@ AC_PATH_TOOL(PKGCONFIG, pkg-config)
+ # but if we are cross compiling, and there isn't a matching
+ # pkconfig for the --host setting, then don't use the 'local'
+ # pkconfig at all
+-if test x"$cross_compiling" = x"yes"; then
++if test x"$host" != x"$build" ; then
+ AC_PATH_PROG(BUILD_PKGCONFIG, pkg-config)
+ if test x"$BUILD_PKGCONFIG" = x"$PKGCONFIG" ; then
+ PKGCONFIG=
+@@ -217,7 +224,7 @@ AC_PATH_TOOL(STRIP_XE, strip)
+ # but if we are cross compiling, and there isn't a matching
+ # pkconfig for the --host setting, then don't use the 'local'
+ # pkconfig at all
+-if test x"$cross_compiling" = x"yes"; then
++if test x"$host" != x"$build" ; then
+ AC_PATH_PROG(BUILD_STRIP_XE, strip)
+ if test x"$BUILD_STRIP_XE" = x"$STRIP_XE" ; then
+ STRIP_XE=
+@@ -234,18 +241,14 @@ CONTRIBINCLUDE="include $srcdir/contrib/contrib.mak"
INSTALL_CONTRIB="install-contrib-extras"
if test x"$enable_contrib" = x; then
@@ -246,7 +256,7 @@ index 1111111..2222222 100644
fi
if test x"$enable_contrib" != x"no"; then
-@@ -281,33 +278,27 @@ dnl --------------------------------------------------
+@@ -274,33 +277,34 @@ dnl --------------------------------------------------
CC_OPT_FLAGS_TO_TRY="-O"
SET_DT_SONAME="-soname="
@@ -259,7 +269,7 @@ index 1111111..2222222 100644
- case `uname` in
- Linux*|GNU*)
+case $host in
-+ *-linux*)
++ *-linux*|*-gnu)
if test $ac_cv_prog_gcc = yes; then
CC_OPT_FLAGS_TO_TRY="-O2"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
@@ -273,7 +283,7 @@ index 1111111..2222222 100644
fi
;;
- Darwin*)
-+ *-darwin*)
++ *-arwin*)
if test $ac_cv_prog_gcc = yes; then
CC_OPT_FLAGS_TO_TRY="-O2"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
@@ -281,11 +291,18 @@ index 1111111..2222222 100644
SET_DT_SONAME=""
;;
- SunOS)
++ *-mingw*|*-msys*|*-cygwin*)
++ if test $ac_cv_prog_gcc = yes; then
++ CC_OPT_FLAGS_TO_TRY="-O2"
++ CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
++ fi
++ SET_DT_SONAME=""
++ ;;
+ *-sun*)
CC_OPT_FLAGS_TO_TRY="-O2"
# the trailing space is required!
if test $ac_cv_prog_gcc = no; then
-@@ -320,15 +311,14 @@ else
+@@ -313,15 +317,14 @@ else
CC_DBG_FLAGS_TO_TRY="-g -O0"
fi
;;
@@ -303,7 +320,7 @@ index 1111111..2222222 100644
AC_SUBST(SET_DT_SONAME)
-@@ -353,18 +343,20 @@ AC_ARG_WITH([arch_h], AC_HELP_STRING([--with-arch_h=<arch.h to use>],
+@@ -346,18 +349,20 @@ AC_ARG_WITH([arch_h], AC_HELP_STRING([--with-arch_h=<arch.h to use>],
ARCH_CONF_HEADER=
if test x"$with_arch_h" = x""; then
@@ -313,15 +330,15 @@ index 1111111..2222222 100644
- case `uname` in
- Darwin*)
+ case $host in
-+ *-darwin*)
- ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/osx-x86-x86_64-ppc-gcc.h"
- ;;
-+ x86_64-*-mingw*|x86_64-*-msys*|x86_64-*-cygwin*)
++ x86_64*-mingw*|x86_64*-msys*|x86_64*-cygwin*)
+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/windows-x64-msvc.h"
+ ;;
+ *-mingw*|*-msys*|*-cygwin*)
+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/windows-x86-msvc.h"
+ ;;
++ *-darwin*)
+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../arch/osx-x86-x86_64-ppc-gcc.h"
+ ;;
*)
ARCH_CONF_HEADER=
;;
@@ -330,33 +347,162 @@ index 1111111..2222222 100644
else
ARCH_CONF_HEADER=$with_arch_h
fi
-@@ -495,13 +487,7 @@ dnl Check for *BSD and apply BSD Make workaround
- dnl - BSD Make treats obj special and cd into it first.
+@@ -489,13 +494,23 @@ dnl - BSD Make treats obj special and cd into it first.
dnl --------------------------------------------------
--OBJDIR_BSDMAKE_WORKAROUND=obj
--
+ OBJDIR_BSDMAKE_WORKAROUND=obj
++SUB_MAKE_OPTION=
++ORDER_ONLY=""
+
-case `uname` in
- *BSD)
- OBJDIR_BSDMAKEWORKAOROUND="notobj"
- ;;
-esac
-+OBJDIR_BSDMAKE_WORKAROUND=obj_
++AC_MSG_CHECKING(if make is GNU make)
++if make --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
++ AC_MSG_RESULT(yes)
++ SUB_MAKE_OPTION="-f \$(MAKEFILE)"
++ ORDER_ONLY="|"
++else
++ AC_MSG_RESULT(no)
++ # BSD Make treats obj special and cd into it first
++ OBJDIR_BSDMAKEWORKAOROUND="notobj"
++fi
++
AC_SUBST(OBJDIR_BSDMAKE_WORKAROUND)
++AC_SUBST(ORDER_ONLY)
++AC_SUBST(SUB_MAKE_OPTION)
AC_CHECK_HEADER([sys/window.h])
-@@ -649,9 +635,7 @@ if test x"$build_alias" != x""; then
- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --build=$build_alias"
- fi
+ dnl --------------------------------------------------
+@@ -636,15 +651,7 @@ dnl Set options that we want to pass into all other
+ dnl configure scripts we might call
+ dnl --------------------------------------------------
+-SUBCONFIG_OPTS=""
+-
+-if test x"$build_alias" != x""; then
+- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --build=$build_alias"
+-fi
+-
-if test x"$host_alias" != x""; then
- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host_alias"
-fi
-+SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host"
++SUBCONFIG_OPTS="--build=$build --host=$host"
dnl --------------------------------------------------
dnl Check for libraries
-@@ -1500,16 +1484,14 @@ dnl look for IJS implementation
+@@ -974,7 +981,7 @@ if test x"$enable_fapi" != xno; then
+ if $PKGCONFIG --atleast-version=12.0.6 freetype2; then
+ AC_MSG_RESULT(yes)
+ FT_CFLAGS="$CFLAGS `$PKGCONFIG --cflags freetype2`"
+- FT_LIBS="`$PKGCONFIG --libs freetype2`"
++ FT_LIBS="`$PKGCONFIG --libs-only-l freetype2`"
+ FT_BRIDGE=1
+ SHARE_FT=1
+ else
+@@ -1025,6 +1032,14 @@ AC_SUBST(FTSRCDIR)
+ AC_SUBST(FT_CFLAGS)
+ AC_SUBST(FT_LIBS)
+
++if test x"$enable_auxtools_only" = x"yes" ; then
++ LIBJPEGDIR=
++ SHARE_LIBJPEG=0
++ AC_DEFINE([DONT_HAVE_JMEMSYS_H], 1, [])
++ AC_SUBST(SHARE_LIBJPEG)
++ AC_SUBST(LIBJPEGDIR)
++else
++
+ AC_MSG_CHECKING([for local jpeg library source])
+ dnl At present, we give the local source priority over the shared
+ dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied.
+@@ -1066,6 +1081,13 @@ else
+ [define if the libjpeg memory system prototypes aren't available])
+ fi
+
++fi # $enable_auxtools_only
++
++# this option is useful if you're cross-compiling and want to use
++# your toolchain's zlib for $host but the local one for $build
++AC_ARG_WITH([local-zlib], AC_HELP_STRING([--without-local-zlib],
++ [do not check for local zlib sources (has no effect on AUX toolchain when cross-building)]))
++
+ AC_MSG_CHECKING([for local zlib source])
+ dnl zlib is needed for language level 3, and libpng
+ # we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR)
+@@ -1074,6 +1096,13 @@ ZLIBDIR=src
+ AUX_SHARED_ZLIB=
+ ZLIBCFLAGS=""
+
++if test x"$with_local_zlib" = x"no" ; then
++ AC_MSG_RESULT([skip])
++ AC_CHECK_LIB(z, deflate, [
++ AC_CHECK_HEADERS(zlib.h, [SHARE_ZLIB=1; AUX_SHARED_ZLIB="-l\$(ZLIB_NAME)"])
++ ])
++else
++
+ if test -d $srcdir/zlib; then
+ AC_MSG_RESULT([yes])
+ SHARE_ZLIB=0
+@@ -1088,6 +1117,7 @@ else
+ AC_CHECK_HEADERS(zlib.h, [SHARE_ZLIB=1; AUX_SHARED_ZLIB="-l\$(ZLIB_NAME)"])
+ ])
+ fi
++fi # $with_local_zlib
+ if test -z "$SHARE_ZLIB"; then
+ AC_MSG_ERROR([I did not find a copy of zlib on your system.
+ Please either install it, or unpack a copy of the source in a
+@@ -1114,6 +1144,11 @@ AC_SUBST(ZLIBDIR)
+ AC_SUBST(FT_SYS_ZLIB)
+
+ dnl png for the png output device; it also requires zlib
++if test x"$enable_auxtools_only" = x"yes" ; then
++ LIBPNGDIR=""
++ SHARE_LIBPNG=0
++else
++
+ LIBPNGDIR=src
+ PNGDEVS=''
+ PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
+@@ -1135,12 +1170,19 @@ fi
+ if test -z "$PNGDEVS"; then
+ AC_MSG_NOTICE([disabling png output devices])
+ fi
++fi # $enable_auxtools_only
+ AC_SUBST(SHARE_LIBPNG)
+ AC_SUBST(LIBPNGDIR)
+ #AC_SUBST(PNGDEVS)
+
+ WHICHLCMS=
+
++if test x"$enable_auxtools_only" = x"yes" ; then
++ SHARELCMS=0
++ LCMS2DIR=
++ LCMS2MTDIR=
++else
++
+ AC_MSG_CHECKING([for local lcms2 library source])
+ LCMS2DIR=src
+ LCMS2ARTDIR=src
+@@ -1172,6 +1214,7 @@ else
+ fi
+ fi
+ fi
++fi # $enable_auxtools_only
+
+ AC_SUBST(SHARELCMS)
+ AC_SUBST(WHICHLCMS)
+@@ -1314,7 +1357,7 @@ EXPATDIR=src
+ EXPAT_CFLAGS=
+ EXPAT_LIBS=
+
+-if test x"$with_xps" != x"no" ; then
++if test x"$with_xps" != x"no" -a x"$enable_auxtools_only" != x"yes" ; then
+ if test -f $srcdir/xps/xps.mak; then
+ AC_MSG_CHECKING([for local expat library source])
+ if test -f $srcdir/expat/lib/expat.h ; then
+@@ -1493,16 +1536,14 @@ dnl look for IJS implementation
AC_ARG_WITH([ijs], AC_HELP_STRING([--without-ijs],
[disable IJS driver support]))
@@ -376,7 +522,7 @@ index 1111111..2222222 100644
dnl set safe defaults
IJSDIR=src
-@@ -1561,18 +1543,11 @@ if test x$with_luratech != xno; then
+@@ -1554,18 +1595,11 @@ if test x$with_luratech != xno; then
SHARE_JBIG2=0
JBIG2DIR=$srcdir/luratech/ldf_jb2
@@ -398,7 +544,7 @@ index 1111111..2222222 100644
if test $ac_cv_prog_gcc = yes; then
JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
else
-@@ -1583,7 +1558,6 @@ if test x$with_luratech != xno; then
+@@ -1576,7 +1610,6 @@ if test x$with_luratech != xno; then
JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
;;
esac
@@ -406,7 +552,7 @@ index 1111111..2222222 100644
JBIG2FILEDEVS='$(DD)gdevjbig2.dev'
JBIG2DEVS='$(PSD)jbig2.dev'
-@@ -1690,18 +1664,11 @@ if test x$with_luratech != xno; then
+@@ -1683,18 +1716,11 @@ if test x$with_luratech != xno; then
SHARE_JPX=0
JPXDIR=$srcdir/luratech/lwf_jp2
@@ -428,7 +574,7 @@ index 1111111..2222222 100644
if test $ac_cv_prog_gcc = yes; then
JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -fsigned-char -DLINUX=1 -DFORTE"
else
-@@ -1712,7 +1679,6 @@ if test x$with_luratech != xno; then
+@@ -1705,7 +1731,6 @@ if test x$with_luratech != xno; then
JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DLINUX=1 -DFORTE"
;;
esac
@@ -436,7 +582,7 @@ index 1111111..2222222 100644
JPXDEVS='$(PSD)jpx.dev'
else
AC_MSG_RESULT([no])
-@@ -2325,21 +2291,8 @@ SO_LIB_EXT=".so"
+@@ -2318,21 +2343,30 @@ SO_LIB_EXT=".so"
DLL_EXT=""
SO_LIB_VERSION_SEPARATOR="."
@@ -455,30 +601,64 @@ index 1111111..2222222 100644
-else
- case `uname` in
- Linux*|GNU*)
++libname1="_SO_BASE)\$(GS_SOEXT)\$(DLL_EXT)"
++libname2="_SO_BASE)\$(GS_SOEXT)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MAJOR)\$(DLL_EXT)"
++libname3="_SO_BASE)\$(GS_SOEXT)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MAJOR)\$(SO_LIB_VERSION_SEPARATOR)\$(GS_VERSION_MINOR)\$(DLL_EXT)"
++GS_SONAME="lib\$(GS${libname1}"
++GS_SONAME_MAJOR="lib\$(GS${libname2}"
++GS_SONAME_MAJOR_MINOR="lib\$(GS${libname3}"
++
++hide_symbols=no
++attr_default=
++attr_hidden=
++_ldflags=
++
++AC_ARG_ENABLE([hidden-visibility],
++ AC_HELP_STRING([--enable-hidden-visibility],
++ [hide all shared library symbols which are not part of its public API]),
++ [hide_symbols=yes])
++
++if test x$hide_symbols = xyes -a $ac_cv_prog_gcc = yes; then
++ attr_default="__attribute__((visibility(\\\"default\\\")))"
++ attr_hidden="__attribute__((visibility(\\\"hidden\\\")))"
++fi
++
+case $host in
-+ *-linux*)
++ *-linux*|*-gnu)
DYNAMIC_CFLAGS="-fPIC"
GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
-@@ -2352,7 +2305,7 @@ else
+@@ -2345,16 +2379,25 @@ else
fi
SO_LIB_EXT=".so"
;;
- MINGW*|MSYS*)
+- DYNAMIC_CFLAGS=""
+- GS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(GS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
+ *-mingw*|*-msys*|*-cygwin*)
- DYNAMIC_CFLAGS=""
- GS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(GS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
++ if test x$hide_symbols = xyes; then
++ DYNAMIC_CFLAGS="-fvisibility=hidden -DGSDLLEXPORT=\"__declspec(dllexport)\""
++ else
++ _ldflags="-Wl,--export-all-symbols"
++ fi
++ _ldflags="$_ldflags -Wl,--enable-auto-import"
++ GS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(GS_SO_BASE).dll.a $_ldflags"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PCL_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
-@@ -2361,7 +2314,7 @@ else
+ XPS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(XPS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
+ SO_LIB_EXT=""
DLL_EXT=".dll"
SO_LIB_VERSION_SEPARATOR="-"
++ # make sure the import library doesn't link a program against the DLL with the minor version in it
++ GS_SONAME="lib\$(GS${libname1}"
++ GS_SONAME_MAJOR="lib\$(GS${libname3}"
++ GS_SONAME_MAJOR_MINOR="lib\$(GS${libname2}"
;;
- *BSD)
+ *bsd*)
DYNAMIC_CFLAGS="-fPIC"
GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
-@@ -2369,14 +2322,14 @@ else
+@@ -2362,14 +2405,14 @@ else
DYNAMIC_LIBS=""
SO_LIB_EXT=".so"
;;
@@ -495,7 +675,7 @@ index 1111111..2222222 100644
if test $ac_cv_prog_gcc = yes; then
DYNAMIC_CFLAGS="-fPIC"
else
-@@ -2388,7 +2341,7 @@ else
+@@ -2381,7 +2424,7 @@ else
DYNAMIC_LIBS=""
SO_LIB_EXT=".so"
;;
@@ -504,13 +684,17 @@ index 1111111..2222222 100644
DYNAMIC_CFLAGS="-fPIC"
GCFLAGS="-Wl,-brtl -D_LARGE_FILES $GCFLAGS"
GS_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
-@@ -2396,15 +2349,14 @@ else
+@@ -2389,15 +2432,18 @@ else
XPS_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
SO_LIB_EXT=".so"
;;
- esac
-fi
+esac
++
++AC_SUBST(GS_SONAME)
++AC_SUBST(GS_SONAME_MAJOR)
++AC_SUBST(GS_SONAME_MAJOR_MINOR)
AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
[Enable dynamically loaded drivers]),
@@ -519,11 +703,11 @@ index 1111111..2222222 100644
- case `uname` in
- Linux*|GNU*)
+ case $host in
-+ *-linux*)
++ *-linux*|*-gnu)
INSTALL_SHARED="install-shared"
if test "x$X_DEVS" != x; then
DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
-@@ -2416,21 +2368,21 @@ AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
+@@ -2409,21 +2455,21 @@ AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
;;
@@ -548,7 +732,7 @@ index 1111111..2222222 100644
DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
-@@ -2536,7 +2488,7 @@ dnl --------------------------------------------------
+@@ -2529,7 +2575,7 @@ dnl --------------------------------------------------
dnl disable the memory header ID code on SPARC
dnl --------------------------------------------------
@@ -557,189 +741,81 @@ index 1111111..2222222 100644
*sparc*)
GCFLAGS="$GCFLAGS -DGS_USE_MEMORY_HEADER_ID=0"
;;
-@@ -2613,19 +2565,11 @@ AC_ARG_WITH(memory-alignment,
- [GS_MEMPTR_ALIGNMENT=$with_memory_alignment],[GS_MEMPTR_ALIGNMENT=check])
-
- if test x"$GS_MEMPTR_ALIGNMENT" = xcheck ; then
-- if test x"$cross_compiling" = x"no"; then
-- case `uname` in
-- HP-UX)
-+ case $host in
-+ *-hpux*|*-sun*|*-aix*)
- GS_MEMPTR_ALIGNMENT=8
- ;;
-- SunOS)
-- GS_MEMPTR_ALIGNMENT=8
-- ;;
-- AIX)
-- GS_MEMPTR_ALIGNMENT=8
-- ;;
-- esac
-- fi
-+ esac
- fi
-
- if test x"$GS_MEMPTR_ALIGNMENT" = xcheck ; then
-@@ -2748,15 +2692,7 @@ AC_SUBST(SUB_MAKE_OPTION)
- # directory nor file name, so if we're building in
- # mingw, add the same prefix as the VS build uses
- # --------------------------------------------------
--AUXDIRPOSTFIX=""
--case `uname` in
-- MINGW*|MSYS*)
-- AUXDIRPOSTFIX="_"
-- if test x"$cross_compiling" != x"yes"; then
-- CFLAGS="-DGS_NO_UTF8=1 $CFLAGS"
-- fi
-- ;;
--esac
-+AUXDIRPOSTFIX="_"
- AC_SUBST(AUXDIRPOSTFIX)
-
- # --------------------------------------------------
-@@ -2771,13 +2707,11 @@ AC_ARG_WITH([exe-ext], AC_HELP_STRING([--with-exe-ext=EXT],
- if test "x"$with_exe_ext != "x"; then
- EXEEXT="$with_exe_ext"
- else
-- if test x"$cross_compiling" != x"yes"; then
-- case `uname` in
-- MINGW*|MSYS*)
-+ case $host in
-+ *-mingw*|*-msys*|*-cygwin*)
- EXEEXT=".exe"
- ;;
-- esac
-- fi
-+ esac
- fi
-
- AC_SUBST(EXEEXT)
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:06:00 +0200
-Subject: [PATCH 6/8] option to set executable name extention for aux binaries
- only
-
-
-diff --git a/Makefile.in b/Makefile.in
-index 1111111..2222222 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -184,7 +184,7 @@ GPDL=@GPDL@
- GPDL_SO_BASE=@GPDL@
-
- XE=@EXEEXT@
--XEAUX=@EXEEXT@
-+XEAUX=@AUXEXEEXT@
-
- PCL_TARGET=@PCL_TARGET@
- XPS_TARGET=@XPS_TARGET@
-diff --git a/configure.ac b/configure.ac
-index 1111111..2222222 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2701,21 +2701,36 @@ AC_SUBST(AUXDIRPOSTFIX)
+@@ -2757,23 +2803,31 @@ AC_SUBST(AUXDIRPOSTFIX)
+ # usually empty on Unix-like systems
# --------------------------------------------------
EXEEXT=""
-
--AC_ARG_WITH([exe-ext], AC_HELP_STRING([--with-exe-ext=EXT],
-- [set the file name executable extension (must include any separator e.g. the period in ".exe")]),[], [exe_ext=])
++AUXEXEEXT=""
++
+case $host in
+ *-mingw*|*-msys*|*-cygwin*)
+ EXEEXT=".exe"
+ ;;
++ *)
++ ;;
+esac
+ AC_ARG_WITH([exe-ext], AC_HELP_STRING([--with-exe-ext=EXT],
+- [set the file name executable extension (must include any separator e.g. the period in ".exe")]),[], [exe_ext=])
++ [set the file name executable extension (must include any separator e.g. the period in ".exe")]),
++ [EXEEXT="$with_exe_ext"])
+
-if test "x"$with_exe_ext != "x"; then
- EXEEXT="$with_exe_ext"
-else
-- case $host in
-- *-mingw*|*-msys*|*-cygwin*)
+- if test x"$cross_compiling" != x"yes"; then
+- case `uname` in
+- MINGW*|MSYS*)
- EXEEXT=".exe"
- ;;
-- esac
+- esac
+- fi
-fi
-+AC_ARG_WITH([exe-ext], AC_HELP_STRING([--with-exe-ext=EXT],
-+ [set the file name executable extension (must include any separator e.g. the period in ".exe")]),
-+ [EXEEXT="$with_exe_ext"])
-
- AC_SUBST(EXEEXT)
-
-+# --------------------------------------------------
-+# Set executable name extention for aux binaries
-+# usually empty on Unix-like systems
-+# --------------------------------------------------
-+AUXEXEEXT=""
-+
-+case $host in
++case $build in
+ *-mingw*|*-msys*|*-cygwin*)
+ AUXEXEEXT=".exe"
+ ;;
++ *)
++ AUXEXEEXT="$EXEEXT"
++ ;;
+esac
-+
-+AC_ARG_WITH([aux-exe-ext], AC_HELP_STRING([--with-aux-exe-ext=EXT],
-+ [set the file name executable extension for auxiliary binaries (must include any separator e.g. the period in ".exe")]),
-+ [AUXEXEEXT="$with_aux_exe_ext"])
-+
+
+ AC_SUBST(EXEEXT)
+AC_SUBST(AUXEXEEXT)
-+
+
# --------------------------------------------------
# Check for disabling of versioned path option.
- # By default the versioned path must be enabled!
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 12:07:00 +0200
-Subject: [PATCH 7/8] fix openjpeg detection without pkg-config
-
-
-diff --git a/configure.ac b/configure.ac
-index 1111111..2222222 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1753,12 +1753,16 @@ if test "x$JPX_DECODER" = "x"; then
- else
- AC_MSG_RESULT([no])
- fi
-- else
-+ fi
-+ if test "x$JPX_DECODER" = "x"; then
-+ AC_CHECK_HEADER(openjpeg.h, [
- AC_CHECK_LIB(openjp2, opj_stream_set_user_data,
- [JPX_AUTOCONF_CFLAGS="$JPX_AUTOCONF_CFLAGS $OPJ_LRINTF_SUBST -DUSE_JPIP -DUSE_OPENJPEG_JP2 $CFLAGS_OPJ_HAVE_STDINT_H $CFLAGS_OPJ_HAVE_INTTYPES_H $CFLAGS_OPJ_BIGENDIAN $CFLAGS_OPJ_HAVE_FSEEKO";
- JPX_AUTOCONF_LIBS="-lopenjp2";
-+ JPX_DECODER=openjpeg
- SHARE_JPX=1]
- )
-+ ])
- fi
- fi
- fi
-
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: darealshinji <djcj@gmx.de>
-Date: Sun, 20 May 2018 21:37:25 +0200
-Subject: [PATCH 8/8] don't use the minor version on DLLs
-
-
-diff --git a/base/unix-dll.mak b/base/unix-dll.mak
-index 1111111..2222222 100644
---- a/base/unix-dll.mak
-+++ b/base/unix-dll.mak
-@@ -67,8 +67,15 @@ GS_SOEXT=$(SO_LIB_EXT)
- GS_DLLEXT=$(DLL_EXT)
+@@ -2828,7 +2882,7 @@ fi
- GS_SONAME=$(GS_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
-+ifeq ($(DLL_EXT),.dll)
-+# for Windows we make libgs-A-B.dll a symbolic link to libgs-A.dll to ensure that programs
-+# always import the DLL without the minor version in its name
-+GS_SONAME_MAJOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MINOR)$(GS_DLLEXT)
-+GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
-+else
- GS_SONAME_MAJOR=$(GS_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
- 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)
-+endif
+ AC_SUBST(CLUSTER_CFLAGS)
- PCL_SONAME=$(PCL_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
- PCL_SONAME_MAJOR=$(PCL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
+-if test x"$CCAUX" != x"$CC"; then
++if test x"$build" != x"$host"; then
+
+ ilog2()
+ {
+@@ -2968,7 +3022,7 @@ AC_SUBST(AUXEXTRALIBS)
+
+ CONFIG_FILES_LIST="$CONFIG_FILES_LIST $THEMAKEFILE"
+
+-if test x"$THEMAKEFILE" != x"$MAKEFILE" && test x"$CCAUX" = x"$CC"; then
++if test x"$THEMAKEFILE" != x"$MAKEFILE" && test x"$build" = x"$host"; then
+ CONFIG_FILES_LIST="$CONFIG_FILES_LIST"
+ fi
+
+diff --git a/psi/iapi.h b/psi/iapi.h
+index 1111111..2222222 100644
+--- a/psi/iapi.h
++++ b/psi/iapi.h
+@@ -68,6 +68,11 @@ extern "C" {
+ # define GSDLLEXPORT
+ # endif
+ # endif
++# ifdef __MINGW32__
++/* export stdcall functions as "name" instead of "_name@ordinal" */
++# undef GSDLLAPI
++# define GSDLLAPI
++# endif
+ # ifndef GSDLLAPI
+ # define GSDLLAPI __stdcall
+ # endif
diff --git a/src/ghostscript.mk b/src/ghostscript.mk
index 4131ade..0782abf 100644
--- a/src/ghostscript.mk
+++ b/src/ghostscript.mk
@@ -18,43 +18,24 @@ define $(PKG)_UPDATE
endef
define $(PKG)_BUILD
- cp -f $(SOURCE_DIR)/libpng/{config.guess,config.sub,install-sh} '$(SOURCE_DIR)'
+ #cp -f $(SOURCE_DIR)/libpng/{config.guess,config.sub,install-sh} '$(SOURCE_DIR)'
+ cp -f `automake --print-libdir`/{config.guess,config.sub,install-sh} '$(SOURCE_DIR)'
+ cd '$(SOURCE_DIR)' && rm -rf freetype jpeg lcms2art libpng openjpeg tiff
cd '$(SOURCE_DIR)' && autoreconf -f -i
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
- --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=''
- $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' obj_/aux_/{echogs,genarch,genconf,gendev,mkromfs,packps}
- rm -f $(BUILD_DIR)/obj_/*.h
- cp -r '$(BUILD_DIR)/obj_' '$(BUILD_DIR)/soobj_'
- cd '$(SOURCE_DIR)' && rm -rf freetype jpeg lcms2art libpng openjpeg tiff zlib
-
- cd '$(BUILD_DIR)' && CFLAGS='$(CFLAGS) -I$(PREFIX)/$(TARGET)/include/openjpeg-2.3' \
- CPPFLAGS='$(CPPFLAGS) -I$(PREFIX)/$(TARGET)/include/openjpeg-2.3' \
- $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS) \
--with-drivers=ALL,display \
+ --with-arch_h='$(SOURCE_DIR)/arch/windows-x$(if $(filter x86_64-%,$(TARGET)),64,86)-msvc.h' \
+ --enable-dbus \
--disable-contrib \
--disable-cups \
--disable-gtk \
--with-libiconv=gnu \
--without-ijs \
- --with-aux-exe-ext=''
+ --without-x \
+ --with-exe-ext='' \
+ --enable-hidden-visibility \
+ --without-local-zlib
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(if $(BUILD_STATIC),libgs,so)
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include/ghostscript'
@@ -75,9 +56,9 @@ define $(PKG)_BUILD
echo 'Description: Ghostscript library'; \
echo 'Cflags: -I"$(PREFIX)/$(TARGET)/include/ghostscript"'; \
echo 'Libs: -L"$(PREFIX)/$(TARGET)/lib" -lgs'; \
- echo 'Requires: fontconfig freetype2 libidn libtiff-4 libpng jpeg lcms2 zlib'; \
+ echo 'Requires: fontconfig freetype2 libidn libtiff-4 libpng libopenjp2 jpeg lcms2 zlib'; \
echo '# https://github.com/mxe/mxe/issues/1446'; \
- echo 'Libs.private: -lm -liconv -lpaper -lopenjp2 -lwinspool';) \
+ echo 'Libs.private: -lm -liconv -lpaper -lwinspool';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/ghostscript.pc'
'$(TARGET)-gcc' \