Patch 8.1.1529
Problem:    Libcanberra is linked with even when not used.
Solution:   Have configure check for libcanberra only when wanted.
            (suggestions by Libor Bukata)
Files:      src/feature.h, src/configure.ac, src/auto/configure, src/Makefile


*** ../vim-8.1.1528/src/feature.h       2019-06-09 13:42:36.428522167 +0200
--- src/feature.h       2019-06-14 20:14:15.318264323 +0200
***************
*** 663,669 ****
  /*
   * sound - currently only with libcanberra
   */
! #if !defined(FEAT_SOUND) && defined(FEAT_BIG) && defined(HAVE_CANBERRA)
  # define FEAT_SOUND
  #endif
  
--- 663,669 ----
  /*
   * sound - currently only with libcanberra
   */
! #if !defined(FEAT_SOUND) && defined(HAVE_CANBERRA)
  # define FEAT_SOUND
  #endif
  
*** ../vim-8.1.1528/src/configure.ac    2019-06-09 13:42:36.424522190 +0200
--- src/configure.ac    2019-06-14 20:38:16.347440366 +0200
***************
*** 3751,3777 ****
  dnl appropriate, so that off_t is 64 bits when needed.
  AC_SYS_LARGEFILE
  
  
! if test "x$PKG_CONFIG" != "xno"; then
!   canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
!   canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
  fi
! if test "x$canberra_lib" = "x"; then
!   canberra_lib=-lcanberra
!   canberra_cflags=-D_REENTRANT
  fi
- AC_MSG_CHECKING(for libcanberra)
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $canberra_cflags"
- LIBS="$LIBS $canberra_lib"
- AC_TRY_LINK([
- # include <canberra.h>
-     ], [
-    ca_context *hello;
-    ca_context_create(&hello);],
-      AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA),
-      AC_MSG_RESULT(no); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS")
  
  
  dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
--- 3751,3794 ----
  dnl appropriate, so that off_t is 64 bits when needed.
  AC_SYS_LARGEFILE
  
+ AC_MSG_CHECKING(--enable-canberra argument)
+ AC_ARG_ENABLE(canberra,
+       [  --disable-canberra      Do not use libcanberra.],
+       , [enable_canberra="maybe"])
  
! if test "$enable_canberra" = "maybe"; then
!   if test "$features" = "big" -o "$features" = "huge"; then
!     AC_MSG_RESULT(Defaulting to yes)
!     enable_canberra="yes"
!   else
!     AC_MSG_RESULT(Defaulting to no)
!     enable_canberra="no"
!   fi
! else
!   AC_MSG_RESULT($enable_canberra)
  fi
! if test "$enable_canberra" = "yes"; then
!   if test "x$PKG_CONFIG" != "xno"; then
!     canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
!     canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
!   fi
!   if test "x$canberra_lib" = "x"; then
!     canberra_lib=-lcanberra
!     canberra_cflags=-D_REENTRANT
!   fi
!   AC_MSG_CHECKING(for libcanberra)
!   ac_save_CFLAGS="$CFLAGS"
!   ac_save_LIBS="$LIBS"
!   CFLAGS="$CFLAGS $canberra_cflags"
!   LIBS="$LIBS $canberra_lib"
!   AC_TRY_LINK([
!   # include <canberra.h>
!       ], [
!      ca_context *hello;
!      ca_context_create(&hello);],
!        AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA),
!        AC_MSG_RESULT(no); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS")
  fi
  
  
  dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
*** ../vim-8.1.1528/src/auto/configure  2019-06-09 13:42:36.424522190 +0200
--- src/auto/configure  2019-06-14 20:38:18.927428603 +0200
***************
*** 840,845 ****
--- 840,846 ----
  with_motif_lib
  with_tlib
  enable_largefile
+ enable_canberra
  enable_acl
  enable_gpm
  enable_sysmouse
***************
*** 1515,1520 ****
--- 1516,1522 ----
    --disable-icon-cache-update        update disabled
    --disable-desktop-database-update  update disabled
    --disable-largefile     omit support for large files
+   --disable-canberra      Do not use libcanberra.
    --disable-acl           No check for ACL support.
    --disable-gpm           Don't use gpm (Linux mouse daemon).
    --disable-sysmouse      Don't use sysmouse (mouse in *BSD console).
***************
*** 12925,12964 ****
  fi
  
  
  
