From b50e8d78f4b4b86177863a60bc85f5cd393ba04b Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Mon, 25 May 2009 08:58:23 +0000 Subject: better handling of fontconfig, using pkg-config git-svn-id: svn://tug.org/texlive/trunk@13457 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/configure | 11 + Build/source/configure.ac | 7 + Build/source/m4/cho-libs.m4 | 30 +-- Build/source/m4/kpse-fontconfig-flags.m4 | 23 +- Build/source/texk/xdvipdfmx/ChangeLog.TL | 4 + Build/source/texk/xdvipdfmx/Makefile.in | 4 + Build/source/texk/xdvipdfmx/aclocal.m4 | 1 + Build/source/texk/xdvipdfmx/config.h.in | 5 +- Build/source/texk/xdvipdfmx/configure | 392 ++++++++++++++++++++++------ Build/source/texk/xdvipdfmx/configure.ac | 8 +- Build/source/texk/xdvipdfmx/src/Makefile.am | 7 + Build/source/texk/xdvipdfmx/src/Makefile.in | 14 +- 12 files changed, 392 insertions(+), 114 deletions(-) (limited to 'Build') diff --git a/Build/source/configure b/Build/source/configure index e6ccae00f82..de7db370608 100755 --- a/Build/source/configure +++ b/Build/source/configure @@ -20247,6 +20247,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +## FIXME +if test "x$with_fontconfig" != x; then + { { $as_echo "$as_me:$LINENO: error: Sorry, the configure option \`--with-fontconfig' is no longer supported. + Either use \`--with-fontconfig-includes' and/or \`--with-fontconfig-libdir'. + or (preferably) use pkg-config, if necessary setting PKG_CONFIG." >&5 +$as_echo "$as_me: error: Sorry, the configure option \`--with-fontconfig' is no longer supported. + Either use \`--with-fontconfig-includes' and/or \`--with-fontconfig-libdir'. + or (preferably) use pkg-config, if necessary setting PKG_CONFIG." >&2;} + { (exit 1); exit 1; }; } +fi + if test "x$mandir" = 'x${datarootdir}/man'; then mandir='${prefix}/texmf/doc/man' ac_configure_args="$ac_configure_args '--mandir=$mandir'" diff --git a/Build/source/configure.ac b/Build/source/configure.ac index eca95c13906..5d418dae2c5 100644 --- a/Build/source/configure.ac +++ b/Build/source/configure.ac @@ -50,6 +50,13 @@ AC_PATH_XTRA AC_PROG_CXX +## FIXME +if test "x$with_fontconfig" != x; then + AC_MSG_ERROR([Sorry, the configure option `--with-fontconfig' is no longer supported. + Either use `--with-fontconfig-includes' and/or `--with-fontconfig-libdir'. + or (preferably) use pkg-config, if necessary setting PKG_CONFIG.]) +fi + if test "x$mandir" = 'x${datarootdir}/man'; then mandir='${prefix}/texmf/doc/man' ac_configure_args="$ac_configure_args '--mandir=$mandir'" diff --git a/Build/source/m4/cho-libs.m4 b/Build/source/m4/cho-libs.m4 index a6de533f8d1..f6addf6862d 100644 --- a/Build/source/m4/cho-libs.m4 +++ b/Build/source/m4/cho-libs.m4 @@ -70,26 +70,16 @@ AC_DEFUN([CHO_CHECK_LIBPAPER], # ----------------------- # Check for libfontconfig AC_DEFUN([CHO_CHECK_LIBFONTCONFIG], -[_cppflags=$CPPFLAGS _ldflags=$LDFLAGS - have_libfontconfig=no - AC_ARG_WITH([fontconfig], - [AS_HELP_STRING([--with-fontconfig=DIR],[use fontconfig include/library files from DIR])], - [if test -d "$withval"; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - FONTCONFIGLDFLAGS="-L$withval/lib" - fi]) - AC_MSG_CHECKING([for fontconfig header files]) - AC_TRY_COMPILE( - [#include ], - [FcObjectSet *os;], - [AC_MSG_RESULT(yes) - AC_SEARCH_LIBS([FcInit], [fontconfig], - [AC_DEFINE([HAVE_LIBFONTCONFIG], 1, [Define if you have libfontconfig]) - have_libfontconfig=yes])], - [CPPFLAGS=$_cppflags - LDDFLAGS=$_ldflags - AC_MSG_RESULT(no)]) +[AC_CACHE_CHECK([for fontconfig header files and library], + [cho_cv_have_fontconfig], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[FcObjectSet *os;]])], + [cho_cv_have_fontconfig=yes], + [cho_cv_have_fontconfig=no])]) +AS_IF([test "x$cho_cv_have_fontconfig" = xyes], + [AC_CHECK_FUNCS([FcInit], + [AC_DEFINE([HAVE_LIBFONTCONFIG], 1, + [Define if you have libfontconfig and its headers.])])]) ])# CHO_CHECK_LIBFONTCONFIG # CHO_CHECK_LIBFREETYPE(PACKAGE-NAME) diff --git a/Build/source/m4/kpse-fontconfig-flags.m4 b/Build/source/m4/kpse-fontconfig-flags.m4 index 4e869006ee3..681f1349692 100644 --- a/Build/source/m4/kpse-fontconfig-flags.m4 +++ b/Build/source/m4/kpse-fontconfig-flags.m4 @@ -17,16 +17,27 @@ # to the CPPFLAGS and LIBS required for the installed '-lfontconfig' # library and define HAVE_LIBFONTCONFIG. AC_DEFUN([KPSE_FONTCONFIG_FLAGS], -[AC_ARG_WITH([fontconfig], - AS_HELP_STRING([--with-fontconfig=DIR], - [use fontconfig include/library files from DIR]))[]dnl +[AC_REQUIRE([_KPSE_CHECK_PKG_CONFIG])[]dnl +AC_ARG_WITH([fontconfig-includes], + AS_HELP_STRING([--with-fontconfig-includes=DIR], + [fontconfig headers installed in DIR]))[]dnl +AC_ARG_WITH([fontconfig-libdir], + AS_HELP_STRING([--with-fontconfig-libdir=DIR], + [fontconfig library installed in DIR]))[]dnl AC_CACHE_CHECK([for installed fontconfig headers and library], [kpse_cv_have_fontconfig], [kpse_save_CPPFLAGS=$CPPFLAGS kpse_save_LIBS=$LIBS -if test "x$with_fontconfig" != x && test -d "$with_fontconfig"; then - kpse_cv_fontconfig_includes="-I$with_fontconfig/include" - kpse_cv_fontconfig_libs="-L$with_fontconfig/lib -lfontconfig" +if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then + if test "x$with_fontconfig_includes" != x; then + kpse_cv_fontconfig_includes="-I$with_fontconfig_includes" + fi + if test "x$with_fontconfig_libdir" != x; then + kpse_cv_fontconfig_libdir="-L$with_fontconfig_libdir -lfontconfig" + fi +elif $PKG_CONFIG fontconfig; then + kpse_cv_fontconfig_includes=`$PKG_CONFIG fontconfig --cflags` + kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs` else kpse_cv_fontconfig_includes= kpse_cv_fontconfig_libs='-lfontconfig' diff --git a/Build/source/texk/xdvipdfmx/ChangeLog.TL b/Build/source/texk/xdvipdfmx/ChangeLog.TL index ebf7babaf28..8b219260c22 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog.TL +++ b/Build/source/texk/xdvipdfmx/ChangeLog.TL @@ -1,6 +1,10 @@ ChangeLog.TL: Changes for xdvipdfmx (teTeX / TeX Live) ====================================================== +2009-05-25 Peter Breitenlohner + * configure.ac, src/Makefile.am: Do not use CPPFLAGS for + required -I flags, leave it for the user. + 2009-03-16 Peter Breitenlohner * src/cff.c, src/dpxutil.c, src/mem.c, src/pdfencoding.c, src/pdfencrypt.c: Must include Kpathsea headers (via `system.h') diff --git a/Build/source/texk/xdvipdfmx/Makefile.in b/Build/source/texk/xdvipdfmx/Makefile.in index 6caa7b0483e..e523b09a62f 100644 --- a/Build/source/texk/xdvipdfmx/Makefile.in +++ b/Build/source/texk/xdvipdfmx/Makefile.in @@ -52,6 +52,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-kpse.m4 \ $(top_srcdir)/../../m4/cho-libs.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-fontconfig-flags.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ @@ -147,6 +148,8 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FONTCONFIG_INCLUDES = @FONTCONFIG_INCLUDES@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE2_DEPEND = @FREETYPE2_DEPEND@ FREETYPE2_INCLUDES = @FREETYPE2_INCLUDES@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ @@ -187,6 +190,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/Build/source/texk/xdvipdfmx/aclocal.m4 b/Build/source/texk/xdvipdfmx/aclocal.m4 index d64dc5d8ff5..209ae0914af 100644 --- a/Build/source/texk/xdvipdfmx/aclocal.m4 +++ b/Build/source/texk/xdvipdfmx/aclocal.m4 @@ -992,6 +992,7 @@ AC_SUBST([am__untar]) m4_include([../../m4/cho-kpse.m4]) m4_include([../../m4/cho-libs.m4]) m4_include([../../m4/kpse-common.m4]) +m4_include([../../m4/kpse-fontconfig-flags.m4]) m4_include([../../m4/kpse-freetype2-flags.m4]) m4_include([../../m4/kpse-kpathsea-flags.m4]) m4_include([../../m4/kpse-libpng-flags.m4]) diff --git a/Build/source/texk/xdvipdfmx/config.h.in b/Build/source/texk/xdvipdfmx/config.h.in index 7db29be6c6c..02889af6ceb 100644 --- a/Build/source/texk/xdvipdfmx/config.h.in +++ b/Build/source/texk/xdvipdfmx/config.h.in @@ -44,6 +44,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `FcInit' function. */ +#undef HAVE_FCINIT + /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H @@ -68,7 +71,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if you have libfontconfig */ +/* Define if you have libfontconfig and its headers. */ #undef HAVE_LIBFONTCONFIG /* Define if you have libfreetype and its headers. */ diff --git a/Build/source/texk/xdvipdfmx/configure b/Build/source/texk/xdvipdfmx/configure index eac63fd06b9..de6ed75ebd5 100755 --- a/Build/source/texk/xdvipdfmx/configure +++ b/Build/source/texk/xdvipdfmx/configure @@ -789,8 +789,13 @@ ac_includes_default="\ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS +build_MacOsX_FALSE +build_MacOsX_TRUE build_FALSE build_TRUE +FONTCONFIG_LIBS +FONTCONFIG_INCLUDES +PKG_CONFIG TDS_VERSION_11_FALSE TDS_VERSION_11_TRUE FREETYPE2_RULE @@ -941,7 +946,8 @@ with_libpng_includes with_libpng_libdir with_system_freetype2 with_paper -with_fontconfig +with_fontconfig_includes +with_fontconfig_libdir ' ac_precious_vars='build_alias host_alias @@ -1616,7 +1622,10 @@ Optional Packages: --with-system-freetype2 use installed freetype2 headers and library (requires freetype-config) --with-paper=DIR use paper include/library files from DIR - --with-fontconfig=DIR use fontconfig include/library files from DIR + --with-fontconfig-includes=DIR + fontconfig headers installed in DIR + --with-fontconfig-libdir=DIR + fontconfig library installed in DIR Some influential environment variables: CC C compiler command @@ -4361,13 +4370,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4364: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4373: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4367: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4376: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4370: output\"" >&5) + (eval echo "\"\$as_me:4379: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5573,7 +5582,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5576 "configure"' > conftest.$ac_ext + echo '#line 5585 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7519,11 +7528,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7522: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7531: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7526: \$? = $ac_status" >&5 + echo "$as_me:7535: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7858,11 +7867,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7861: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7870: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7865: \$? = $ac_status" >&5 + echo "$as_me:7874: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7963,11 +7972,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7966: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7975: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7970: \$? = $ac_status" >&5 + echo "$as_me:7979: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8018,11 +8027,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8021: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8030: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8025: \$? = $ac_status" >&5 + echo "$as_me:8034: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10818,7 +10827,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10821 "configure" +#line 10830 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10914,7 +10923,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10917 "configure" +#line 10926 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18639,6 +18648,194 @@ _ACEOF fi +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PKG_CONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$PKG_CONFIG"; then + ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +PKG_CONFIG=$ac_cv_prog_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_PKG_CONFIG"; then + ac_ct_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_PKG_CONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_PKG_CONFIG"; then + ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG +if test -n "$ac_ct_PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5 +$as_echo "$ac_ct_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_PKG_CONFIG" = x; then + PKG_CONFIG="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_ct_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_prog_PKG_CONFIG" +fi + + +# Check whether --with-fontconfig-includes was given. +if test "${with_fontconfig_includes+set}" = set; then + withval=$with_fontconfig_includes; +fi + +# Check whether --with-fontconfig-libdir was given. +if test "${with_fontconfig_libdir+set}" = set; then + withval=$with_fontconfig_libdir; +fi +{ $as_echo "$as_me:$LINENO: checking for installed fontconfig headers and library" >&5 +$as_echo_n "checking for installed fontconfig headers and library... " >&6; } +if test "${kpse_cv_have_fontconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + kpse_save_CPPFLAGS=$CPPFLAGS +kpse_save_LIBS=$LIBS +if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then + if test "x$with_fontconfig_includes" != x; then + kpse_cv_fontconfig_includes="-I$with_fontconfig_includes" + fi + if test "x$with_fontconfig_libdir" != x; then + kpse_cv_fontconfig_libdir="-L$with_fontconfig_libdir -lfontconfig" + fi +elif $PKG_CONFIG fontconfig; then + kpse_cv_fontconfig_includes=`$PKG_CONFIG fontconfig --cflags` + kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs` +else + kpse_cv_fontconfig_includes= + kpse_cv_fontconfig_libs='-lfontconfig' +fi +CPPFLAGS="$kpse_cv_fontconfig_includes $CPPFLAGS" +LIBS="$kpse_cv_fontconfig_libs $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +FcObjectSet *os; FcInit(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + kpse_cv_have_fontconfig=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + kpse_cv_have_fontconfig=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $kpse_cv_have_fontconfig" >&5 +$as_echo "$kpse_cv_have_fontconfig" >&6; } +if test "x$kpse_cv_have_fontconfig" = xyes; then + FONTCONFIG_INCLUDES=$kpse_cv_fontconfig_includes + FONTCONFIG_LIBS=$kpse_cv_fontconfig_libs + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBFONTCONFIG 1 +_ACEOF + +fi + + if test "x$kpse_cv_have_ApplicationServices" = xyes; then build=yes @@ -18647,23 +18844,16 @@ cat >>confdefs.h <<\_ACEOF #define XETEX_MAC 1 _ACEOF - LIBS="$LIBS -framework ApplicationServices" else - _cppflags=$CPPFLAGS _ldflags=$LDFLAGS - have_libfontconfig=no - -# Check whether --with-fontconfig was given. -if test "${with_fontconfig+set}" = set; then - withval=$with_fontconfig; if test -d "$withval"; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - FONTCONFIGLDFLAGS="-L$withval/lib" - fi -fi + CPPFLAGS="$CPPFLAGS $FONTCONFIG_INCLUDES" +LIBS="$FONTCONFIG_LIBS $LIBS" - { $as_echo "$as_me:$LINENO: checking for fontconfig header files" >&5 -$as_echo_n "checking for fontconfig header files... " >&6; } - cat >conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:$LINENO: checking for fontconfig header files and library" >&5 +$as_echo_n "checking for fontconfig header files and library... " >&6; } +if test "${cho_cv_have_fontconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -18678,15 +18868,15 @@ FcObjectSet *os; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18695,21 +18885,56 @@ $as_echo "$ac_try_echo") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:$LINENO: checking for library containing FcInit" >&5 -$as_echo_n "checking for library containing FcInit... " >&6; } -if test "${ac_cv_search_FcInit+set}" = set; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + cho_cv_have_fontconfig=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cho_cv_have_fontconfig=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $cho_cv_have_fontconfig" >&5 +$as_echo "$cho_cv_have_fontconfig" >&6; } +if test "x$cho_cv_have_fontconfig" = xyes; then + +for ac_func in FcInit +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -18717,23 +18942,23 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char FcInit (); +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -return FcInit (); +return $ac_func (); ; return 0; } _ACEOF -for ac_lib in '' fontconfig; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -18754,55 +18979,43 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - ac_cv_search_FcInit=$ac_res + eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_FcInit+set}" = set; then - break -fi -done -if test "${ac_cv_search_FcInit+set}" = set; then - : -else - ac_cv_search_FcInit=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_FcInit" >&5 -$as_echo "$ac_cv_search_FcInit" >&6; } -ac_res=$ac_cv_search_FcInit -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_LIBFONTCONFIG 1 _ACEOF - have_libfontconfig=yes fi +done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CPPFLAGS=$_cppflags - LDDFLAGS=$_ldflags - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - build=$have_libfontconfig + CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS + + build=$cho_cv_have_fontconfig fi if test "x$build" = xyes; then @@ -18829,6 +19042,14 @@ else build_FALSE= fi + if test "x$kpse_cv_have_ApplicationServices" = xyes; then + build_MacOsX_TRUE= + build_MacOsX_FALSE='#' +else + build_MacOsX_TRUE='#' + build_MacOsX_FALSE= +fi + ac_config_files="$ac_config_files Makefile src/Makefile" @@ -18974,6 +19195,13 @@ $as_echo "$as_me: error: conditional \"build\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${build_MacOsX_TRUE}" && test -z "${build_MacOsX_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"build_MacOsX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"build_MacOsX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 diff --git a/Build/source/texk/xdvipdfmx/configure.ac b/Build/source/texk/xdvipdfmx/configure.ac index db6fd5ee46e..d021e90c2b7 100644 --- a/Build/source/texk/xdvipdfmx/configure.ac +++ b/Build/source/texk/xdvipdfmx/configure.ac @@ -74,14 +74,15 @@ fi dnl Check for additional libraries. KPSE_CHECK_FRAMEWORK([ApplicationServices], [ATSFontRef fontRef]) - +KPSE_FONTCONFIG_FLAGS if test "x$kpse_cv_have_ApplicationServices" = xyes; then build=yes AC_DEFINE([XETEX_MAC], 1, [Define if part of a teTeX/TeX Live build for Mac OS X.]) - LIBS="$LIBS -framework ApplicationServices" else + KPSE_ADD_FLAGS([fontconfig]) CHO_CHECK_LIBFONTCONFIG - build=$have_libfontconfig + KPSE_RESTORE_FLAGS + build=$cho_cv_have_fontconfig fi if test "x$build" = xyes; then @@ -93,6 +94,7 @@ or the fontconfig library (on other platforms) to be available, otherwise it cannot support XeTeX output using standard system-installed fonts.]) fi AM_CONDITIONAL([build], [test "x$build" = xyes]) +AM_CONDITIONAL([build_MacOsX], [test "x$kpse_cv_have_ApplicationServices" = xyes]) AC_CONFIG_FILES([Makefile src/Makefile]) diff --git a/Build/source/texk/xdvipdfmx/src/Makefile.am b/Build/source/texk/xdvipdfmx/src/Makefile.am index 69e2224e89a..e022614adb0 100644 --- a/Build/source/texk/xdvipdfmx/src/Makefile.am +++ b/Build/source/texk/xdvipdfmx/src/Makefile.am @@ -33,6 +33,13 @@ xdvipdfmx_DEPENDENCIES = $(KPATHSEA_DEPEND) $(FREETYPE2_DEPEND) $(LIBPNG_DEPEND) LDADD = $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) +if build_MacOsX +AM_LDFLAGS = -framework ApplicationServices +else !build_MacOsX +INCLUDES += $(FONTCONFIG_INCLUDES) +LDADD += $(FONTCONFIG_LIBS) +endif !build_MacOsX + ## Rebuild libkpathsea @KPATHSEA_RULE@ ## Rebuild libfreetype diff --git a/Build/source/texk/xdvipdfmx/src/Makefile.in b/Build/source/texk/xdvipdfmx/src/Makefile.in index 61f193c54c5..3520c4bb0b8 100644 --- a/Build/source/texk/xdvipdfmx/src/Makefile.in +++ b/Build/source/texk/xdvipdfmx/src/Makefile.in @@ -35,12 +35,15 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xdvipdfmx$(EXEEXT) +@build_MacOsX_FALSE@am__append_1 = $(FONTCONFIG_INCLUDES) +@build_MacOsX_FALSE@am__append_2 = $(FONTCONFIG_LIBS) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-kpse.m4 \ $(top_srcdir)/../../m4/cho-libs.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-fontconfig-flags.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ @@ -87,6 +90,7 @@ am_xdvipdfmx_OBJECTS = agl.$(OBJEXT) agl_standard.$(OBJEXT) \ xdvipdfmx_OBJECTS = $(am_xdvipdfmx_OBJECTS) xdvipdfmx_LDADD = $(LDADD) am__DEPENDENCIES_1 = +@build_MacOsX_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp am__depfiles_maybe = depfiles @@ -128,6 +132,8 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FONTCONFIG_INCLUDES = @FONTCONFIG_INCLUDES@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE2_DEPEND = @FREETYPE2_DEPEND@ FREETYPE2_INCLUDES = @FREETYPE2_INCLUDES@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ @@ -168,6 +174,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -229,7 +236,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -INCLUDES = $(KPATHSEA_INCLUDES) $(FREETYPE2_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) +INCLUDES = $(KPATHSEA_INCLUDES) $(FREETYPE2_INCLUDES) \ + $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(am__append_1) AM_CPPFLAGS = xdvipdfmx_SOURCES = \ agl.c agl_standard.c bmpimage.c cff.c cff_dict.c cid.c cidtype0.c cidtype2.c \ @@ -257,7 +265,9 @@ xdvipdfmx_SOURCES = \ unicode.h vf.h xbb.h xdvipdfmx_DEPENDENCIES = $(KPATHSEA_DEPEND) $(FREETYPE2_DEPEND) $(LIBPNG_DEPEND) $(ZLIB_DEPEND) -LDADD = $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) +LDADD = $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) \ + $(am__append_2) +@build_MacOsX_TRUE@AM_LDFLAGS = -framework ApplicationServices EXTRA_DIST = mk_agl_standard_c.pl Makefile.am.orig all: all-am -- cgit v1.2.3