Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcanberra is linked with Tiny features build #4531

Closed
valacar opened this issue Jun 14, 2019 · 6 comments
Closed

libcanberra is linked with Tiny features build #4531

valacar opened this issue Jun 14, 2019 · 6 comments

Comments

@valacar
Copy link

valacar commented Jun 14, 2019

Describe the bug
The Canberra library is linked in when making a Tiny build (also Normal, and probably Small). In a Tiny build, the sound feature is disabled, so I don't think it's necessary to link with libcanberra which deals with playing sounds and "sound themes" as far as I know.

To Reproduce

  • Download the Vim source code for at least version 8.1 patch 1502 (I'm using 1524)
  • Go to the vim/src directory
  • Run make distclean
  • Run CFLAGS='-O2 -pipe' ./configure --with-features=tiny
  • Run make -j
  • Run ./vim --version (or open vim and type :ver), and notice that at the bottom it shows Linking: and -lcanberra appears.

Expected behavior
Expected not to see -lcanberra since the sound feature is disabled (-sound). I believe it's only supposed to be in Big and Huge builds.

Environment:

  • Vim version 8.1.1524
  • OS: Linux 5.1.4-1-MANJARO
  • Terminal: xterm
@bukatlib
Copy link

I created a simple patch (attached as text file) that disables libcanberra by default to avoid desktop related dependencies. After configure file is regenerated, libcanberra can be enabled by passing '--with-libcanberra' option. Maybe it can be extended to consider different build types as well.

The vim can be pached and configure file regenerated by the following commands:
cd src/
patch -p2 -i disable_libcanberra.txt
aclocal
autoconf
../configure ...

disable_libcanberra.txt

@valacar
Copy link
Author

valacar commented Jun 14, 2019

Thanks for the patch Bukatlib, it's working as expected now.

@brammool
Copy link
Contributor

brammool commented Jun 14, 2019 via email

@brammool
Copy link
Contributor

Configure check added in patch 8.1.1529

@tonymec
Copy link

tonymec commented Jun 15, 2019

At version 8.1.1529 (and later), -lcanberra is seen only in the Big and Huge link command-lines; but does it make a difference, considering that we are linking with -Wl,--as-needed? I would have expected the libcanberra to be "not needed" (and therefore not included by the linker) when linking Normal and smaller builds even before 8.1.1529. (When the linker does not support --as-needed, link.sh tries removing libraries one by one until only the needed ones are left.)

@bukatlib
Copy link

Bram, thank you for the patch. I tested it and it works as expected. Library libcanberra is linked if the huge build is requested. On the other hand, if '--disable-canberra' is passed explicitly, the vim will not use libcanberra and X11 dependencies are avoided. Thank you very much for your work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants