diff options
-rw-r--r-- | Build/source/texk/xdvik/ChangeLog | 8 | ||||
-rwxr-xr-x | Build/source/texk/xdvik/configure | 28 | ||||
-rw-r--r-- | Build/source/texk/xdvik/encodings.c | 4 | ||||
-rw-r--r-- | Build/source/texk/xdvik/m4/xdvi-xinput-2-1.m4 | 25 | ||||
-rw-r--r-- | Build/source/texk/xdvik/translations.h | 1 | ||||
-rw-r--r-- | Build/source/texk/xdvik/xdvi.h | 4 |
6 files changed, 48 insertions, 22 deletions
diff --git a/Build/source/texk/xdvik/ChangeLog b/Build/source/texk/xdvik/ChangeLog index ad44fa255c3..1ee7d107bf1 100644 --- a/Build/source/texk/xdvik/ChangeLog +++ b/Build/source/texk/xdvik/ChangeLog @@ -1,3 +1,11 @@ +2014-06-23 Peter Breitenlohner <peb@mppmu.mpg.de> + + * encodings.c: Do not compile close_iconv() when not used. + * translations.h: Do not #include "c-auto.h". + * xdvi.h: Do not #include "c-auto.h" and "kpathsea/c-auto.h". + + * m4/xdvi-xinput-2-1.m4: Test link instead of compile step. + 2014-06-19 Peter Breitenlohner <peb@mppmu.mpg.de> * ft.c, gui/xaw_menu.c, hypertex.c: Avoid undefined behaviour diff --git a/Build/source/texk/xdvik/configure b/Build/source/texk/xdvik/configure index e9061a8b3e3..4112ea92b58 100755 --- a/Build/source/texk/xdvik/configure +++ b/Build/source/texk/xdvik/configure @@ -15286,27 +15286,37 @@ $as_echo_n "checking for XInput version 2.1 or higher... " >&6; } if ${xdvi_cv_xinput_2_1+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + xdvi_xi2_save_LIBS=$LIBS +xdvi_xi2_save_CFLAGS=$CFLAGS +xdvi_xi2_save_CPPFLAGS=$CPPFLAGS +xdvi_xi2_save_LDFLAGS=$LDFLAGS +LIBS="$X_PRE_LIBS -lXi $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <X11/extensions/XI2.h> - +#include <X11/extensions/XInput2.h> int main () { -#if (XI_2_Major < 2 || (XI_2_Major == 2 && XI_2_Minor < 1)) -choke me "XInput version is < 2.1" -#endif - +Display *DISP; int ndevices; +XIDeviceInfo *info = XIQueryDevice(DISP, XIAllDevices, &ndevices); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : xdvi_cv_xinput_2_1=yes else xdvi_cv_xinput_2_1=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$xdvi_xi2_save_LIBS +CFLAGS=$xdvi_xi2_save_CFLAGS +CPPFLAGS=$xdvi_xi2_save_CPPFLAGS +LDFLAGS=$xdvi_xi2_save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xdvi_cv_xinput_2_1" >&5 $as_echo "$xdvi_cv_xinput_2_1" >&6; } diff --git a/Build/source/texk/xdvik/encodings.c b/Build/source/texk/xdvik/encodings.c index b7ee14859fe..0ab172974ef 100644 --- a/Build/source/texk/xdvik/encodings.c +++ b/Build/source/texk/xdvik/encodings.c @@ -3012,17 +3012,17 @@ unicode_id_cmp(const void *s1, const void *s2) } #endif /* 0 */ +#if HAVE_ICONV_H static void close_iconv(void *dummy) { UNUSED(dummy); -#if HAVE_ICONV_H if (m_iconv_gb_ucs4 != (iconv_t)(-1)) { iconv_close(m_iconv_gb_ucs4); m_iconv_gb_ucs4 = (iconv_t)(-1); } -#endif /* HAVE_ICONV_H */ } +#endif /* HAVE_ICONV_H */ /* convert a CJK char to unicode (UCS-4) using iconv() */ static uint32_t diff --git a/Build/source/texk/xdvik/m4/xdvi-xinput-2-1.m4 b/Build/source/texk/xdvik/m4/xdvi-xinput-2-1.m4 index 7cb9b6d45f0..d7fbe009a96 100644 --- a/Build/source/texk/xdvik/m4/xdvi-xinput-2-1.m4 +++ b/Build/source/texk/xdvik/m4/xdvi-xinput-2-1.m4 @@ -22,13 +22,24 @@ AS_CASE([$enable_xi2_scrolling], [enable_xi2_scrolling=yes])]) if test "x$enable_xi2_scrolling" = xyes; then AC_CACHE_CHECK([for XInput version 2.1 or higher], -xdvi_cv_xinput_2_1, -[AC_TRY_COMPILE( -[#include <X11/extensions/XI2.h> -], [#if (XI_2_Major < 2 || (XI_2_Major == 2 && XI_2_Minor < 1)) -choke me "XInput version is < 2.1" -#endif -], xdvi_cv_xinput_2_1=yes, xdvi_cv_xinput_2_1=no)]) + [xdvi_cv_xinput_2_1], [dnl +xdvi_xi2_save_LIBS=$LIBS +xdvi_xi2_save_CFLAGS=$CFLAGS +xdvi_xi2_save_CPPFLAGS=$CPPFLAGS +xdvi_xi2_save_LDFLAGS=$LDFLAGS +LIBS="$X_PRE_LIBS -lXi $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XInput2.h>]], + [[Display *DISP; int ndevices; +XIDeviceInfo *info = XIQueryDevice(DISP, XIAllDevices, &ndevices);]])], + [xdvi_cv_xinput_2_1=yes], + [xdvi_cv_xinput_2_1=no]) +LIBS=$xdvi_xi2_save_LIBS +CFLAGS=$xdvi_xi2_save_CFLAGS +CPPFLAGS=$xdvi_xi2_save_CPPFLAGS +LDFLAGS=$xdvi_xi2_save_LDFLAGS]) if test "x$xdvi_cv_xinput_2_1" = xyes; then AC_DEFINE([HAVE_XI21], 1, [Define if your system has XInput version 2.1 or higher.]) diff --git a/Build/source/texk/xdvik/translations.h b/Build/source/texk/xdvik/translations.h index a78664bb93b..8d26b91029b 100644 --- a/Build/source/texk/xdvik/translations.h +++ b/Build/source/texk/xdvik/translations.h @@ -1,5 +1,4 @@ /* key translations */ -#include "c-auto.h" #include "xdvi.h" #include "version.h" diff --git a/Build/source/texk/xdvik/xdvi.h b/Build/source/texk/xdvik/xdvi.h index bd6542be223..3b0600cc8ea 100644 --- a/Build/source/texk/xdvik/xdvi.h +++ b/Build/source/texk/xdvik/xdvi.h @@ -35,10 +35,8 @@ in xdvi.c. /* headers used by all modules */ #include "xdvi-debug.h" -#include "c-auto.h" -#include "kpathsea/c-auto.h" /* kpathsea definitions */ -#include "kpathsea/config.h" +#include "kpathsea/config.h" /* kpathsea definitions */ /******************************** * The C environment * |