diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-14 20:40:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-14 20:40:58 +0200 |
commit | 21606676d9ebc6f159c56ee90733e5d5720ab3d7 (patch) | |
tree | 9835823990627cdee4d4966eac28f359ff1f217a /src | |
parent | b4086ffa32d97831f2d25a37f8c1340223dee5eb (diff) |
patch 8.1.1529: libcanberra is linked with even when not usedv8.1.1529
Problem: Libcanberra is linked with even when not used.
Solution: Have configure check for libcanberra only when wanted.
(suggestions by Libor Bukata)
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 7 | ||||
-rwxr-xr-x | src/auto/configure | 67 | ||||
-rw-r--r-- | src/configure.ac | 55 | ||||
-rw-r--r-- | src/feature.h | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
5 files changed, 88 insertions, 45 deletions
diff --git a/src/Makefile b/src/Makefile index eef91ece2f..9c4a42893b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -528,6 +528,11 @@ CClink = $(CC) # 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,7 +1957,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in $(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \ $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \ $(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \ - $(CONF_OPT_SYSMOUSE); \ + $(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA); \ fi # Use "make reconfig" to rerun configure without cached values. diff --git a/src/auto/configure b/src/auto/configure index d5b4f6053e..c326abf16c 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -840,6 +840,7 @@ enable_desktop_database_update with_motif_lib with_tlib enable_largefile +enable_canberra enable_acl enable_gpm enable_sysmouse @@ -1515,6 +1516,7 @@ Optional Features: --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,40 +12927,56 @@ rm -rf conftest* 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; } +{ $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 "x$canberra_lib" = "x"; then - canberra_lib=-lcanberra - canberra_cflags=-D_REENTRANT + + +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 - { $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 +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 + 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> + # include <canberra.h> int main () { - ca_context *hello; - ca_context_create(&hello); + ca_context *hello; + ca_context_create(&hello); ; return 0; } @@ -12973,6 +12991,7 @@ $as_echo "no" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" 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 diff --git a/src/configure.ac b/src/configure.ac index 7e821e63b5..dbf4f42b86 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -3751,27 +3751,44 @@ dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when 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` +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 "x$canberra_lib" = "x"; then - canberra_lib=-lcanberra - canberra_cflags=-D_REENTRANT +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 -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 diff --git a/src/feature.h b/src/feature.h index c5d7d777e6..eb474ab07e 100644 --- a/src/feature.h +++ b/src/feature.h @@ -663,7 +663,7 @@ /* * sound - currently only with libcanberra */ -#if !defined(FEAT_SOUND) && defined(FEAT_BIG) && defined(HAVE_CANBERRA) +#if !defined(FEAT_SOUND) && defined(HAVE_CANBERRA) # define FEAT_SOUND #endif diff --git a/src/version.c b/src/version.c index aa3986dbbb..44ce639035 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1529, +/**/ 1528, /**/ 1527, |