073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.475
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.475
073263
Problem:    Can't compile on a system where Xutf8SetWMProperties() is not in
073263
	    the X11 library.  Issue 265.
073263
Solution:   Add a configure check.
073263
Files:	    src/configure.in, src/auto/configure, src/config.h.in,
073263
	    src/os_unix.c
073263
073263
073263
*** ../vim-7.4.474/src/configure.in	2014-08-17 17:05:39.159057796 +0200
073263
--- src/configure.in	2014-10-11 14:40:18.557274620 +0200
073263
***************
073263
*** 3730,3750 ****
073263
  dnl Check for multibyte locale functions
073263
  dnl Find out if _Xsetlocale() is supported by libX11.
073263
  dnl Check if X_LOCALE should be defined.
073263
! 
073263
! if test "$enable_multibyte" = "yes"; then
073263
    cflags_save=$CFLAGS
073263
!   ldflags_save=$LDFLAGS
073263
!   if test "x$x_includes" != "xNONE" ; then
073263
!     CFLAGS="$CFLAGS -I$x_includes"
073263
!     LDFLAGS="$X_LIBS $LDFLAGS -lX11"
073263
!     AC_MSG_CHECKING(whether X_LOCALE needed)
073263
!     AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
073263
! 	AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
073263
! 		AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
073263
! 	AC_MSG_RESULT(no))
073263
!   fi
073263
    CFLAGS=$cflags_save
073263
!   LDFLAGS=$ldflags_save
073263
  fi
073263
  
073263
  dnl Link with xpg4, it is said to make Korean locale working
073263
--- 3730,3753 ----
073263
  dnl Check for multibyte locale functions
073263
  dnl Find out if _Xsetlocale() is supported by libX11.
073263
  dnl Check if X_LOCALE should be defined.
073263
! if test "x$with_x" = "xyes"; then
073263
    cflags_save=$CFLAGS
073263
!   libs_save=$LIBS
073263
!   LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
073263
!   CFLAGS="$CFLAGS $X_CFLAGS"
073263
! 
073263
!   AC_MSG_CHECKING(whether X_LOCALE needed)
073263
!   AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
073263
!       AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
073263
! 	      AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
073263
!       AC_MSG_RESULT(no))
073263
! 
073263
!   AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used)
073263
!   AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes)
073263
! 	      AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no))
073263
! 
073263
    CFLAGS=$cflags_save
073263
!   LIBS=$libs_save
073263
  fi
073263
  
073263
  dnl Link with xpg4, it is said to make Korean locale working
073263
*** ../vim-7.4.474/src/auto/configure	2014-08-17 17:05:39.163057796 +0200
073263
--- src/auto/configure	2014-10-11 14:40:51.421274692 +0200
073263
***************
073263
*** 12732,12747 ****
073263
  fi
073263
  
073263
  
073263
! 
073263
! if test "$enable_multibyte" = "yes"; then
073263
    cflags_save=$CFLAGS
073263
!   ldflags_save=$LDFLAGS
073263
!   if test "x$x_includes" != "xNONE" ; then
073263
!     CFLAGS="$CFLAGS -I$x_includes"
073263
!     LDFLAGS="$X_LIBS $LDFLAGS -lX11"
073263
!     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
073263
  $as_echo_n "checking whether X_LOCALE needed... " >&6; }
073263
!     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
073263
  /* end confdefs.h.  */
073263
  #include <X11/Xlocale.h>
073263
  int
073263
--- 12732,12746 ----
073263
  fi
073263
  
073263
  
073263
! if test "x$with_x" = "xyes"; then
073263
    cflags_save=$CFLAGS
073263
!   libs_save=$LIBS
073263
!   LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
073263
!   CFLAGS="$CFLAGS $X_CFLAGS"
073263
! 
073263
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
073263
  $as_echo_n "checking whether X_LOCALE needed... " >&6; }
073263
!   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
073263
  /* end confdefs.h.  */
073263
  #include <X11/Xlocale.h>
073263
  int
073263
***************
073263
*** 12774,12780 ****
073263
  if ac_fn_c_try_link "$LINENO"; then :
073263
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
073263
  $as_echo "yes" >&6; }
073263
! 		$as_echo "#define X_LOCALE 1" >>confdefs.h
073263
  
073263
  else
