If libgcrypt is not installed then the ebuild crashes while trying to run autoconf due to a missing macro: ***** autoconf ***** configure.ac:5514: error: possibly undefined macro: AM_PATH_LIBGCRYPT If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. Reproducible: Always Steps to Reproduce: 1. Don't have libgcrypt installed 2. USE=-libgcrypt emerge -a vlc 3. See it crash. Actual Results: # emerge vlc Calculating dependencies... done! >>> Verifying ebuild Manifests... >>> Emerging (1 of 1) media-video/vlc-0.9.0_alpha20071009 to / * vlc-snapshot-20071009.tar.bz2 RMD160 ;-) ... [ ok ] * vlc-snapshot-20071009.tar.bz2 SHA1 ;-) ... [ ok ] * vlc-snapshot-20071009.tar.bz2 SHA256 ;-) ... [ ok ] * vlc-snapshot-20071009.tar.bz2 size ;-) ... [ ok ] * vlc-patches-42.tar.bz2 RMD160 ;-) ... [ ok ] * vlc-patches-42.tar.bz2 SHA1 ;-) ... [ ok ] * vlc-patches-42.tar.bz2 SHA256 ;-) ... [ ok ] * vlc-patches-42.tar.bz2 size ;-) ... [ ok ] * checking ebuild checksums ;-) ... [ ok ] * checking auxfile checksums ;-) ... [ ok ] * checking miscfile checksums ;-) ... [ ok ] * checking vlc-snapshot-20071009.tar.bz2 ;-) ... [ ok ] * checking vlc-patches-42.tar.bz2 ;-) ... [ ok ] * Using /usr/lib/wx/config/gtk2-unicode-release-2.6 >>> Unpacking source... >>> Unpacking vlc-snapshot-20071009.tar.bz2 to /var/tmp/portage/media-video/vlc-0.9.0_alpha20071009/work >>> Unpacking vlc-patches-42.tar.bz2 to /var/tmp/portage/media-video/vlc-0.9.0_alpha20071009/work * Applying various patches (bugfixes/updates) ... * 000_all_glide.patch ... [ ok ] * 010_all_freetype-font.patch ... [ ok ] * 180_all_faad.patch ... [ ok ] * 220_all_firefox.patch ... [ ok ] * 250_all_livepic.patch ... [ ok ] * 300_all_pic.patch ... [ ok ] * Done with patching * Running eautoreconf in '/var/tmp/portage/media-video/vlc-0.9.0_alpha20071009/work/vlc-0.9.0-svn' ... * Running aclocal -I m4 ... [ ok ] * Running libtoolize --copy --force --automake ... [ ok ] * Running aclocal -I m4 ... [ ok ] * Running autoconf ... [ !! ] * Failed Running autoconf ! * * Include in your bugreport the contents of: * * /var/tmp/portage/media-video/vlc-0.9.0_alpha20071009/temp/autoconf-15981.out * * ERROR: media-video/vlc-0.9.0_alpha20071009 failed. * Call stack: * ebuild.sh, line 1687: Called dyn_unpack * ebuild.sh, line 803: Called qa_call 'src_unpack' * ebuild.sh, line 44: Called src_unpack * vlc-0.9.0_alpha20071009.ebuild, line 185: Called eautoreconf * autotools.eclass, line 96: Called eautoconf * autotools.eclass, line 166: Called autotools_run_tool 'autoconf' * autotools.eclass, line 219: Called die * The specific snippet of code: * die "Failed Running $1 !" * The die message: * Failed Running autoconf ! * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/media-video/vlc-0.9.0_alpha20071009/temp/build.log'. * Expected Results: Configured and built. This can be worked around for now by using emerge -1 libgcrypt && emerge vlc && emerge -C libgcrypt A possible solution is to just sed away the AM_PATH_LIBGCRYPT macro if USE=-libgcrypt . emerge --info: Portage 2.1.3.12 (default-linux/x86/2007.0/desktop, gcc-4.2.1, glibc-2.6.1-r0, 2.6.22-gentoo-r8 i686) ================================================================= System uname: 2.6.22-gentoo-r8 i686 Genuine Intel(R) CPU T2400 @ 1.83GHz Timestamp of tree: Wed, 10 Oct 2007 06:20:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p17-r1 dev-java/java-config: 1.3.7, 2.0.33-r1 dev-lang/python: 2.5.1-r2 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.10-r5 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r3 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.22-r2 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS=" -march=prescott -mfpmath=sse -msse3 -O2 -pipe -fomit-frame-pointer " CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS=" -march=prescott -mfpmath=sse -msse3 -O2 -pipe -fomit-frame-pointer " DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg ccache distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://gentoo.virginmedia.com" LDFLAGS=" -Wl,-O1 -Wl,--hash-style=gnu " MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X a52 acpi alsa bash-completion berkdb bitmap-fonts branding cairo cdr cli cracklib dbus dri dvd dvdr dvdread eds emacs emboss encode evo fam firefox gif gpm gstreamer gtk hal iconv ipw3945 isdnlog jpeg latex libnotify mad midi mikmod mmx mp3 mpeg mudflap ncurses nptl nptlonly nsplugin ogg opengl pam pcre pdf perl png pppd preview-latex python quicktime readline reflection sdl session spell spl sse sse2 ssl svg tcpd tiff tk truetype truetype-fonts type1-fonts unicode vorbis win32codecs x86 xcomposite xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
after asking upstream it appears that libgcrypt is mandatory at build time, I hope we'll be able to get rid of this mandatory dep when 0.9.0 will be released. Thanks for reporting.
As I see it, the only reason libgcrypt is a build dep is because it installs stuff in /usr/share/aclocal and we do an eautoreconf. From the tarball's configure.ac: AC_ARG_ENABLE(libgcrypt, [ --enable-libgcrypt libgcrypts support (default enabled)]) if test "${enable_libgcrypt}" != "no" -a "${enable_gnutls}" != "no"i then dnl Workaround for cross-compiling since AM_PATH_LIBGRYPT doesn't dectect dnl it and looks for libgcrypt headers in the wrong place. if test "${host_cpu}" = "${build_cpu}" then AM_PATH_LIBGCRYPT([1:1.1.94], [have_libgcrypt="yes"], [have_libgcrypt="no"]) else AC_CHECK_HEADERS(gcrypt.h,have_libgcrypt="yes",have_libgcrypt="no") fi fi AM_CONDITIONAL([HAVE_LIBGCRYPT], [test "${have_libgcrypt}" = "yes"]) So because we have the AM_PATH_LIBGCRYPT inside the check for --enable-libgcrypt (which will be disabled by the useflag), we should be able to sed away the AM_PATH_LIBGCRYPT if and only if USE=-libgcrypt. I just made this change and tried to merge vlc and it appears to build fine. I'll leave the bug as RESOLVED FIXED for now in case there's something I've missed.
some modules include unconditionally libgcrypt headers iirc
I just checked with a FEATURES=-ccache emerge -1 vlc and tweaked configure.ac before the ebuild ran autoconf and it built fine. I grepped the sources and found 2 .c files that unconditionally include gcrypt.h: libs/srtp/srtp.c modules/misc/gnutls.c libs/srtp/srtp.c is used when building libs/srtp/libvlc_srtp.la: if HAVE_LIBGCRYPT noinst_LTLIBRARIES = libvlc_srtp.la check_PROGRAMS = test-aes test-recv TESTS = $(check_PROGRAMS) endif libvlc_srtp_la_SOURCES = srtp.c (note that libvlc_srtp.la is wrapped in if HAVE_LIBGCRYPT, so that'll be skipped) and modules/misc/gnutls.c is built if USE=gnutls, which pulls in libgcrypt anyway.
I see this in the ebuild for both vlc-0.9.0_alpha ebuilds: # libgcrypt is mandatory at buildtime, and that's not only a matter of missing # m4s. Bug #195322 What else is libgcrypt doing that makes it a build dep? Can it be worked around?
(In reply to comment #5) > What else is libgcrypt doing that makes it a build dep? Can it be worked > around? that's basically adding #ifdefs to the code if I remember correctly, currently it unconditionally includes gcrypt.h
I still believe that my analysis in Comment #4 stands. There are 2 files that #include <gcrypt.h>. One is built only if USE=gcrypt (in which case we pull in libgcrypt) and the other is only built if USE=gnutls (in which case the configure script does an AC_CHECK_LIB([gcrypt], ...) so we need to RDEPEND on libgcrypt anyway). If USE=-gcrypt we can sed away the AM_PATH_LIBGCRYPT line and replace it with "have_libgcrypt=no" and vlc will build fine (I just tried it again). If I'm wrong, please show me why.