summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac889
1 files changed, 583 insertions, 306 deletions
diff --git a/configure.ac b/configure.ac
index 3b72367d..698abd30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,17 +24,21 @@ AC_PREREQ(2.63)
AC_LANG(C)
AC_CONFIG_SRCDIR(psi/gs.c)
+AC_CANONICAL_HOST
+
dnl Inherit compiler flags from the environment...
CFLAGS="${CFLAGS:=}"
CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
-if test x"$cross_compiling" = x"yes"; then
+if test x"$host" != x"$build" ; then
CFLAGSAUX="${CFLAGSAUX:=}"
+ CPPFLAGSAUX="${CPPFLAGSAUX:=}"
LDFLAGSAUX="${LDFLAGSAUX:=}"
else
CFLAGSAUX="${CFLAGSAUX:-$CFLAGS}"
+ CPPFLAGSAUX="${CPPFLAGSAUX:-$CPPFLAGS}"
LDFLAGSAUX="${LDFLAGSAUX:-$LDFLAGS}"
fi
@@ -122,11 +126,13 @@ CFLAGSAUX_PROFILETMP="\$(CFLAGS_PROFILE)"
LDFLAGSAUXTMP="\$(LDFLAGS)"
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 +152,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=""
+ AC_MSG_NOTICE([Begin recursive call to configure script (for auxiliary tools)])
+ "$absolute_source_path/configure" CC="$CCAUX" CFLAGS="$CFLAGSAUX" CPPFLAGS="$CPPFLAGSAUX" 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 ../configaux.log
+ 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")
@@ -159,14 +166,16 @@ if test x"$CCAUX" != x"" ; then
LDFLAGSAUXTMP=$(grep LDFLAGSAUX $AUXFLAGS_MAK | sed "s/LDFLAGSAUX=//g")
AUXEXTRALIBSTMP=$(grep AUXEXTRALIBS$ $AUXFLAGS_MAK | sed "s/AUXEXTRALIBS$=//g")
fi
- cd $olddir
+ cd "$olddir"
if test x"$enable_save_confaux" != x"yes"; then
rm -rf $CONFAUXDIR
fi
if test $status -ne 0 ; then
- AC_MSG_ERROR([Recursive call to configure (for auxiliary tools) script failed], $status)
+ AC_MSG_ERROR([Recursive call to configure script failed], $status)
+ else
+ AC_MSG_NOTICE([Recursive call to configure script succeeded])
fi
fi
@@ -196,18 +205,22 @@ AC_SUBST(SED_EXTENDED_REGEX_OPT)
AC_PROG_RANLIB
#AC_PROG_INSTALL
-
-dnl pkg-config is used for several tests now...
-AC_PATH_TOOL(PKGCONFIG, pkg-config)
-
+# If the caller has gives a specific pkg-config to use, then
+# use it, and skip the tests.
+if test x"$PKGCONFIG" != x"" ; then
+ AC_MSG_NOTICE([Using $PKGCONFIG])
+else
# this is an unpleasant hack
# 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
- AC_PATH_PROG(BUILD_PKGCONFIG, pkg-config)
- if test x"$BUILD_PKGCONFIG" = x"$PKGCONFIG" ; then
- PKGCONFIG=
+ AC_PATH_TOOL(PKGCONFIG, pkg-config)
+ if test x"$host" != x"$build" ; then
+ dnl pkg-config is used for several tests now...
+ AC_PATH_PROG(BUILD_PKGCONFIG, pkg-config)
+ if test x"$BUILD_PKGCONFIG" = x"$PKGCONFIG" ; then
+ PKGCONFIG=
+ fi
fi
fi
@@ -217,7 +230,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 +247,14 @@ CONTRIBINCLUDE="include $srcdir/contrib/contrib.mak"
INSTALL_CONTRIB="install-contrib-extras"
if test x"$enable_contrib" = x; then
- if test x"$cross_compiling" = x"yes"; then
- enable_contrib=
- else
- case `uname` in
- MINGW*|MSYS*)
+ case $host in
+ *-mingw*|*-msys*|*-cygwin*)
AC_MSG_WARN([disabling contrib devices])
enable_contrib=no
;;
*)
;;
esac
- fi
fi
if test x"$enable_contrib" != x"no"; then
@@ -269,59 +278,59 @@ dnl --------------------------------------------------
dnl Set build flags based on environment
dnl --------------------------------------------------
-#AC_CANONICAL_HOST
-
-CC_OPT_FLAGS_TO_TRY="-O"
+CC_OPT_FLAGS_TO_TRY="-O -DNDEBUG"
SET_DT_SONAME="-soname="
+CFLAGS_LARGEFILE=""
-if test x"$cross_compiling" = x"yes"; then
- if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
- CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
- fi
-else
- case `uname` in
- Linux*|GNU*)
+case $host in
+ *-linux*|*-gnu)
if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
fi
;;
- *BSD)
+ *bsd*)
if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
fi
;;
- Darwin*)
+ *-darwin*)
if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
fi
SET_DT_SONAME=""
;;
- SunOS)
- CC_OPT_FLAGS_TO_TRY="-O2"
+ *-mingw*|*-msys*|*-cygwin*)
+ if test $ac_cv_prog_gcc = yes; then
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
+ CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ fi
+ SET_DT_SONAME=""
+ ;;
+ *-sun*|*-solaris*)
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
+ CFLAGS_LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
# the trailing space is required!
if test $ac_cv_prog_gcc = no; then
SET_DT_SONAME="-h "
fi
if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
else
CC_DBG_FLAGS_TO_TRY="-g -O0"
fi
;;
- AIX)
+ *-aix*)
if test $ac_cv_prog_gcc = yes; then
- CC_OPT_FLAGS_TO_TRY="-O2"
+ CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
SET_DT_SONAME="so"
fi
;;
- esac
-fi
+esac
AC_SUBST(SET_DT_SONAME)
@@ -330,11 +339,11 @@ if test $ac_cv_prog_gcc = yes; then
cflags_to_try="-Wall -Wstrict-prototypes -Wundef \
-Wmissing-declarations -Wmissing-prototypes -Wwrite-strings \
-fno-strict-aliasing -Werror=declaration-after-statement \
--fno-builtin -fno-common -Werror=return-type"
+-fno-builtin -fno-common -Werror=return-type $CFLAGS_LARGEFILE"
optflags_to_try="$CC_OPT_FLAGS_TO_TRY"
dbgflags_to_try="$CC_DBG_FLAGS_TO_TRY"
else
- cflags_to_try=
+ cflags_to_try="$CFLAGS_LARGEFILE"
optflags_to_try="$CC_OPT_FLAGS_TO_TRY"
dbgflags_to_try="$CC_DBG_FLAGS_TO_TRY"
fi
@@ -368,18 +377,25 @@ 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
- if test x"$cross_compiling" = x"yes"; then
- ARCH_CONF_HEADER="\$(GLSRCDIR)/../$ARCH_AUTOCONF_HEADER"
- else
- case `uname` in
- Darwin*)
+ case $host in
+ 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=
+ if test x"$host" != x"$build"; then
+ ARCH_CONF_HEADER="\$(GLSRCDIR)/../$ARCH_AUTOCONF_HEADER"
+ else
+ ARCH_CONF_HEADER=
+ fi
;;
esac
- fi
else
ARCH_CONF_HEADER=$with_arch_h
fi
@@ -395,7 +411,7 @@ AC_SUBST(ARCH_CONF_HEADER)
#fi
# NOTE: To correctly disable GCC's strict aliasing with '-fno-strict-aliasing'
-# option, the 'cflags_to_try' have to checked after 'optflags_to_try'.
+# option, the 'cflags_to_try' have to be checked after 'optflags_to_try'.
AC_MSG_CHECKING([supported compiler flags])
old_cflags=$CFLAGS
@@ -448,6 +464,27 @@ AC_LINK_IFELSE(
CFLAGS="$CFLAGS_SAVED"
AC_MSG_RESULT([ ...done.])
+
+
+dnl ----------------------------
+dnl check for sanitize build warnings support
+dnl ----------------------------
+AC_MSG_CHECKING([compiler/linker address santizer build warnings support])
+
+CFLAGS_SANITIZE_TRY="$CFLAGS_SANITIZE -W -Wall -Wno-unused-parameter -Wno-sign-compare -Wno-implicit-fallthrough -Wno-missing-field-initializers -Wno-shift-negative-value -Wno-old-style-declaration -Wno-unused-but-set-parameter"
+CFLAGS_SAVED="$CFLAGS"
+CFLAGS="$CFLAGS_SANITIZE_TRY"
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <stdio.h>], [
+ return(0);
+ ])],
+ [CFLAGS_SANITIZE="$CFLAGS"], [echo 'extra warnings not supported'])
+
+CFLAGS="$CFLAGS_SAVED"
+AC_MSG_RESULT([ ...done.])
+
+
dnl ----------------------------
dnl check for big/little endian
dnl ----------------------------
@@ -506,18 +543,30 @@ AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h limits.h malloc.h memory.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/time.h sys/times.h syslog.h unistd.h dirent.h ndir.h sys/dir.h sys/ndir.h inttypes.h])
dnl --------------------------------------------------
-dnl Check for *BSD and apply BSD Make workaround
-dnl - BSD Make treats obj special and cd into it first.
+dnl Sun, BSD possibly other makes don't have quite the
+dnl feature set of GNU make. We still prefer GNU make,
+dnl but......
dnl --------------------------------------------------
OBJDIR_BSDMAKE_WORKAROUND=obj
+SUB_MAKE_OPTION=
+ORDER_ONLY=""
+
+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
-case `uname` in
- *BSD)
- OBJDIR_BSDMAKEWORKAOROUND="notobj"
- ;;
-esac
AC_SUBST(OBJDIR_BSDMAKE_WORKAROUND)
+AC_SUBST(ORDER_ONLY)
+AC_SUBST(SUB_MAKE_OPTION)
+
AC_CHECK_HEADER([sys/window.h])
dnl --------------------------------------------------
@@ -658,15 +707,15 @@ 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
+SUBCONFIG_OPTS="--build=$build --host=$host"
-if test x"$host_alias" != x""; then
- SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host_alias"
-fi
+#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
dnl --------------------------------------------------
dnl Check for libraries
@@ -701,11 +750,12 @@ AC_ARG_ENABLE([threading], AC_HELP_STRING([--disable-threading],
# if you haven't got pread/pwrite, we can't use multithreading
if test "x$HAVE_PREAD_PWRITE" != "x"; then
if test "$enable_threading" != "no"; then
+ mutex_result="no"
AC_CHECK_LIB(pthread, pthread_create, [
SYNC=posync;
PTHREAD_LIBS="-lpthread"
])
- AC_MSG_CHECKING([recursive mutexes.......])
+ AC_MSG_CHECKING([for recursive mutexes])
AC_TRY_COMPILE([#include <pthread.h>],
[
static int k = PTHREAD_MUTEX_RECURSIVE;
@@ -719,7 +769,8 @@ if test "x$HAVE_PREAD_PWRITE" != "x"; then
;
return 0;
],
- [RECURSIVE_MUTEXATTR="-DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE"],
+ [RECURSIVE_MUTEXATTR="-DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE"
+ mutex_result="PTHREAD_MUTEX_RECURSIVE"],
[AC_TRY_COMPILE([#include <pthread.h>],
[
static int k = PTHREAD_MUTEX_RECURSIVE_NP;
@@ -733,7 +784,9 @@ if test "x$HAVE_PREAD_PWRITE" != "x"; then
;
return 0;
],
- [RECURSIVE_MUTEXATTR="-DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE_NP"])])
+ [RECURSIVE_MUTEXATTR="-DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE_NP"
+ mutex_result="PTHREAD_MUTEX_RECURSIVE_NP"])])
+ AC_MSG_RESULT($mutex_result)
fi
fi
@@ -789,23 +842,38 @@ AC_ARG_WITH(libidn,
[AC_HELP_STRING([--without-libidn],
[Do not use libidn to support Unicode passwords])],,
[with_libidn=maybe])
+
if test x$with_libidn != xno; then
- AC_CHECK_LIB(idn, stringprep, [
- with_libidn=no
- AC_CHECK_HEADER([stringprep.h], [with_libidn=yes])
- ], [
- if test x$with_libidn != xmaybe; then
- AC_MSG_ERROR([libidn not found])
+ if test x"$PKGCONFIG" != x""; then
+ AC_MSG_CHECKING(for libidn with pkg-config)
+ if $PKGCONFIG --exists libidn; then
+ AC_MSG_RESULT(yes)
+ LIBS="$LIBS `$PKGCONFIG --libs libidn`"
+ HAVE_LIBIDN=-DHAVE_LIBIDN
+ else
+ AC_MSG_RESULT(no)
fi
- with_libidn=no
- ])
+ fi
+ if test -z "$HAVE_LIBIDN"; then
+ AC_CHECK_LIB(idn, stringprep, [
+ with_libidn=no
+ AC_CHECK_HEADER([stringprep.h],
+ [
+ with_libidn=yes
+ HAVE_LIBIDN="-DHAVE_LIBIDN"
+ LIBS="$LIBS -lidn"
+ ])
+ ], [
+ if test x$with_libidn != xmaybe; then
+ AC_MSG_ERROR([libidn not found])
+ fi
+ with_libidn=no
+ ])
+ fi
fi
-HAVE_LIBIDN=''
+
UTF8DEVS=''
if test x$with_libidn != xno; then
- HAVE_LIBIDN=-DHAVE_LIBIDN
- LIBS="$LIBS -lidn"
-
if test x$found_iconv != xno; then
UTF8DEVS='$(PSD)utf8.dev'
fi
@@ -853,7 +921,7 @@ if test "$enable_fontconfig" != "no"; then
if $PKGCONFIG --exists fontconfig; then
AC_MSG_RESULT(yes)
FONTCONFIG_CFLAGS="$CFLAGS `$PKGCONFIG --cflags fontconfig`"
- FONTCONFIG_LIBS="`$PKGCONFIG --libs fontconfig`"
+ FONTCONFIG_LIBS="`$PKGCONFIG --libs-only-l fontconfig`"
HAVE_FONTCONFIG=-DHAVE_FONTCONFIG
else
AC_MSG_RESULT(no)
@@ -919,9 +987,6 @@ UFST_CFLAGS=
UFST_LIB_EXT=
FAPIUFST_MAK="\$(GLSRCDIR)\$(D)stub.mak"
-AC_ARG_ENABLE([fapi], AC_HELP_STRING([--disable-fapi],
- [Force use of the (deprecated) Artifex font scaler/renderer]))
-
if test x"$enable_fapi" != xno; then
dnl UFST detection
@@ -989,19 +1054,18 @@ if test x"$enable_fapi" != xno; then
if test x"$FTSRCDIR" = x"src"; then
AC_MSG_RESULT([no])
- if test "x$PKGCONFIG" != x; then
+ if test x"$PKGCONFIG" != x""; then
AC_MSG_CHECKING(for system freetype2 >= 2.4.2 with pkg-config)
# pkg-config needs the libtool version, which != the freetype2 version <sigh!>
# There is a table of corresponding ft2<->libtool numbers in freetype/docs/VERSION.DLL
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
AC_MSG_RESULT(no)
- AC_MSG_WARN([freetype library source not found...using native rasterizer])
AFS=1
fi
else
@@ -1035,6 +1099,12 @@ if test x"$enable_fapi" != xno; then
fi
fi
+if test x"$FT_BRIDGE" != x"1"; then
+ if test x"$enable_auxtools_only" != x"yes" ; then
+ AC_MSG_ERROR([No usable Freetype source or library found])
+ fi
+fi
+
AC_SUBST(INSERT_UFST_BRIDGE_EQUAL_ONE)
AC_SUBST(UFST_ROOT)
AC_SUBST(UFST_CFLAGS)
@@ -1047,47 +1117,67 @@ AC_SUBST(FTSRCDIR)
AC_SUBST(FT_CFLAGS)
AC_SUBST(FT_LIBS)
-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.
-dnl A more sophisticated approach would be to test the shared lib
-dnl to see whether it has already been patched.
-LIBJPEGDIR=src
-if test -f $srcdir/jpeg/jpeglib.h; then
- AC_MSG_RESULT([jpeg])
- SHARE_LIBJPEG=0
- LIBJPEGDIR=$srcdir/jpeg
-elif test -f $srcdir/jpeg-6b/jpeglib.h; then
- AC_MSG_RESULT([jpeg-6b])
- SHARE_LIBJPEG=0
- LIBJPEGDIR=$srcdir/jpeg-6b
-else
- AC_MSG_RESULT([no])
- AC_CHECK_LIB(jpeg, jpeg_set_defaults, [
- AC_CHECK_HEADERS([jpeglib.h], [SHARE_LIBJPEG=1])
- ])
-fi
-if test -z "$SHARE_LIBJPEG"; then
- AC_MSG_ERROR([I wasn't able to find a copy
- of the jpeg library. This is required for compiling
- ghostscript. Please download a copy of the source,
- e.g. from http://www.ijg.org/, unpack it at the
- top level of the gs source tree, and rename
- the directory to 'jpeg'.
- ])
-fi
-AC_SUBST(SHARE_LIBJPEG)
-AC_SUBST(LIBJPEGDIR)
-dnl check for the internal jpeg memory header
-AC_MSG_CHECKING([for jmemsys.h])
-if test -r $LIBJPEGDIR/jmemsys.h; then
- AC_MSG_RESULT([yes])
+TIFF_JPEG_INCLUDE=
+
+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_RESULT([no])
- AC_DEFINE([DONT_HAVE_JMEMSYS_H], 1,
- [define if the libjpeg memory system prototypes aren't available])
+ 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.
+ dnl A more sophisticated approach would be to test the shared lib
+ dnl to see whether it has already been patched.
+ LIBJPEGDIR=src
+ if test -f $srcdir/jpeg/jpeglib.h; then
+ AC_MSG_RESULT([jpeg])
+ SHARE_LIBJPEG=0
+ LIBJPEGDIR=$srcdir/jpeg
+ elif test -f $srcdir/jpeg-6b/jpeglib.h; then
+ AC_MSG_RESULT([jpeg-6b])
+ SHARE_LIBJPEG=0
+ LIBJPEGDIR=$srcdir/jpeg-6b
+ else
+ AC_MSG_RESULT([no])
+ AC_CHECK_LIB(jpeg, jpeg_set_defaults, [
+ AC_CHECK_HEADERS([jpeglib.h], [SHARE_LIBJPEG=1])
+ ])
+ fi
+
+ if test x"$LIBJPEGDIR" != x"src" ; then
+ TIFF_JPEG_INCLUDE="$LIBJPEGDIR"
+ fi
+
+ if test -z "$SHARE_LIBJPEG"; then
+ AC_MSG_ERROR([I wasn't able to find a copy
+ of the jpeg library. This is required for compiling
+ ghostscript. Please download a copy of the source,
+ e.g. from http://www.ijg.org/, unpack it at the
+ top level of the gs source tree, and rename
+ the directory to 'jpeg'.
+ ])
+ fi
+ AC_SUBST(SHARE_LIBJPEG)
+ AC_SUBST(LIBJPEGDIR)
+ dnl check for the internal jpeg memory header
+ AC_MSG_CHECKING([for jmemsys.h])
+ if test -r $LIBJPEGDIR/jmemsys.h; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_DEFINE([DONT_HAVE_JMEMSYS_H], 1,
+ [define if the libjpeg memory system prototypes aren't available])
+ fi
fi
+# 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)
@@ -1096,7 +1186,13 @@ ZLIBDIR=src
AUX_SHARED_ZLIB=
ZLIBCFLAGS=""
-if test -d $srcdir/zlib; then
+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
ZLIBDIR=$srcdir/zlib
@@ -1104,11 +1200,12 @@ if test -d $srcdir/zlib; then
if test x"$ac_cv_prog_gcc" = x"yes"; then
ZLIBCFLAGS="-Wno-write-strings"
fi
-else
+ else
AC_MSG_RESULT([no])
AC_CHECK_LIB(z, deflate, [
AC_CHECK_HEADERS(zlib.h, [SHARE_ZLIB=1; AUX_SHARED_ZLIB="-l\$(ZLIB_NAME)"])
])
+ fi
fi
if test -z "$SHARE_ZLIB"; then
AC_MSG_ERROR([I did not find a copy of zlib on your system.
@@ -1136,26 +1233,31 @@ AC_SUBST(ZLIBDIR)
AC_SUBST(FT_SYS_ZLIB)
dnl png for the png output device; it also requires zlib
-LIBPNGDIR=src
-PNGDEVS=''
-PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
-AC_MSG_CHECKING([for local png library source])
-if test -f $srcdir/libpng/pngread.c; then
- AC_MSG_RESULT([yes])
- SHARE_LIBPNG=0
- LIBPNGDIR=$srcdir/libpng
- PNGDEVS="$PNGDEVS_ALL"
+if test x"$enable_auxtools_only" = x"yes" ; then
+ LIBPNGDIR=""
+ SHARE_LIBPNG=0
else
- AC_MSG_RESULT([no])
- AC_CHECK_LIB(png, png_create_write_struct, [
- AC_CHECK_HEADERS(png.h, [
- SHARE_LIBPNG=1
- PNGDEVS="$PNGDEVS_ALL"
- ], [SHARE_LIBPNG=0])
- ], [SHARE_LIBPNG=0], [-lz])
-fi
-if test -z "$PNGDEVS"; then
- AC_MSG_NOTICE([disabling png output devices])
+ LIBPNGDIR=src
+ PNGDEVS=''
+ PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
+ AC_MSG_CHECKING([for local png library source])
+ if test -f $srcdir/libpng/pngread.c; then
+ AC_MSG_RESULT([yes])
+ SHARE_LIBPNG=0
+ LIBPNGDIR=$srcdir/libpng
+ PNGDEVS="$PNGDEVS_ALL"
+ else
+ AC_MSG_RESULT([no])
+ AC_CHECK_LIB(png, png_create_write_struct, [
+ AC_CHECK_HEADERS(png.h, [
+ SHARE_LIBPNG=1
+ PNGDEVS="$PNGDEVS_ALL"
+ ], [SHARE_LIBPNG=0])
+ ], [SHARE_LIBPNG=0], [-lz])
+ fi
+ if test -z "$PNGDEVS"; then
+ AC_MSG_NOTICE([disabling png output devices])
+ fi
fi
AC_SUBST(SHARE_LIBPNG)
AC_SUBST(LIBPNGDIR)
@@ -1167,24 +1269,29 @@ AC_MSG_CHECKING([for local lcms2mt library source])
LCMS2DIR=src
LCMS2MTDIR=src
+if test x"$enable_auxtools_only" = x"yes" ; then
+ SHARELCMS=0
+ LCMS2DIR=
+ LCMS2MTDIR=
+else
# First check for Artifex version
-LCMS2MTSRC=$srcdir/lcms2mt
-if test -f $LCMS2MTSRC/include/lcms2mt.h; then
+ LCMS2MTSRC=$srcdir/lcms2mt
+ if test -f $LCMS2MTSRC/include/lcms2mt.h; then
AC_MSG_RESULT([yes])
SHARELCMS=0
WHICHLCMS=lcms2mt
LCMS2MTDIR=$LCMS2MTSRC
-else
- AC_MSG_RESULT([no])
- # Now check for local lcms2 (non-Artifex)
- AC_MSG_CHECKING([for local lcms2 library source])
- LCMS2SRC=$srcdir/lcms2
- if test -f $LCMS2SRC/include/lcms2.h; then
+ else
+ AC_MSG_RESULT([no])
+ # Now check for local lcms2 (non-Artifex)
+ AC_MSG_CHECKING([for local lcms2 library source])
+ LCMS2SRC=$srcdir/lcms2
+ if test -f $LCMS2SRC/include/lcms2.h; then
AC_MSG_RESULT([yes])
SHARELCMS=0
WHICHLCMS=lcms2
LCMS2DIR=$LCMS2SRC
- else
+ else
# See if we have system library of lcms2
AC_MSG_RESULT([no])
AC_MSG_CHECKING([for system lcms2 library])
@@ -1194,7 +1301,8 @@ else
if test x$WHICHLCMS = x; then
AC_MSG_ERROR([lcms2 not found, or too old])
fi
- fi
+ fi
+ fi
fi
AC_SUBST(SHARELCMS)
@@ -1234,6 +1342,7 @@ case "x$with_system_libtiff" in
LIBTIFFCONFDIR=tiff-config
HAVE_LOCAL_LIBTIFF=1
SHARE_LIBTIFF=0
+ ENABLETIFF="\$(D_)TIFF_INCLUDED\$(_D)"
else
# We MUST NOT use PKG_CHECK_MODULES since it is a) not a standard
# autoconf macro and b) requires pkg-config on the system, which is
@@ -1259,6 +1368,7 @@ case "x$with_system_libtiff" in
TIFFDEVS="$TIFFDEVS_ALL"
FAX_DEVS="$FAX_DEVS_ALL"
XPSWRITEDEVICE='xpswrite'
+ ENABLETIFF="\$(D_)TIFF_INCLUDED\$(_D)"
fi
;;
xyes)
@@ -1284,6 +1394,7 @@ case "x$with_system_libtiff" in
TIFFDEVS="$TIFFDEVS_ALL"
FAX_DEVS="$FAX_DEVS_ALL"
XPSWRITEDEVICE='xpswrite'
+ ENABLETIFF="\$(D_)TIFF_INCLUDED\$(_D)"
else
AC_MSG_NOTICE([Could not find a copy of libtiff on your system. Disabling tiff and xps output devices.])
fi
@@ -1298,6 +1409,7 @@ case "x$with_system_libtiff" in
TIFFDEVS="$TIFFDEVS_ALL"
FAX_DEVS="$FAX_DEVS_ALL"
XPSWRITEDEVICE='xpswrite'
+ ENABLETIFF="\$(D_)TIFF_INCLUDED\$(_D)"
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Could not find local copy of libtiff. Disabling tiff and xps output devices.])
@@ -1324,7 +1436,7 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then
if ! test -d "$LIBTIFFCONFDIR" ; then
mkdir "$LIBTIFFCONFDIR"
fi
- cd "$LIBTIFFCONFDIR" && ../"$LIBTIFFDIR"/configure --disable-jbig --disable-lzma $SUBCONFIG_OPTS
+ cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" --disable-jbig --disable-lzma --disable-zstd --disable-webp $SUBCONFIG_OPTS
status=$?
if test $status -ne 0 ; then
AC_MSG_ERROR([libtiff configure script failed], $status)
@@ -1334,6 +1446,10 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then
if test x"$ac_cv_prog_gcc" = x"yes"; then
TIFFCFLAGS="-Wno-write-strings $CFLAGS_NMI $CFLAGS_NUD -DJPEG_LIB_MK1_OR_12BIT=0"
fi
+ # if we're building with our own libjpeg, or we have another libjpeg available, allow jpeg compression in TIFF
+ if test x"$SHARE_LIBJPEG" = x"1" ; then
+ TIFFCFLAGS="-DJPEG_SUPPORT -DOJPEG_SUPPORT -DJPEG_LIB_MK1_OR_12BIT=0 $TIFFCFLAGS"
+ fi
echo
echo "Continuing with Ghostscript configuration..."
@@ -1343,13 +1459,15 @@ AC_SUBST(SHARE_LIBTIFF)
AC_SUBST(LIBTIFFDIR)
AC_SUBST(LIBTIFFCONFDIR)
AC_SUBST(TIFFCFLAGS)
+AC_SUBST(ENABLETIFF)
+
SHARE_EXPAT=0
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
@@ -1383,7 +1501,6 @@ if test x"$with_xps" != x"no" ; then
fi
fi
-
AC_SUBST(SHARE_EXPAT)
AC_SUBST(EXPATDIR)
AC_SUBST(EXPAT_CFLAGS)
@@ -1423,21 +1540,40 @@ CUPSVERSION="0"
CUPSPDFTORASTER="0"
CUPS_DIR=""
+cups_hard_fail=0
+
SHARELCUPS=1
SHARELCUPSI=1
+case $host in
+ *-mingw*|*-msys*|*-cygwin*)
+ AC_MSG_WARN([disabling cups])
+ enable_cups=no
+ ;;
+ *)
+ ;;
+esac
+
if ( test -f $srcdir/cups/gdevcups.c ); then
CUPS_DIR="$srcdir/cups"
+# If the user explicitly enabled cups, hard fail if not found
+ if test x"$enable_cups" = x"yes"; then
+ cups_hard_fail=1
+ fi
if test x$enable_cups != xno; then
if test x$with_local_cups != xyes; then
if test x"$CUPSCONFIG" = x""; then
AC_PATH_TOOL(CUPSCONFIG,cups-config)
- if test x"$cross_compiling" = x"yes"; then
+ if test x"$build" != x"$host"; then
AC_PATH_PROG(BUILD_CUPSCONFIG, cups-config)
if test x"$BUILD_CUPSCONFIG" = x"$CUPSCONFIG" ; then
CUPSCONFIG=
fi
fi
+ else
+# We were given a cups-config on the command line, assume the user intends to
+# include cups, and make not finding a hard fail.
+ cups_hard_fail=1
fi
# check for a libcups header
AC_CHECK_HEADER([cups/cups.h],[],[CUPSCONFIG=""])
@@ -1491,6 +1627,10 @@ if ( test -f $srcdir/cups/gdevcups.c ); then
CUPSPDFTORASTER="1"
fi
fi
+ else
+ if test x"$cups_hard_fail" = x"1" ; then
+ AC_MSG_ERROR([libcups/libcupsimage not found])
+ fi
fi
else
AC_MSG_WARN([USING LOCAL CUPS SOURCE])
@@ -1528,16 +1668,14 @@ dnl look for IJS implementation
AC_ARG_WITH([ijs], AC_HELP_STRING([--without-ijs],
[disable IJS driver support]))
-if test x"$cross_compiling" != x"yes"; then
- case `uname` in
- MINGW*|MSYS*)
- AC_MSG_WARN([disabling the ijs device])
- with_ijs=no
+case $host in
+ *-mingw*|*-msys*|*-cygwin*)
+ AC_MSG_WARN([disabling the ijs device])
+ with_ijs=no
;;
*)
;;
- esac
-fi
+esac
dnl set safe defaults
IJSDIR=src
@@ -1589,18 +1727,14 @@ if test x$with_luratech != xno; then
SHARE_JBIG2=0
JBIG2DIR=$srcdir/luratech/ldf_jb2
- if test x"$cross_compiling" = x"yes"; then
- if test x"$JBIG2_CFLAGS" != x""; then
- JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char $JBIG2_CFLAGS"
- else
- JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
- fi
+ if test x"$JBIG2_CFLAGS" != x""; then
+ JBIG2_AUTOCONF_CFLAGS="$JBIG2_CFLAGS"
else
- case `uname` in
- Darwin*)
+ case $host in
+ *-darwin*)
JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -DMAC -DMAC_OS_X_BUILD -fsigned-char"
;;
- AIX)
+ *-aix*)
if test $ac_cv_prog_gcc = yes; then
JBIG2_AUTOCONF_CFLAGS="-DUSE_LDF_JB2 -fsigned-char -DLINUX=1 -DFORTE"
else
@@ -1734,18 +1868,14 @@ if test x$with_luratech != xno; then
SHARE_JPX=0
JPXDIR=$srcdir/luratech/lwf_jp2
- if test x"$cross_compiling" = x"yes"; then
- if test x"$JPX_CFLAGS" != x""; then
- JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 $JPX_CFLAGS"
- else
- JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DLINUX=1 -DFORTE"
- fi
+ if test x"$JPX_CFLAGS" != x""; then
+ JPX_AUTOCONF_CFLAGS="$JPX_CFLAGS"
else
- case `uname` in
- Darwin*)
+ case $host in
+ *-darwin*)
JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -DMAC -DMAC_OS_X_BUILD"
;;
- AIX)
+ *-aix*)
if test $ac_cv_prog_gcc = yes; then
JPX_AUTOCONF_CFLAGS="-DUSE_LWF_JP2 -fsigned-char -DLINUX=1 -DFORTE"
else
@@ -1815,11 +1945,17 @@ if test "x$JPX_DECODER" = "x"; then
JPX_AUTOCONF_CFLAGS="-D\"memalign(a,b)=malloc(b)\""
fi
- JPX_AUTOCONF_CFLAGS="$JPX_AUTOCONF_CFLAGS -DMUTEX_pthread=0 $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"
+ CFLAGS_old="$CFLAGS"
+ CFLAGS="-Wno-attributes"
+ AC_TRY_COMPILE([], [return 0;], [JPX_AUTOCONF_CFLAGS="$JPX_AUTOCONF_CFLAGS -Wno-attributes"])
+ CFLAGS="$CFLAGS_old"
+
+ JPX_AUTOCONF_CFLAGS="$JPX_AUTOCONF_CFLAGS -DOPJ_STATIC -DMUTEX_pthread=0 $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"
JPXDEVS='$(PSD)jpx.dev'
else
AC_MSG_RESULT([no])
+ check_for_opj_stream_set_user_data=no
if test x"$PKGCONFIG" != x""; then
AC_MSG_CHECKING(for OpenJPEG2)
if $PKGCONFIG --exists libopenjp2; then
@@ -1830,8 +1966,12 @@ if test "x$JPX_DECODER" = "x"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
+ check_for_opj_stream_set_user_data=yes
fi
else
+ check_for_opj_stream_set_user_data=yes
+ fi
+ if test x"$check_for_opj_stream_set_user_data" != x"no"; then
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";
@@ -1849,6 +1989,33 @@ AC_SUBST(JPXDIR)
AC_SUBST(SHARE_JPX)
AC_SUBST(JPXDEVS)
+ENABLEURF=
+URF_DEVS=''
+URF_INCLUDE=
+URF_DEV=
+SURFX_H=
+AC_ARG_WITH([urf], AC_HELP_STRING([--without-urf],
+ [do not try to include URF support]))
+
+if test x$with_urf != xno; then
+ AC_MSG_CHECKING([for URF support])
+ if test -d $srcdir/urf; then
+ AC_MSG_RESULT([yes])
+ ENABLEURF="\$(D_)URF_INCLUDED\$(_D)"
+ URF_DEVS='urfgray urfrgb urfcmyk'
+ GPDL_URF_TOP_OBJ=$(GPDLOBJ)/$(GPDL_URF_TOP_OBJ_FILE)
+ URF_INCLUDE=$(I_)$(URFSRCDIR)$(_I)
+ URF_DEV=$(GLD)urfd.dev
+ SURFX_H=SURFX_H=$(URFSRCDIR)$(D)surfx.h
+fi
+fi
+
+AC_SUBST(ENABLEURF)
+AC_SUBST(GPDL_URF_TOP_OBJ)
+AC_SUBST(URF_INCLUDE)
+AC_SUBST(URF_DEV)
+AC_SUBST(SURFX_H)
+
AC_ARG_WITH([cal], AC_HELP_STRING([--without-cal],
[do not try to use the CAL library for acceleration]))
@@ -2015,7 +2182,11 @@ AC_SUBST(SOC_LIBS)
AC_SUBST(SOC_LOADER)
dnl optional X11 for display devices
-AC_PATH_XTRA
+if test x"$enable_auxtools_only" = x"yes" ; then
+ no_x=yes
+else
+ AC_PATH_XTRA
+fi
X_LDFLAGS=""
X_CFLAGS=""
@@ -2029,9 +2200,14 @@ if test x$no_x != xyes; then
fi
if test ! "$x_libraries" = "NONE" -a ! "$x_libraries" = ""; then
X_LDFLAGS="-L$x_libraries"
- if test "$uname" = "SunOS"; then
+ case $host in
+ *-sun*|*-solaris*)
X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
- fi
+ ;;
+ *)
+ ;;
+ esac
+
fi
if test "$x_includes" = "/usr/include"; then
@@ -2156,14 +2332,6 @@ AC_SUBST(GPDL_TARGET)
AC_SUBST(GPDL_MAK)
-AC_ARG_ENABLE([gpdl], AC_HELP_STRING([--enable-gpdl],
- [Add gpdl to the default make target list]),
-[
- GPDL_TARGET_VAR="\$(GPDL_TARGET)"
-])
-
-AC_SUBST(GPDL_TARGET_VAR)
-
dnl do we compile the postscript initialization files into Ghostscript?
COMPILE_INITS="1"
AC_ARG_ENABLE([compile-inits], AC_HELP_STRING([--disable-compile-inits],
@@ -2174,6 +2342,7 @@ AC_ARG_ENABLE([compile-inits], AC_HELP_STRING([--disable-compile-inits],
AC_SUBST(COMPILE_INITS)
dnl look for drivers to compile...
+APPLE_DEVICES_REQUESTED="no"
AC_ARG_WITH(drivers,
[ --with-drivers=LIST Drivers to support, separated by commas.
Either list the drivers or use aliases:
@@ -2216,6 +2385,10 @@ if test "x$driversfile" != x; then
drivers="`tr '\n' ',' <$driversfile`"
fi
+if echo $drivers | grep 'APPLE\|iwhi\|iwlo\|iwlq' >/dev/null; then
+ APPLE_DEVICES_REQUESTED="yes"
+fi
+
dnl Check which drivers we'd like to support.
P_DEVS0=""
F_DEVS0=""
@@ -2234,6 +2407,7 @@ EPSON_DEVS='eps9high eps9mid epson epsonc escp lp8000 lq850 photoex st800 stcolo
CANON_DEVS='bj10e bj200 bjc600 bjc800 lbp8 lips3 bjcmono bjcgray bjccmyk bjccolor'
LEXMARK_DEVS='lxm5700m lxm3200 lex2050 lex3200 lex5700 lex7000'
BROTHER_DEVS='hl7x0 hl1240 hl1250'
+APPLE_DEVS='appledmp iwhi iwlo iwlq'
IBM_DEVS='ibmpro jetp3852'
OKI_DEVS='oki182 okiibm oki4w'
JAPAN_DEVS='lips4 lips4v ljet4pjl lj4dithp dj505j picty180 lips2p bjc880j pr201 pr150 pr1000 pr1000_4 jj100 bj10v bj10vh mj700v2c mj500c mj6000c mj8000c fmpr fmlbp ml600 lbp310 lbp320 md50Mono md50Eco md1xMono escpage lp2000 npdl rpdl'
@@ -2253,7 +2427,7 @@ PBM_DEVS='pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pk
PS_DEVS='psdf psdcmyk psdrgb psdcmyk16 psdrgb16 pdfwrite ps2write eps2write bbox txtwrite inkcov ink_cov psdcmykog fpng pdfimage8 pdfimage24 pdfimage32 PCLm'
# the "display" device isn't an ideal fit in the list below, but it saves adding a "list" for just that one entry
-MISC_FDEVS='ccr cif inferno mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 plan9bm bit bitrgb bitrgbtags bitcmyk devicen spotcmyk xcf plib plibg plibm plibc plibk gprf display'
+MISC_FDEVS='ccr cif inferno mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 plan9bm bit bitrgb bitrgbtags bitcmyk devicen spotcmyk xcf plib plibg plibm plibc plibk display'
XPSDEV=$XPSWRITEDEVICE
@@ -2276,7 +2450,7 @@ while test -n "$drivers"; do
fi
;;
PRINTERS)
- P_DEVS0="$P_DEVS0 $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $ETS_HALFTONING_DEVS"
+ P_DEVS0="$P_DEVS0 $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $ETS_HALFTONING_DEVS $URF_DEVS"
IJS_DEVS0="$IJSDEVS"
if test x$ac_cv_lib_dl_dlopen != xno -a x$found_iconv != xno; then
P_DEVS0="$P_DEVS0 $OPVP_DEVS"
@@ -2290,6 +2464,10 @@ while test -n "$drivers"; do
JBIG2_DEVS="$JBIG2FILEDEVS"
PNG_DEVS0="$PNGDEVS"
;;
+ APPLE)
+ # All Apple printers
+ P_DEVS0="$P_DEVS0 $APPLE_DEVS"
+ ;;
BMP)
# BMP file format
F_DEVS0="$F_DEVS0 $BMP_DEVS"
@@ -2481,6 +2659,14 @@ if test -n "$X11_DEVS0"; then
X11_DEVS=`(for i in $X11_DEVS0; do d='$(DD)'${i}.dev; if ( grep '^'$d $noncontribmakefiles 2>&1 >/dev/null) || ( ! test -z "$CONTRIBINCLUDE" ); then echo $d; fi; done) | sort | uniq | tr '\012\015' ' '`
fi
+# if the user explicitly requested the Apple devices, then hard fail if they aren't available
+if test x"$APPLE_DEVICES_REQUESTED" = x"yes" ; then
+ APDEVS=`echo $P_DEVS | grep 'APPLE\|iwhi\|iwlo\|iwlq'`
+ if test -z "$APDEVS" ; then
+ AC_MSG_ERROR([Requested Apple device(s) not available (iwhi, iwlo, and/or iwlq)])
+ fi
+fi
+
AC_SUBST(P_DEVS)
AC_SUBST(F_DEVS)
AC_SUBST(CUPS_DEVS)
@@ -2506,23 +2692,40 @@ SO_LIB_EXT=".so"
DLL_EXT=""
SO_LIB_VERSION_SEPARATOR="."
-if test x"$cross_compiling" = x"yes"; then
- 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)"
- XPS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR)"
- PDL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GPDL_SONAME_MAJOR)"
- if test $ac_cv_prog_gcc = yes; then
- # GCC high level flag
- DYNAMIC_LIBS="-rdynamic"
- else
- DYNAMIC_LIBS=""
- fi
- SO_LIB_EXT=".so"
-else
- case `uname` in
- Linux*|GNU*)
- DYNAMIC_CFLAGS="-fPIC"
+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}"
+PCL_SONAME="lib\$(PCL${libname1}"
+PCL_SONAME_MAJOR="lib\$(PCL${libname2}"
+PCL_SONAME_MAJOR_MINOR="lib\$(PCL${libname3}"
+XPS_SONAME="lib\$(XPS${libname1}"
+XPS_SONAME_MAJOR="lib\$(XPS${libname2}"
+XPS_SONAME_MAJOR_MINOR="lib\$(XPS${libname3}"
+GPDL_SONAME="lib\$(GPDL${libname1}"
+GPDL_SONAME_MAJOR="lib\$(GPDL${libname2}"
+GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${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*|*-gnu)
+ DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
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)"
XPS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR)"
@@ -2535,25 +2738,45 @@ 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"
- PCL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PCL_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
- XPS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(XPS_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
- PDL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PDL_SO_BASE).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
+ *-mingw*|*-msys*|*-cygwin*)
+ if test x$hide_symbols = xyes; then
+ attr_default="__declspec(dllexport)"
+ attr_hidden=""
+ 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 $_ldflags"
+ XPS_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(XPS_SO_BASE).dll.a $_ldflags"
+ PDL_DYNAMIC_LDFLAGS="-shared -Wl,--out-implib=\$(BINDIR)/lib\$(PDL_SO_BASE).dll.a $_ldflags"
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}"
+ PCL_SONAME="lib\$(PCL${libname1}"
+ PCL_SONAME_MAJOR="lib\$(PCL${libname3}"
+ PCL_SONAME_MAJOR_MINOR="lib\$(PCL${libname2}"
+ XPS_SONAME="lib\$(XPS${libname1}"
+ XPS_SONAME_MAJOR="lib\$(XPS${libname3}"
+ XPS_SONAME_MAJOR_MINOR="lib\$(XPS${libname2}"
+ GPDL_SONAME="lib\$(GPDL${libname1}"
+ GPDL_SONAME_MAJOR="lib\$(GPDL${libname3}"
+ GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${libname2}"
;;
- *BSD)
- DYNAMIC_CFLAGS="-fPIC"
+ *bsd*)
+ DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
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)"
XPS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR)"
DYNAMIC_LIBS=""
SO_LIB_EXT=".so"
;;
- Darwin*)
+ *-darwin*)
+ DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
GS_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(GS_SONAME_MAJOR_MINOR)"
PCL_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(PCL_SONAME_MAJOR_MINOR)"
XPS_DYNAMIC_LDFLAGS="-dynamiclib -install_name \$(XPS_SONAME_MAJOR_MINOR)"
@@ -2561,29 +2784,35 @@ else
DYNAMIC_LIBS=""
SO_LIB_EXT=".dylib"
;;
- SunOS)
+ *-sun*|*-solaris*)
if test $ac_cv_prog_gcc = yes; then
- DYNAMIC_CFLAGS="-fPIC"
+ DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
else
- DYNAMIC_CFLAGS="-KPIC"
+ DYNAMIC_CFLAGS="-KPIC $DYNAMIC_CFLAGS"
+ #if test x$hide_symbols = xyes; then
+ # attr_default="__global"
+ # attr_hidden="__hidden"
+ # _ldflags="-xldscope=hidden"
+ #fi
+ # ^^^ untested
fi
- GS_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
- PCL_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
- XPS_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR)"
- PDL_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GPDL_SONAME_MAJOR)"
+ GS_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR) $_ldflags"
+ PCL_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR) $_ldflags"
+ XPS_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(XPS_SONAME_MAJOR) $_ldflags"
+ PDL_DYNAMIC_LDFLAGS="-G -shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GPDL_SONAME_MAJOR) $_ldflags"
DYNAMIC_LIBS=""
SO_LIB_EXT=".so"
- ;;
- AIX)
+ ;;
+ *-aix*)
if test $ac_cv_prog_gcc = yes; then
- DYNAMIC_CFLAGS="-fPIC"
+ DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
GCFLAGS="-Wl,-brtl -D_LARGE_FILES $GCFLAGS"
GS_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
XPS_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
PDL_DYNAMIC_LDFLAGS="-shared -Wl,-brtl,-G -fPIC"
else
- DYNAMIC_CFLAGS=""
+ DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS"
GCFLAGS="-Wl,-brtl -D_LARGE_FILES $GCFLAGS"
GS_DYNAMIC_LDFLAGS="-G -qmkshrobj -Wl,-brtl,-G"
PCL_DYNAMIC_LDFLAGS="-G -qmkshrobj -Wl,-brtl,-G"
@@ -2591,48 +2820,73 @@ else
fi
SO_LIB_EXT=".so"
;;
- esac
+esac
+
+if test x$hide_symbols = xyes ; then
+ if test $ac_cv_prog_gcc = yes; then
+ DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -fvisibility=hidden"
+ fi
+ DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DGSDLLEXPORT=\"$attr_default\""
+ if test "x$FT_BRIDGE" = x1 -a "x$SHARE_FT" = x0 ; then
+ DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -D\"FT_EXPORT(x)\"=\"$attr_hidden x\""
+ fi
+ if test "x$SHARE_EXPAT" = x0 ; then
+ DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DXML_STATIC -DXMLIMPORT=\"$attr_hidden\""
+ fi
fi
+AC_SUBST(GS_SONAME)
+AC_SUBST(GS_SONAME_MAJOR)
+AC_SUBST(GS_SONAME_MAJOR_MINOR)
+AC_SUBST(PCL_SONAME)
+AC_SUBST(PCL_SONAME_MAJOR)
+AC_SUBST(PCL_SONAME_MAJOR_MINOR)
+AC_SUBST(XPS_SONAME)
+AC_SUBST(XPS_SONAME_MAJOR)
+AC_SUBST(XPS_SONAME_MAJOR_MINOR)
+AC_SUBST(GPDL_SONAME)
+AC_SUBST(GPDL_SONAME_MAJOR)
+AC_SUBST(GPDL_SONAME_MAJOR_MINOR)
+
AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic],
[Enable dynamically loaded drivers]),
[
if test "x$enable_dynamic" != xno; then
- case `uname` in
- Linux*|GNU*)
- INSTALL_SHARED="install-shared"
- if test "x$X_DEVS" != x; then
- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
- else
- DYNAMIC_DEVS=""
- fi
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- X11_DEVS=""
- OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
- DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
+ case $host in
+ *-linux*|*-gnu)
+ INSTALL_SHARED="install-shared"
+ if test "x$X_DEVS" != x; then
+ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
+ else
+ DYNAMIC_DEVS=""
+ fi
+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
+ X11_DEVS=""
+ OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
+ DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
;;
- *BSD)
- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- X11_DEVS=""
- OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
- DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
+ *bsd*)
+ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
+ X11_DEVS=""
+ OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
+ DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
;;
- Darwin*)
- INSTALL_SHARED="install-shared"
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- X11_DEVS=""
- OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
- DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
+ *-darwin*)
+ INSTALL_SHARED="install-shared"
+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
+ X11_DEVS=""
+ OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
+ DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
;;
- SunOS)
- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
- DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
+ *-sun*|*-solaris*)
+ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
+ OPT_CFLAGS="$DYNAMIC_CFLAGS $OPT_CFLAGS"
+ DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
;;
*)
- AC_MSG_ERROR([Sorry, dynamic driver support not available on this platform!])
+ AC_MSG_ERROR([Sorry, dynamic driver support not available on this platform!])
;;
esac
fi
@@ -2735,7 +2989,7 @@ dnl --------------------------------------------------
dnl disable the memory header ID code on SPARC
dnl --------------------------------------------------
-case `uname -a` in
+case $host in
*sparc*)
GCFLAGS="$GCFLAGS -DGS_USE_MEMORY_HEADER_ID=0"
;;
@@ -2812,19 +3066,13 @@ 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)
- GS_MEMPTR_ALIGNMENT=8
- ;;
- SunOS)
- GS_MEMPTR_ALIGNMENT=8
- ;;
- AIX)
- GS_MEMPTR_ALIGNMENT=8
- ;;
- esac
- fi
+ case $host in
+ *hpux*|*-sun*|*-aix*|*-solaris*)
+ GS_MEMPTR_ALIGNMENT=8
+ ;;
+ *)
+ ;;
+ esac
fi
if test x"$GS_MEMPTR_ALIGNMENT" = xcheck ; then
@@ -2948,12 +3196,9 @@ AC_SUBST(SUB_MAKE_OPTION)
# mingw, add the same prefix as the VS build uses
# --------------------------------------------------
AUXDIRPOSTFIX=""
-case `uname` in
- MINGW*|MSYS*)
+case $build in
+ *-mingw*|*-msys*|*-cygwin*)
AUXDIRPOSTFIX="_"
- if test x"$cross_compiling" != x"yes"; then
- CFLAGS="-DGS_NO_UTF8=1 $CFLAGS"
- fi
;;
esac
AC_SUBST(AUXDIRPOSTFIX)
@@ -2964,24 +3209,41 @@ AC_SUBST(AUXDIRPOSTFIX)
# --------------------------------------------------
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=])
+case $host in
+ *-mingw*|*-msys*|*-cygwin*)
+ EXEEXT=".exe"
+ ;;
+ *)
+ ;;
+esac
-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*)
- EXEEXT=".exe"
- ;;
- 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 $build in
+ *-mingw*|*-msys*|*-cygwin*)
+ AUXEXEEXT=".exe"
+ ;;
+ *)
+ ;;
+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(AUXEXEEXT)
+
+# --------------------------------------------------
# Check for disabling of versioned path option.
# By default the versioned path must be enabled!
# Using this option is user's own risk & responsibility.
@@ -3034,7 +3296,7 @@ fi
AC_SUBST(CLUSTER_CFLAGS)
-if test x"$CCAUX" != x"$CC"; then
+if test x"$build" != x"$host"; then
ilog2()
{
@@ -3054,6 +3316,7 @@ if test x"$CCAUX" != x"$CC"; then
AC_CHECK_ALIGNOF([short])
AC_CHECK_ALIGNOF([int])
AC_CHECK_ALIGNOF([long])
+ AC_CHECK_ALIGNOF([size_t])
AC_CHECK_ALIGNOF([void *])
AC_CHECK_ALIGNOF([float])
AC_CHECK_ALIGNOF([double])
@@ -3061,6 +3324,7 @@ if test x"$CCAUX" != x"$CC"; then
AC_SUBST(ARCH_ALIGN_SHORT_MOD, $ac_cv_alignof_short)
AC_SUBST(ARCH_ALIGN_INT_MOD, $ac_cv_alignof_int)
AC_SUBST(ARCH_ALIGN_LONG_MOD, $ac_cv_alignof_long)
+ AC_SUBST(ARCH_ALIGN_SIZE_T_MOD, $ac_cv_alignof_size_t)
AC_SUBST(ARCH_ALIGN_PTR_MOD, $ac_cv_alignof_void_p)
AC_SUBST(ARCH_ALIGN_FLOAT_MOD, $ac_cv_alignof_float)
AC_SUBST(ARCH_ALIGN_DOUBLE_MOD, $ac_cv_alignof_double)
@@ -3070,6 +3334,7 @@ if test x"$CCAUX" != x"$CC"; then
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
+ AC_CHECK_SIZEOF([size_t])
AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([float])
AC_CHECK_SIZEOF([double])
@@ -3089,6 +3354,10 @@ if test x"$CCAUX" != x"$CC"; then
ilog2 $ac_cv_sizeof_long_long
AC_SUBST(ARCH_LOG2_SIZEOF_LONG_LONG, $?)
+ ilog2 $ac_cv_sizeof_size_t
+ AC_SUBST(ARCH_LOG2_SIZEOF_SIZE_T, $?)
+ AC_SUBST(ARCH_SIZEOF_SIZE_T, $ac_cv_sizeof_size_t)
+
AC_SUBST(ARCH_SIZEOF_PTR, $ac_cv_sizeof_void_p)
ilog2 $ac_cv_sizeof_void_p
AC_SUBST(ARCH_LOG2_SIZEOF_PTR, $?)
@@ -3151,6 +3420,14 @@ if test x"$CCAUX" != x"$CC"; then
fi
dnl --------------------------------------------------
+dnl AUX tool options
+dnl --------------------------------------------------
+AC_ARG_ENABLE([mkromfs-quiet], AC_HELP_STRING([--enable-mkromfs-quiet],
+ [Do not emit mkromfs verbose output]), [MKROMFS_FLAGS="-q $MKROMFS_FLAGS"])
+
+AC_SUBST(MKROMFS_FLAGS)
+
+dnl --------------------------------------------------
dnl Do substitutions
dnl --------------------------------------------------
SRCDIR="$srcdir"
@@ -3170,11 +3447,11 @@ AC_SUBST(CFLAGSAUX_DEBUG)
AC_SUBST(CFLAGSAUX_PROFILE)
AC_SUBST(LDFLAGSAUX)
AC_SUBST(AUXEXTRALIBS)
-
+AC_SUBST(ARCH_AUTOCONF_HEADER)
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