3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.2
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.254
3ef2ca
Problem:    Smack support detection is incomplete.
3ef2ca
Solution:   Check for attr/xattr.h and specific macro.
3ef2ca
Files:	    src/configure.in, src/auto/configure
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.253/src/configure.in	2014-04-05 12:02:20.747100138 +0200
3ef2ca
--- src/configure.in	2014-04-10 11:02:59.256035996 +0200
3ef2ca
***************
3ef2ca
*** 396,405 ****
3ef2ca
    AC_MSG_RESULT(no)
3ef2ca
    AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
3ef2ca
  else
3ef2ca
!    AC_MSG_RESULT(yes)
3ef2ca
  fi
3ef2ca
  if test "$enable_smack" = "yes"; then
3ef2ca
!   AC_CHECK_LIB(attr, llistxattr,
3ef2ca
  	  [LIBS="$LIBS -lattr"
3ef2ca
  	   found_smack="yes"
3ef2ca
  	   AC_DEFINE(HAVE_SMACK)])
3ef2ca
--- 396,414 ----
3ef2ca
    AC_MSG_RESULT(no)
3ef2ca
    AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
3ef2ca
  else
3ef2ca
!   AC_MSG_RESULT(yes)
3ef2ca
  fi
3ef2ca
  if test "$enable_smack" = "yes"; then
3ef2ca
!   AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no")
3ef2ca
! fi
3ef2ca
! if test "$enable_smack" = "yes"; then
3ef2ca
!   AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h)
3ef2ca
!   AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>],
3ef2ca
! 	       AC_MSG_RESULT(yes),
3ef2ca
! 	       AC_MSG_RESULT(no); enable_smack = "no")
3ef2ca
! fi
3ef2ca
! if test "$enable_smack" = "yes"; then
3ef2ca
!   AC_CHECK_LIB(attr, setxattr,
3ef2ca
  	  [LIBS="$LIBS -lattr"
3ef2ca
  	   found_smack="yes"
3ef2ca
  	   AC_DEFINE(HAVE_SMACK)])
3ef2ca
*** ../vim-7.4.253/src/auto/configure	2014-04-05 12:02:20.751100138 +0200
3ef2ca
--- src/auto/configure	2014-04-10 11:03:04.220036007 +0200
3ef2ca
***************
3ef2ca
*** 4611,4623 ****
3ef2ca
  
3ef2ca
  
3ef2ca
  else
3ef2ca
!    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3ef2ca
  $as_echo "yes" >&6; }
3ef2ca
  fi
3ef2ca
  if test "$enable_smack" = "yes"; then
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for llistxattr in -lattr" >&5
3ef2ca
! $as_echo_n "checking for llistxattr in -lattr... " >&6; }
3ef2ca
! if ${ac_cv_lib_attr_llistxattr+:} false; then :
3ef2ca
    $as_echo_n "(cached) " >&6
3ef2ca
  else
3ef2ca
    ac_check_lib_save_LIBS=$LIBS
3ef2ca
--- 4611,4651 ----
3ef2ca
  
3ef2ca
  
3ef2ca
  else
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3ef2ca
  $as_echo "yes" >&6; }
3ef2ca
  fi
3ef2ca
  if test "$enable_smack" = "yes"; then
3ef2ca
!   ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default"
3ef2ca
! if test "x$ac_cv_header_attr_xattr_h" = xyes; then :
3ef2ca
!   true
3ef2ca
! else
3ef2ca
!   enable_smack="no"
3ef2ca
! fi
3ef2ca
! 
3ef2ca
! 
3ef2ca
! fi
3ef2ca
! if test "$enable_smack" = "yes"; then
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR_NAME_SMACKEXEC in linux/xattr.h" >&5
3ef2ca
! $as_echo_n "checking for XATTR_NAME_SMACKEXEC in linux/xattr.h... " >&6; }
3ef2ca
!   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3ef2ca
! /* end confdefs.h.  */
3ef2ca
! #include <linux/xattr.h>
3ef2ca
! _ACEOF
3ef2ca
! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3ef2ca
!   $EGREP "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1; then :
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3ef2ca
! $as_echo "yes" >&6; }
3ef2ca
! else
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3ef2ca
! $as_echo "no" >&6; }; enable_smack = "no"
3ef2ca
! fi
3ef2ca
! rm -f conftest*
3ef2ca
! 
3ef2ca
! fi
3ef2ca
! if test "$enable_smack" = "yes"; then
3ef2ca
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setxattr in -lattr" >&5
3ef2ca
! $as_echo_n "checking for setxattr in -lattr... " >&6; }
3ef2ca
! if ${ac_cv_lib_attr_setxattr+:} false; then :
3ef2ca
    $as_echo_n "(cached) " >&6