! if test "x$PKG_CONFIG" != "xno"; then
!   canberra_lib=`$PKG_CONFIG --libs libcanberrax 2>/dev/null`
!   canberra_cflags=`$PKG_CONFIG --cflags libcanberrax 2>/dev/null`
!      { $as_echo "$as_me:${as_lineno-$LINENO}: result: canberra_lib: 
$canberra_lib" >&5
! $as_echo "canberra_lib: $canberra_lib" >&6; }
!      { $as_echo "$as_me:${as_lineno-$LINENO}: result: canberra_cflags: 
$canberra_cflags" >&5
! $as_echo "canberra_cflags: $canberra_cflags" >&6; }
! fi
! if test "x$canberra_lib" = "x"; then
!   canberra_lib=-lcanberra
!   canberra_cflags=-D_REENTRANT
! fi
!      { $as_echo "$as_me:${as_lineno-$LINENO}: result: canberra_lib: 
$canberra_lib" >&5
! $as_echo "canberra_lib: $canberra_lib" >&6; }
!      { $as_echo "$as_me:${as_lineno-$LINENO}: result: canberra_cflags: 
$canberra_cflags" >&5
! $as_echo "canberra_cflags: $canberra_cflags" >&6; }
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcanberra" >&5
  $as_echo_n "checking for libcanberra... " >&6; }
! ac_save_CFLAGS="$CFLAGS"
! ac_save_LIBS="$LIBS"
! CFLAGS="$CFLAGS $canberra_cflags"
! LIBS="$LIBS $canberra_lib"
! cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  
! # include <canberra.h>
  
  int
  main ()
  {
  
!    ca_context *hello;
!    ca_context_create(&hello);
    ;
    return 0;
  }
--- 12927,12982 ----
  fi
  
  
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-canberra argument" 
>&5
+ $as_echo_n "checking --enable-canberra argument... " >&6; }
+ # Check whether --enable-canberra was given.
+ if test "${enable_canberra+set}" = set; then :
+   enableval=$enable_canberra;
+ else
+   enable_canberra="maybe"
+ fi
  
! 
! if test "$enable_canberra" = "maybe"; then
!   if test "$features" = "big" -o "$features" = "huge"; then
!     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to yes" >&5
! $as_echo "Defaulting to yes" >&6; }
!     enable_canberra="yes"
!   else
!     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to no" >&5
! $as_echo "Defaulting to no" >&6; }
!     enable_canberra="no"
!   fi
! else
!   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5
! $as_echo "$enable_canberra" >&6; }
! fi
! if test "$enable_canberra" = "yes"; then
!   if test "x$PKG_CONFIG" != "xno"; then
!     canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
!     canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
!   fi
!   if test "x$canberra_lib" = "x"; then
!     canberra_lib=-lcanberra
!     canberra_cflags=-D_REENTRANT
!   fi
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcanberra" >&5
  $as_echo_n "checking for libcanberra... " >&6; }
!   ac_save_CFLAGS="$CFLAGS"
!   ac_save_LIBS="$LIBS"
!   CFLAGS="$CFLAGS $canberra_cflags"
!   LIBS="$LIBS $canberra_lib"
!   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  
!   # include <canberra.h>
  
  int
  main ()
  {
  
!      ca_context *hello;
!      ca_context_create(&hello);
    ;
    return 0;
  }
***************
*** 12973,12978 ****
--- 12991,12997 ----
  fi
  rm -f core conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
+ fi
  
  
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5
*** ../vim-8.1.1528/src/Makefile        2019-06-09 13:42:36.424522190 +0200
--- src/Makefile        2019-06-14 20:37:15.731716877 +0200
***************
*** 528,533 ****
--- 529,539 ----
  # though you have /dev/sysmouse and includes.
  #CONF_OPT_SYSMOUSE = --disable-sysmouse
  
+ # libcanberra - For sound support.  Default is on for big features.
+ # Uncomment one of the two to chose otherwise.
+ # CONF_OPT_CANBERRA = --enable-canberra
+ # CONF_OPT_CANBERRA = --disable-canberra
+ 
  # FEATURES - For creating Vim with more or less features
  # Uncomment one of these lines when you want to include few to many features.
  # The default is "huge" for most systems.
***************
*** 1952,1958 ****
                $(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \
                $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \
                $(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \
!               $(CONF_OPT_SYSMOUSE); \
        fi
  
  # Use "make reconfig" to rerun configure without cached values.
--- 1958,1964 ----
                $(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \
                $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \
                $(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \
!               $(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA); \
        fi
  
  # Use "make reconfig" to rerun configure without cached values.
*** ../vim-8.1.1528/src/version.c       2019-06-14 20:00:45.374401154 +0200
--- src/version.c       2019-06-14 20:39:16.175167712 +0200
***************
*** 779,780 ****
--- 779,782 ----
  {   /* Add new patch number below this line */
+ /**/
+     1529,
  /**/

-- 
If Microsoft would build a car...
... Occasionally, executing a maneuver such as a left turn
would cause your car to shut down and refuse to restart, in
which case you would have to reinstall the engine.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201906141841.x5EIfJgY017341%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui