diff options
author | Taeksu Shin <taeksu.shin@samsung.com> | 2012-08-21 18:36:42 +0900 |
---|---|---|
committer | Taeksu Shin <taeksu.shin@samsung.com> | 2012-08-21 23:08:18 +0900 |
commit | 9d2e0d37024d200485b11abb0c3e096c8362415f (patch) | |
tree | 0022a2792694be16e92dfe15c425cce7d4644a3b /config-scripts | |
parent | 852f0c1a47542e29c183b3f64a43f43a01ea0c92 (diff) | |
download | cups-filters-9d2e0d37024d200485b11abb0c3e096c8362415f.tar.gz cups-filters-9d2e0d37024d200485b11abb0c3e096c8362415f.tar.bz2 cups-filters-9d2e0d37024d200485b11abb0c3e096c8362415f.zip |
Code sync
Diffstat (limited to 'config-scripts')
-rw-r--r-- | config-scripts/cups-common.m4 | 125 | ||||
-rw-r--r-- | config-scripts/cups-compiler.m4 | 127 | ||||
-rw-r--r-- | config-scripts/cups-directories.m4 | 47 | ||||
-rw-r--r-- | config-scripts/cups-image.m4 | 92 | ||||
-rw-r--r-- | config-scripts/cups-largefile.m4 | 52 | ||||
-rw-r--r-- | config-scripts/cups-libtool.m4 | 37 | ||||
-rw-r--r-- | config-scripts/cups-opsys.m4 | 35 | ||||
-rw-r--r-- | config-scripts/cups-pdf-filters.m4 | 256 | ||||
-rw-r--r-- | config-scripts/cups-pdf.m4 | 164 | ||||
-rw-r--r-- | config-scripts/cups-scripting.m4 | 34 | ||||
-rw-r--r-- | config-scripts/cups-sharedlibs.m4 | 109 |
11 files changed, 1078 insertions, 0 deletions
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 new file mode 100644 index 0000000..ed1b37b --- /dev/null +++ b/config-scripts/cups-common.m4 @@ -0,0 +1,125 @@ +dnl +dnl "$Id$" +dnl +dnl Common configuration stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl We need at least autoconf 2.60... +AC_PREREQ(2.60) + +dnl Set the name of the config header file... +AC_CONFIG_HEADER(config.h) + +dnl Version number information... +CUPSFILTERS_VERSION="1.0.18" +AC_SUBST(CUPSFILTERS_VERSION) +AC_DEFINE_UNQUOTED(CUPSFILTERS_SVERSION, "cups-filters v$CUPSFILTERS_VERSION") + +dnl version of installed CUPS +CUPS_VERSION=`cups-config --version` + +dnl Default compiler flags... +CFLAGS="${CFLAGS:=}" +CPPFLAGS="${CPPFLAGS:=}" +LDFLAGS="${LDFLAGS:=}" + +dnl Look for CUPS... +AC_PATH_PROG(CUPSCONFIG,cups-config) +if test "x$CUPSCONFIG" = x; then + AC_MSG_ERROR(Required cups-config is missing. Please install CUPS developer packages.) +fi + +CFLAGS="$CFLAGS `cups-config --cflags`" +LDFLAGS="$LDFLAGS `cups-config --ldflags`" +LINKCUPS="`cups-config --image --libs`" +AC_SUBST(LINKCUPS) + +dnl Checks for programs... +AC_PROG_AWK +AC_PROG_CC +AC_PROG_CPP +AC_PROG_RANLIB +AC_PATH_PROG(AR,ar) +AC_PATH_PROG(CHMOD,chmod) +AC_PATH_PROG(LD,ld) +AC_PATH_PROG(LN,ln) +AC_PATH_PROG(MV,mv) +AC_PATH_PROG(RM,rm) +AC_PATH_PROG(RMDIR,rmdir) +AC_PATH_PROG(SED,sed) +AC_PATH_PROG(GS,gs) +AC_PATH_PROG(PS2PS,ps2ps) +AC_PATH_PROG(PDF2PS,pdf2ps) + +AC_MSG_CHECKING(for install-sh script) +INSTALL="`pwd`/install-sh" +AC_SUBST(INSTALL) +AC_MSG_RESULT(using $INSTALL) + +if test "x$AR" = x; then + AC_MSG_ERROR([Unable to find required library archive command.]) +fi +if test "x$CC" = x; then + AC_MSG_ERROR([Unable to find required C compiler command.]) +fi + +dnl Check for pkg-config, which is used for some other tests later on... +AC_PATH_PROG(PKG_CONFIG, pkg-config) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H)) + +dnl Checks for string functions. +AC_CHECK_FUNCS(strdup strlcat strlcpy) + +dnl Check for random number functions... +AC_CHECK_FUNCS(random lrand48 arc4random) + +dnl Checks for signal functions. +case "$uname" in + Linux | GNU) + # Do not use sigset on Linux or GNU HURD + ;; + *) + # Use sigset on other platforms, if available + AC_CHECK_FUNCS(sigset) + ;; +esac + +AC_CHECK_FUNCS(sigaction) + +dnl Checks for wait functions. +AC_CHECK_FUNCS(waitpid wait3) + +dnl Flags for "ar" command... +case $uname in + Darwin* | *BSD*) + ARFLAGS="-rcv" + ;; + *) + ARFLAGS="crvs" + ;; +esac + +AC_SUBST(ARFLAGS) + +dnl Libraries needed by backends... +BACKLIBS="" +if test $uname = Darwin; then + BACKLIBS="-framework IOKit -framework CoreFoundation" +fi +AC_SUBST(BACKLIBS) + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 new file mode 100644 index 0000000..94194c7 --- /dev/null +++ b/config-scripts/cups-compiler.m4 @@ -0,0 +1,127 @@ +dnl +dnl "$Id$" +dnl +dnl Compiler stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl Clear the debugging and non-shared library options unless the user asks +dnl for them... +INSTALL_STRIP="" +OPTIM="" +AC_SUBST(INSTALL_STRIP) +AC_SUBST(OPTIM) + +AC_ARG_WITH(optim, [ --with-optim set optimization flags ]) +AC_ARG_ENABLE(debug, [ --enable-debug build with debugging symbols]) + +dnl For debugging, keep symbols, otherwise strip them... +if test x$enable_debug = xyes; then + OPTIM="-g" +else + INSTALL_STRIP="-s" +fi + +dnl Read-only data/program support on Linux... +AC_ARG_ENABLE(relro, [ --enable-relro build with the GCC relro option]) + +dnl Update compiler options... +PIEFLAGS="" +AC_SUBST(PIEFLAGS) + +RELROFLAGS="" +AC_SUBST(RELROFLAGS) + +PHPOPTIONS="" +AC_SUBST(PHPOPTIONS) + +if test -n "$GCC"; then + # Add GCC-specific compiler options... + if test -z "$OPTIM"; then + if test "x$with_optim" = x; then + # Default to optimize-for-size and debug + OPTIM="-Os -g" + else + OPTIM="$with_optim $OPTIM" + fi + fi + + # Generate position-independent code as needed... + if test $PICFLAG = 1 -a $uname != AIX; then + OPTIM="-fPIC $OPTIM" + fi + + # The -fstack-protector option is available with some versions of + # GCC and adds "stack canaries" which detect when the return address + # has been overwritten, preventing many types of exploit attacks. + AC_MSG_CHECKING(if GCC supports -fstack-protector) + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fstack-protector" + AC_TRY_LINK(,, + OPTIM="$OPTIM -fstack-protector" + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + CFLAGS="$OLDCFLAGS" + + # The -fPIE option is available with some versions of GCC and adds + # randomization of addresses, which avoids another class of exploits + # that depend on a fixed address for common functions. + AC_MSG_CHECKING(if GCC supports -fPIE) + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fPIE" + AC_TRY_COMPILE(,, + [case "$CC" in + *clang) + PIEFLAGS="-fPIE -Wl,-pie" + ;; + *) + PIEFLAGS="-fPIE -pie" + ;; + esac + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) + CFLAGS="$OLDCFLAGS" + + if test "x$with_optim" = x; then + # Add useful warning options for tracking down problems... + OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM" + + # Additional warning options for development testing... + if test -d .svn; then + OPTIM="-Wshadow $OPTIM" + CFLAGS="-Werror-implicit-function-declaration $CFLAGS" + PHPOPTIONS="-Wno-shadow" + #else + #AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare) + #OLDCFLAGS="$CFLAGS" + #CFLAGS="$CFLAGS -Werror -Wno-tautological-compare" + #AC_TRY_COMPILE(,, + # [OPTIM="$OPTIM -Wno-tautological-compare" + # AC_MSG_RESULT(yes)], + # AC_MSG_RESULT(no)) + #CFLAGS="$OLDCFLAGS" + fi + fi + + # The -z relro option is provided by the Linux linker command to + # make relocatable data read-only. + if test x$enable_relro = xyes; then + RELROFLAGS="-Wl,-z,relro" + fi + + # glibc 2.8 and higher breaks peer credentials unless you + # define _GNU_SOURCE... + OPTIM="$OPTIM -D_GNU_SOURCE" +fi + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4 new file mode 100644 index 0000000..13dea08 --- /dev/null +++ b/config-scripts/cups-directories.m4 @@ -0,0 +1,47 @@ +dnl +dnl "$Id$" +dnl +dnl Directory stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +AC_PREFIX_DEFAULT(/) + +dnl Fix "prefix" variable if it hasn't been specified... +if test "$prefix" = "NONE"; then + prefix="/" +fi + +dnl Fix "exec_prefix" variable if it hasn't been specified... +if test "$exec_prefix" = "NONE"; then + if test "$prefix" = "/"; then + exec_prefix="/usr" + else + exec_prefix="$prefix" + fi +fi + +dnl Setup CUPS locations... +CUPS_DATADIR="`$CUPSCONFIG --datadir`" +AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR") +AC_SUBST(CUPS_DATADIR) + +CUPS_FONTPATH="$CUPS_DATADIR/fonts" +AC_SUBST(CUPS_FONTPATH) +AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH") + +CUPS_SERVERBIN="`$CUPSCONFIG --serverbin`" +AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN") +AC_SUBST(CUPS_SERVERBIN) + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-image.m4 b/config-scripts/cups-image.m4 new file mode 100644 index 0000000..00ce61f --- /dev/null +++ b/config-scripts/cups-image.m4 @@ -0,0 +1,92 @@ +dnl +dnl "$Id$" +dnl +dnl Image library/filter stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2006 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl See if we want the image filters included at all... +AC_ARG_ENABLE(image, [ --enable-image always build the image filters]) + +IMGFILTERS="" +if test "x$enable_image" != xno; then + IMGFILTERS="imagetops imagetoraster" +fi +AC_SUBST(IMGFILTERS) + +dnl Check for image libraries... +AC_ARG_ENABLE(jpeg, [ --disable-jpeg disable JPEG support]) +AC_ARG_ENABLE(png, [ --disable-png disable PNG support]) +AC_ARG_ENABLE(tiff, [ --disable-tiff disable TIFF support]) + +LIBJPEG="" +LIBPNG="" +LIBTIFF="" +LIBZ="" + +AC_SUBST(LIBJPEG) +AC_SUBST(LIBPNG) +AC_SUBST(LIBTIFF) +AC_SUBST(LIBZ) + +dnl Image libraries use math library functions... +AC_SEARCH_LIBS(pow, m) + +dnl Save the current libraries since we don't want the image libraries +dnl included with every program... +SAVELIBS="$LIBS" + +dnl JPEG library... +if test x$enable_jpeg != xno; then + AC_CHECK_HEADER(jpeglib.h, + AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, + AC_DEFINE(HAVE_LIBJPEG) + LIBJPEG="-ljpeg" + LIBS="$LIBS -ljpeg")) +else + AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.]) +fi + +dnl ZLIB library... +AC_CHECK_HEADER(zlib.h, + AC_CHECK_LIB(z, gzgets, + AC_DEFINE(HAVE_LIBZ) + LIBZ="-lz" + LIBS="$LIBS -lz")) + +dnl PNG library... +if test x$enable_png != xno; then + AC_CHECK_HEADER(png.h, + AC_CHECK_LIB(png, png_create_read_struct, + AC_DEFINE(HAVE_LIBPNG) + LIBPNG="-lpng")) +else + AC_MSG_NOTICE([PNG support disabled with --disable-png.]) +fi + +dnl TIFF library... +if test x$enable_tiff != xno; then + AC_CHECK_HEADER(tiff.h, + AC_CHECK_LIB(tiff, TIFFReadScanline, + AC_DEFINE(HAVE_LIBTIFF) + LIBTIFF="-ltiff")) +else + AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.]) +fi + +dnl Restore original LIBS settings... +LIBS="$SAVELIBS" + +AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H)) + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-largefile.m4 b/config-scripts/cups-largefile.m4 new file mode 100644 index 0000000..e8c8f71 --- /dev/null +++ b/config-scripts/cups-largefile.m4 @@ -0,0 +1,52 @@ +dnl +dnl "$Id$" +dnl +dnl Large file support stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl Check for largefile support... +AC_SYS_LARGEFILE + +dnl Define largefile options as needed... +LARGEFILE="" +if test x$enable_largefile != xno; then + LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" + + if test x$ac_cv_sys_large_files = x1; then + LARGEFILE="$LARGEFILE -D_LARGE_FILES" + fi + + if test x$ac_cv_sys_file_offset_bits = x64; then + LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64" + fi +fi +AC_SUBST(LARGEFILE) + +dnl Check for "long long" support... +AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, + [if test "$GCC" = yes; then + ac_cv_c_long_long=yes + else + AC_TRY_COMPILE(,[long long int i;], + ac_cv_c_long_long=yes, + ac_cv_c_long_long=no) + fi]) + +if test $ac_cv_c_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG) +fi + +AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL)) + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-libtool.m4 b/config-scripts/cups-libtool.m4 new file mode 100644 index 0000000..fbd1f04 --- /dev/null +++ b/config-scripts/cups-libtool.m4 @@ -0,0 +1,37 @@ +dnl +dnl "$Id$" +dnl +dnl Libtool stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported + build with libtool (UNSUPPORTED!)], + [if test x$enable_libtool_unsupported != xno; then + LIBTOOL="$enable_libtool_unsupported" + enable_shared=no + echo "WARNING: libtool is not supported or endorsed by Apple Inc." + echo " WE DO NOT PROVIDE SUPPORT FOR LIBTOOL PROBLEMS." + else + LIBTOOL="" + fi]) + +AC_SUBST(LIBTOOL) + +if test x$LIBTOOL != x; then + DSO="\$(CC)" + LIBCUPSFILTERS="libcupsfilters.la" + LINKCUPSFILTERS="../filter/\$(LIBCUPSFILTERS)" +fi + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-opsys.m4 b/config-scripts/cups-opsys.m4 new file mode 100644 index 0000000..dfa137e --- /dev/null +++ b/config-scripts/cups-opsys.m4 @@ -0,0 +1,35 @@ +dnl +dnl "$Id$" +dnl +dnl Operating system stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2006 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl Get the operating system, version number, and architecture... +uname=`uname` +uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'` +uarch=`uname -m` + +case "$uname" in + GNU* | GNU/*) + uname="GNU" + ;; + IRIX*) + uname="IRIX" + ;; + Linux*) + uname="Linux" + ;; +esac + +dnl +dnl "$Id$" +dnl diff --git a/config-scripts/cups-pdf-filters.m4 b/config-scripts/cups-pdf-filters.m4 new file mode 100644 index 0000000..a4a74b3 --- /dev/null +++ b/config-scripts/cups-pdf-filters.m4 @@ -0,0 +1,256 @@ +dnl Do we have CUPS 1.4 or newer? +if test "`echo $CUPS_VERSION | cut -d '.' -f 2`" -ge "4"; then + AC_DEFINE(CUPS_1_4, 1, [CUPS Version is 1.4 or newer]) +fi + +dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +dnl +dnl This macro sets VARNAME to the expansion of the DIR variable, +dnl taking care of fixing up ${prefix} and such. +dnl +dnl VARNAME is then offered as both an output variable and a C +dnl preprocessor symbol. +dnl +dnl Example: +dnl +dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +dnl +dnl @category Misc +dnl @author Stepan Kasal <kasal@ucw.cz> +dnl @author Andreas Schwab <schwab@suse.de> +dnl @author Guido Draheim <guidod@gmx.de> +dnl @author Alexandre Oliva +dnl @version 2005-07-29 +dnl @license AllPermissive + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) + +dnl General checks + +AC_HEADER_DIRENT +AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADERS([sys/stat.h]) +AC_CHECK_HEADERS([sys/types.h]) +AC_CHECK_HEADERS([unistd.h]) +AC_CHECK_HEADERS([zlib.h]) + +dnl Needed for pdftopdf filter compilation + +CXXFLAGS="-DPDFTOPDF $CXXFLAGS" + +dnl Color Management + +AC_ARG_ENABLE(cms, + AC_HELP_STRING([--disable-cms], + [Don't use color management system.]), + enable_cms=$enableval, + enable_cms="try") +if test x$enable_cms = xyes; then + PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no]) + if test x$lcms2 = xno; then + PKG_CHECK_MODULES(LCMS, lcms) + fi +elif test x$enable_cms = xtry; then + PKG_CHECK_MODULES(LCMS, lcms2,[lcms2=yes],[lcms2=no]) + if test x$lcms2 = xyes; then + enable_cms=yes + else + PKG_CHECK_MODULES(LCMS, lcms,[enable_cms=yes],[enable_cms=no]) + fi +fi + +if test "x$enable_cms" = "xyes"; then + LCMS_LIBS=-llcms2 + if test "x$lcms2" = "xno"; then + lcms1=yes; + AC_DEFINE(USE_LCMS1, 1, [Defines if use lcms1]) + LCMS_LIBS=-llcms + fi +fi +AC_SUBST(LCMS_LIBS) + +dnl Switch over to C++. +AC_LANG(C++) + +dnl check poppler +AC_CHECK_LIB(poppler,main, + [ POPPLER_LIBS=-lpoppler], + [ echo "*** poppler library not found. ***";exit ] +) +AC_SUBST(POPPLER_LIBS) + +dnl poppler source dir +AC_ARG_WITH([poppler-source],[ --with-poppler-source=PATH poppler source directory path], + [POPPLER_SRCDIR=$withval], + [POPPLER_SRCDIR=`eval echo $includedir`]) +AC_SUBST(POPPLER_SRCDIR) +if test $POPPLER_SRCDIR = `eval echo $includedir`;then + POPPLER_VERSION=`pkg-config --modversion poppler` + CPPFLAGS="$CPPFLAGS -I$POPPLER_SRCDIR/poppler" +else + POPPLER_LIBS=$POPPLER_SRCDIR/poppler/.libs/libpoppler.so + CPPFLAGS="$CPPFLAGS -I$POPPLER_SRCDIR/poppler -I$POPPLER_SRCDIR" + POPPLER_VERSION=`PKG_CONFIG_PATH=$POPPLER_SRCDIR pkg-config --modversion poppler` +fi + +dnl poppler version +POPPLER_VERSION_MAJOR=`echo $POPPLER_VERSION|awk -F. '{print $1;}'` +AC_DEFINE_UNQUOTED(POPPLER_VERSION_MAJOR,$POPPLER_VERSION_MAJOR) +POPPLER_VERSION_MINOR=`echo $POPPLER_VERSION|awk -F. '{print $2;}'` +AC_DEFINE_UNQUOTED(POPPLER_VERSION_MINOR,$POPPLER_VERSION_MINOR) +POPPLER_VERSION_MICRO=`echo $POPPLER_VERSION|awk -F. '{print $3;}'` +AC_DEFINE_UNQUOTED(POPPLER_VERSION_MICRO,$POPPLER_VERSION_MICRO) + +dnl Check for freetype headers +FREETYPE_LIBS= +FREETYPE_CFLAGS= + +PKG_CHECK_MODULES(FREETYPE, freetype2, + [freetype_pkgconfig=yes], [freetype_pkgconfig=no]) + +if test "x$freetype_pkgconfig" = "xyes"; then + + AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files]) + +else + + AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + if test "x$FREETYPE_CONFIG" != "xno" ; then + + FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags` + FREETYPE_LIBS=`$FREETYPE_CONFIG --libs` + AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files]) + + fi + +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +dnl check SplashFontEngin::SplashFontEngin interface +if test $POPPLER_SRCDIR = `eval echo $includedir`;then + SPLASH_HEADER_DIR=$POPPLER_SRCDIR/poppler/splash +else + SPLASH_HEADER_DIR=$POPPLER_SRCDIR/splash +fi +if grep "enableSlightHinting" $SPLASH_HEADER_DIR/SplashFontEngine.h >/dev/null ;then + AC_DEFINE([SPLASH_SLIGHT_HINTING],,[SplashFontEngine enableSlightHinting]) +fi + +dnl check if GlobalParams::GlobalParams has a argument +if grep "GlobalParams(char \*cfgFileName)" $POPPLER_SRCDIR/poppler/GlobalParams.h >/dev/null ;then + AC_DEFINE([GLOBALPARAMS_HAS_A_ARG],,[GlobalParams::GlobalParams has a argument.]) +fi + +dnl check if Parser:Parser has two arguments +if grep "Parser(XRef \*xrefA, Lexer \*lexerA)" $POPPLER_SRCDIR/poppler/Parser.h >/dev/null ;then + AC_DEFINE([PARSER_HAS_2_ARGS],,[Parser::Parser has two arguments.]) +fi + +dnl check font type enumeration +if grep "fontType1COT" $POPPLER_SRCDIR/poppler/GfxFont.h >/dev/null ;then + AC_DEFINE([FONTTYPE_ENUM2],,[New font type enumeration]) +fi + +dnl check Stream::getUndecodedStream +if grep "getUndecodedStream" $POPPLER_SRCDIR/poppler/Stream.h >/dev/null ;then + AC_DEFINE([HAVE_GETUNDECODEDSTREAM],,[Have Stream::getUndecodedStream]) +fi + +dnl check UGooString.h +AC_CHECK_HEADER(UGooString.h, + AC_DEFINE([HAVE_UGOOSTRING_H],,[Have UGooString.h]) +,) + +dnl check CharCodeToUnicode::mapToUnicode interface +if grep "mapToUnicode(.*Unicode[ ][ ]*\*u" $POPPLER_SRCDIR/poppler/CharCodeToUnicode.h >/dev/null ;then + AC_DEFINE([OLD_MAPTOUNICODE],,[Old CharCodeToUnicode::mapToUnicode]) +fi + +dnl check GfxColorSpace::parse interface +if grep "GfxColorSpace *\*parse(Object *\*csObj)" $POPPLER_SRCDIR/poppler/GfxState.h >/dev/null ;then + AC_DEFINE([OLD_CS_PARSE],,[Old GfxColorSpace::parse]) +fi + +dnl check new GfxFontType +if grep "fontType1C0T" $POPPLER_SRCDIR/poppler/GfxFont.h >/dev/null ;then + AC_DEFINE([HAVE_NEW_GFX_FONTTYPE],,[have new GfxFontType]) +fi + +dnl check if cms is available +if grep "setDisplayProfileName" $POPPLER_SRCDIR/poppler/GfxState.h >/dev/null ;then + if test "x$enable_cms" = "xyes"; then + AC_DEFINE([USE_CMS],,[cms is available]) + POPPLER_LIBS="$POPPLER_LIBS $LCMS_LIBS" + fi +fi + +AC_DEFINE_DIR(POPPLER_DATADIR, "{datarootdir}/poppler", [Poppler data dir]) + +dnl Switch back to C. +AC_LANG(C) + +dnl check ijs +AC_CHECK_LIB(ijs,main, + [ IJS_LIBS=-lijs], + [ echo "*** ijs library not found. ***";exit ] +) +AC_SUBST(IJS_LIBS) + +dnl Test whether pdftoopvp should use the system's zlib +AC_ARG_ENABLE([zlib], + [AS_HELP_STRING([--enable-zlib],[Build with zlib])], + [],[enable_zlib="no"]) +if test x$enable_zlib = xyes; then + AC_CHECK_LIB([z], [inflate],, + AC_MSG_ERROR("*** zlib library not found ***")) + AC_CHECK_HEADERS([zlib.h],, + AC_MSG_ERROR("*** zlib headers not found ***")) +elif test x$enable_zlib = xtry; then + AC_CHECK_LIB([z], [inflate], + [enable_zlib="yes"], + [enable_zlib="no"]) + AC_CHECK_HEADERS([zlib.h],, + [enable_zlib="no"]) +fi + +if test x$enable_zlib = xyes; then + ZLIB_LIBS="-lz" + AC_SUBST(ZLIB_LIBS) + AC_DEFINE(ENABLE_ZLIB) +fi + +AM_CONDITIONAL(BUILD_ZLIB, test x$enable_zlib = xyes) +AH_TEMPLATE([ENABLE_ZLIB], + [Use zlib instead of builtin zlib decoder.]) + +dnl Test whether pdftoopvp should use the system's libjpeg +AC_ARG_ENABLE(libjpeg, + AC_HELP_STRING([--disable-libjpeg], + [Don't build against libjpeg.]), + enable_libjpeg=$enableval, + enable_libjpeg="try") +if test x$enable_libjpeg != xno; then + POPPLER_FIND_JPEG +fi + +AM_CONDITIONAL(BUILD_LIBJPEG, test x$enable_libjpeg = xyes) +AH_TEMPLATE([ENABLE_LIBJPEG], + [Use libjpeg instead of builtin jpeg decoder.]) + +PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.0.0) + diff --git a/config-scripts/cups-pdf.m4 b/config-scripts/cups-pdf.m4 new file mode 100644 index 0000000..21dd70b --- /dev/null +++ b/config-scripts/cups-pdf.m4 @@ -0,0 +1,164 @@ +dnl +dnl "$Id$" +dnl +dnl PDF filter configuration stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 2006 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +AC_ARG_WITH(pdftops-renderer, [ --with-pdftops-renderer set default renderer for pdftops filter (gs,pdftops), default=gs ]) +AC_ARG_WITH(pdftops-maxres, [ --with-pdftops-maxres set default maximum image rendering resolution for pdftops filter (0, 75, 150, 300, 600, 1200, 2400, 4800, 90, 180, 360, 720, 1440, 2880, 5760, unlimited), default=1440 ]) +AC_ARG_WITH(ghostscript, [ --with-ghostscript set ghostscript path for pdftops filter (gs,/path/to/gs,none), default=gs ]) +AC_ARG_WITH(poppler-pdftops, [ --with-poppler-pdftops set Poppler pdftops path for pdftops filter (pdftops,/path/to/pdftops,none), default=pdftops ]) + +CUPS_PDFTOPS_RENDERER="" +CUPS_PDFTOPS_MAX_RESOLUTION="" +CUPS_POPPLER_PDFTOPS="" +CUPS_GHOSTSCRIPT="" + +case "x$with_ghostscript" in + x) # Default/auto + AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs) + if test "x$CUPS_GHOSTSCRIPT" != x; then + AC_DEFINE(HAVE_GHOSTSCRIPT) + fi + ;; + + xgs) + AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs) + if test "x$CUPS_GHOSTSCRIPT" != x; then + AC_DEFINE(HAVE_GHOSTSCRIPT) + else + AC_MSG_WARN(Unable to find gs program!) + fi + ;; + + x/*/gs) # Use /path/to/gs without any check: + CUPS_GHOSTSCRIPT="$with_ghostscript" + AC_DEFINE(HAVE_GHOSTSCRIPT) + ;; + + xno) # --without-ghostscript + ;; + + *) # Invalid with_ghostscript value + AC_MSG_ERROR(Invalid with-ghostscript value!) + exit 1 + ;; +esac + +case "x$with_poppler_pdftops" in + x) # Default/auto + AC_PATH_PROG(CUPS_POPPLER_PDFTOPS, pdftops) + if test "x$CUPS_POPPLER_PDFTOPS" != x; then + AC_DEFINE(HAVE_POPPLER_PDFTOPS) + fi + ;; + + xpdftops) + AC_PATH_PROG(CUPS_POPPLER_PDFTOPS, pdftops) + if test "x$CUPS_POPPLER_PDFTOPS" != x; then + AC_DEFINE(HAVE_POPPLER_PDFTOPS) + else + AC_MSG_WARN(Unable to find Poppler pdftops program!) + fi + ;; + + x/*/pdftops) # Use /path/to/pdftops without any check: + CUPS_POPPLER_PDFTOPS="$with_poppler_pdftops" + AC_DEFINE(HAVE_POPPLER_PDFTOPS) + ;; + + xno) # --without-poppler-pdftops + ;; + + *) # Invalid with_poppler-pdftops value + echo "$with_poppler_pdftops" + AC_MSG_ERROR(Invalid with-poppler-pdftops value!) + exit 1 + ;; +esac + +if test "x$CUPS_POPPLER_PDFTOPS" != x; then + AC_MSG_CHECKING(whether Poppler pdftops supports -origpagesizes) + if ($CUPS_POPPLER_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes); then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES) + else + AC_MSG_RESULT(no) + fi + + AC_MSG_CHECKING(whether Poppler pdftops supports -r) + if ($CUPS_POPPLER_PDFTOPS -h 2>&1 | grep -q -- '-r '); then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION) + else + AC_MSG_RESULT(no) + fi +fi +if test "x$CUPS_GHOSTSCRIPT" != x; then + AC_MSG_CHECKING(whether gs supports the ps2write device) + if ($CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write); then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GHOSTSCRIPT_PS2WRITE) + else + AC_MSG_RESULT(no) + fi +fi + +case "x$with_pdftops_renderer" in + x|xgs) # gs + CUPS_PDFTOPS_RENDERER=GS + if test "x$CUPS_GHOSTSCRIPT" = x; then + AC_MSG_WARN(Default renderer Ghostscript is not available!) + fi + ;; + + xpdftops) # pdftops + CUPS_PDFTOPS_RENDERER=PDFTOPS + if test "x$CUPS_POPPLER_PDFTOPS" = x; then + AC_MSG_WARN(Default renderer Poppler pdftops is not available!) + fi + ;; + + *) # Invalid with_pdftops-renderer value + AC_MSG_ERROR(Invalid with-pdftops-renderer value!) + exit 1 + ;; +esac + +case "x$with_pdftops_maxres" in + + x) + CUPS_PDFTOPS_MAXRES=1440 + ;; + + x75|x150|x300|x600|x1200|x2400|x4800|x90|x180|x360|x720|x1440|x2880|x5760) + CUPS_PDFTOPS_MAXRES=$with_pdftops_maxres + ;; + + x0|xunlimited|xno) + CUPS_PDFTOPS_MAXRES=0 + ;; + + *) # Invalid with_pdftops-renderer value + AC_MSG_ERROR(Invalid with-pdftops-maxres value!) + exit 1 + ;; +esac + +AC_DEFINE_UNQUOTED(CUPS_PDFTOPS_RENDERER, $CUPS_PDFTOPS_RENDERER) +AC_DEFINE_UNQUOTED(CUPS_PDFTOPS_MAX_RESOLUTION, $CUPS_PDFTOPS_MAXRES) +AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS") +AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT") + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-scripting.m4 b/config-scripts/cups-scripting.m4 new file mode 100644 index 0000000..e5e140c --- /dev/null +++ b/config-scripts/cups-scripting.m4 @@ -0,0 +1,34 @@ +dnl +dnl "$Id$" +dnl +dnl Scripting configuration stuff for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2006 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +dnl Do we have PHP? +AC_ARG_WITH(php, [ --with-php set PHP interpreter for web interfaces ], + CUPS_PHP="$withval", + CUPS_PHP="") + +PHPDIR="" +if test "x$CUPS_PHP" != xno; then + AC_PATH_PROG(PHPCONFIG, php-config) + + if test "x$PHPCONFIG" != x; then + PHPDIR="scripting/php" + fi +fi + +AC_SUBST(PHPDIR) + +dnl +dnl End of "$Id$". +dnl diff --git a/config-scripts/cups-sharedlibs.m4 b/config-scripts/cups-sharedlibs.m4 new file mode 100644 index 0000000..8c0d5eb --- /dev/null +++ b/config-scripts/cups-sharedlibs.m4 @@ -0,0 +1,109 @@ +dnl +dnl "$Id$" +dnl +dnl Shared library support for OpenPrinting CUPS Filters. +dnl +dnl Copyright 2007-2011 by Apple Inc. +dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +PICFLAG=1 +DSOFLAGS="${DSOFLAGS:=}" + +AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries]) + +if test x$enable_shared != xno; then + case "$uname" in + SunOS*) + LIBCUPSFILTERS="libcupsfilters.so.1" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)" + ;; + Linux | GNU | *BSD*) + LIBCUPSFILTERS="libcupsfilters.so.1" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" + ;; + Darwin*) + LIBCUPSFILTERS="libcupsfilters.1.dylib" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc" + ;; + *) + echo "Warning: shared libraries may not be supported. Trying -shared" + echo " option with compiler." + LIBCUPSFILTERS="libcupsfilters.so.1" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" + ;; + esac +else + PICFLAG=0 + LIBCUPSFILTERS="libcupsfilters.a" + DSO=":" +fi + +AC_SUBST(DSO) +AC_SUBST(DSOFLAGS) +AC_SUBST(LIBCUPSFILTERS) + +if test x$enable_shared = xno; then + LINKCUPSFILTERS="../cupsfilters/libcupsfilters.a" +else + LINKCUPSFILTERS="-L../cupsfilters -lcupsfilters" +fi + +AC_SUBST(LINKCUPSFILTERS) + +dnl Update libraries for DSOs... +if test "$DSO" != ":"; then + # When using DSOs the image libraries are linked to libcupsimage.so + # rather than to the executables. This makes things smaller if you + # are using any static libraries, and it also allows us to distribute + # a single DSO rather than a bunch... + DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" + IMGLIBS="" + + # Tell the run-time linkers where to find a DSO. Some platforms + # need this option, even when the library is installed in a + # standard location... + case $uname in + SunOS*) + # Solaris... + if test $exec_prefix != /usr; then + DSOFLAGS="-R$libdir $DSOFLAGS" + LDFLAGS="$LDFLAGS -R$libdir" + fi + ;; + *BSD*) + # *BSD... + if test $exec_prefix != /usr; then + DSOFLAGS="-Wl,-R$libdir $DSOFLAGS" + LDFLAGS="$LDFLAGS -Wl,-R$libdir" + fi + ;; + Linux | GNU) + # Linux and HURD... + if test $exec_prefix != /usr; then + DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS" + LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir" + fi + ;; + esac +else + DSOLIBS="" + IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" +fi + +AC_SUBST(DSOLIBS) +AC_SUBST(IMGLIBS) + +dnl +dnl End of "$Id$". +dnl |