073263
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
073263
--- 12773,12779 ----
073263
  if ac_fn_c_try_link "$LINENO"; then :
073263
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
073263
  $as_echo "yes" >&6; }
073263
! 	      $as_echo "#define X_LOCALE 1" >>confdefs.h
073263
  
073263
  else
073263
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
073263
***************
073263
*** 12787,12795 ****
073263
  $as_echo "no" >&6; }
073263
  fi
073263
  rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
073263
!   fi
073263
    CFLAGS=$cflags_save
073263
!   LDFLAGS=$ldflags_save
073263
  fi
073263
  
073263
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _xpg4_setrunelocale in -lxpg4" >&5
073263
--- 12786,12826 ----
073263
  $as_echo "no" >&6; }
073263
  fi
073263
  rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
073263
! 
073263
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xutf8SetWMProperties() can be used" >&5
073263
! $as_echo_n "checking whether Xutf8SetWMProperties() can be used... " >&6; }
073263
!   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
073263
! /* end confdefs.h.  */
073263
! 
073263
! /* Override any GCC internal prototype to avoid an error.
073263
!    Use char because int might match the return type of a GCC
073263
!    builtin and then its argument prototype would still apply.  */
073263
! #ifdef __cplusplus
073263
! extern "C"
073263
! #endif
073263
! char Xutf8SetWMProperties ();
073263
! int
073263
! main ()
073263
! {
073263
! return Xutf8SetWMProperties ();
073263
!   ;
073263
!   return 0;
073263
! }
073263
! _ACEOF
073263
! if ac_fn_c_try_link "$LINENO"; then :
073263
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
073263
! $as_echo "yes" >&6; }
073263
! 	      $as_echo "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h
073263
! 
073263
! else
073263
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
073263
! $as_echo "no" >&6; }
073263
! fi
073263
! rm -f core conftest.err conftest.$ac_objext \
073263
!     conftest$ac_exeext conftest.$ac_ext
073263
! 
073263
    CFLAGS=$cflags_save
073263
!   LIBS=$libs_save
073263
  fi
073263
  
073263
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _xpg4_setrunelocale in -lxpg4" >&5
073263
*** ../vim-7.4.474/src/config.h.in	2014-04-02 14:05:33.995887839 +0200
073263
--- src/config.h.in	2014-10-11 14:40:03.841274588 +0200
073263
***************
073263
*** 446,448 ****
073263
--- 446,451 ----
073263
  
073263
  /* Define if we have AvailabilityMacros.h on Mac OS X */
073263
  #undef HAVE_AVAILABILITYMACROS_H
073263
+ 
073263
+ /* Define if Xutf8SetWMProperties() is in an X library. */
073263
+ #undef HAVE_XUTF8SETWMPROPERTIES
073263
*** ../vim-7.4.474/src/os_unix.c	2014-08-29 12:58:38.242430208 +0200
073263
--- src/os_unix.c	2014-10-11 14:47:04.601275507 +0200
073263
***************
073263
*** 1960,1968 ****
073263
      return retval;
073263
  }
073263
  
073263
! /* Are Xutf8 functions available?  Avoid error from old compilers. */
073263
  #if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
073263
! # if X_HAVE_UTF8_STRING
073263
  #  define USE_UTF8_STRING
073263
  # endif
073263
  #endif
073263
--- 1960,1971 ----
073263
      return retval;
073263
  }
073263
  
073263
! /* Xutf8 functions are not avaialble on older systems. Note that on some
073263
!  * systems X_HAVE_UTF8_STRING may be defined in a header file but
073263
!  * Xutf8SetWMProperties() is not in the X11 library.  Configure checks for
073263
!  * that and defines HAVE_XUTF8SETWMPROPERTIES. */
073263
  #if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
073263
! # if X_HAVE_UTF8_STRING && HAVE_XUTF8SETWMPROPERTIES
073263
  #  define USE_UTF8_STRING
073263
  # endif
073263
  #endif
073263
*** ../vim-7.4.474/src/version.c	2014-10-11 12:48:22.541259950 +0200
073263
--- src/version.c	2014-10-11 14:42:47.821274946 +0200
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     475,
073263
  /**/
073263
073263
-- 
073263
hundred-and-one symptoms of being an internet addict:
073263
253. You wait for a slow loading web page before going to the toilet.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///