3ef2ca
  else
3ef2ca
    ac_check_lib_save_LIBS=$LIBS
3ef2ca
***************
3ef2ca
*** 4631,4657 ****
3ef2ca
  #ifdef __cplusplus
3ef2ca
  extern "C"
3ef2ca
  #endif
3ef2ca
! char llistxattr ();
3ef2ca
  int
3ef2ca
  main ()
3ef2ca
  {
3ef2ca
! return llistxattr ();
3ef2ca
    ;
3ef2ca
    return 0;
3ef2ca
  }
3ef2ca
  _ACEOF
3ef2ca
  if ac_fn_c_try_link "$LINENO"; then :
3ef2ca
!   ac_cv_lib_attr_llistxattr=yes
3ef2ca
  else
3ef2ca
!   ac_cv_lib_attr_llistxattr=no
3ef2ca
  fi
3ef2ca
  rm -f core conftest.err conftest.$ac_objext \
3ef2ca
      conftest$ac_exeext conftest.$ac_ext
3ef2ca
  LIBS=$ac_check_lib_save_LIBS
3ef2ca
  fi
3ef2ca
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_llistxattr" >&5
3ef2ca
! $as_echo "$ac_cv_lib_attr_llistxattr" >&6; }
3ef2ca
! if test "x$ac_cv_lib_attr_llistxattr" = xyes; then :
3ef2ca
    LIBS="$LIBS -lattr"
3ef2ca
  	   found_smack="yes"
3ef2ca
  	   $as_echo "#define HAVE_SMACK 1" >>confdefs.h
3ef2ca
--- 4659,4685 ----
3ef2ca
  #ifdef __cplusplus
3ef2ca
  extern "C"
3ef2ca
  #endif
3ef2ca
! char setxattr ();
3ef2ca
  int
3ef2ca
  main ()
3ef2ca
  {
3ef2ca
! return setxattr ();
3ef2ca
    ;
3ef2ca
    return 0;
3ef2ca
  }
3ef2ca
  _ACEOF
3ef2ca
  if ac_fn_c_try_link "$LINENO"; then :
3ef2ca
!   ac_cv_lib_attr_setxattr=yes
3ef2ca
  else
3ef2ca
!   ac_cv_lib_attr_setxattr=no
3ef2ca
  fi
3ef2ca
  rm -f core conftest.err conftest.$ac_objext \
3ef2ca
      conftest$ac_exeext conftest.$ac_ext
3ef2ca
  LIBS=$ac_check_lib_save_LIBS
3ef2ca
  fi
3ef2ca
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_setxattr" >&5
3ef2ca
! $as_echo "$ac_cv_lib_attr_setxattr" >&6; }
3ef2ca
! if test "x$ac_cv_lib_attr_setxattr" = xyes; then :
3ef2ca
    LIBS="$LIBS -lattr"
3ef2ca
  	   found_smack="yes"
3ef2ca
  	   $as_echo "#define HAVE_SMACK 1" >>confdefs.h
3ef2ca
*** ../vim-7.4.253/src/version.c	2014-04-06 21:33:39.675363743 +0200
3ef2ca
--- src/version.c	2014-04-10 11:00:57.200035730 +0200
3ef2ca
***************
3ef2ca
*** 736,737 ****
3ef2ca
--- 736,739 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     254,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
George:  "I just got a new set of golf clubs for my wife!"
3ef2ca
  John:  "Great trade!"
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///