After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 402236 - GST_CHECK_LIBHEADER can't see libraries installed outside /usr/lib
GST_CHECK_LIBHEADER can't see libraries installed outside /usr/lib
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-universe
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 396148 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-29 21:09 UTC by Luca Ferretti
Modified: 2008-05-16 22:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luca Ferretti 2007-01-29 21:09:40 UTC
Building my GNOME jhbuild sandbox, I tried to install xiph stuff under /opt/gnome2 too, instead using -dev packages from distro.

Unfortunately it seems that gst-plugins-good is unable to check libFLAC* stuff under /opt/gnome2/lib, so the plugin is not compiled.

###############

configure:35315: checking for FLAC__seekable_stream_encoder_new in -lFLAC
configure:35350: gcc -o conftest -g -O2 -lz   conftest.c -lFLAC -lm  >&5
/usr/bin/ld: cannot find -lFLAC
collect2: ld returned 1 exit status
configure:35356: $? = 1

luca@redrum:~$ ls /opt/gnome2/lib/*FLAC.so
/opt/gnome2/lib/libFLAC.so  /opt/gnome2/lib/libOggFLAC.so

luca@redrum:~$ grep seekable_stream_encoder_new /opt/gnome2/lib/*
Binary file /opt/gnome2/lib/libFLAC.a matches
Binary file /opt/gnome2/lib/libFLAC++.a matches
Binary file /opt/gnome2/lib/libFLAC.so matches
Binary file /opt/gnome2/lib/libFLAC++.so matches
Binary file /opt/gnome2/lib/libFLAC++.so.5 matches
Binary file /opt/gnome2/lib/libFLAC++.so.5.0.0 matches
Binary file /opt/gnome2/lib/libFLAC.so.7 matches
Binary file /opt/gnome2/lib/libFLAC.so.7.0.0 matches
Comment 1 Tim-Philipp Müller 2007-01-29 23:17:35 UTC
Fancy making a patch?

Or preferably filing the issue upstream and requesting that libflac ship a .pc file for pkg-config :)
Comment 2 Luca Ferretti 2007-01-30 12:48:12 UTC
Well, flac should provide a .pc file to be a good free/open sw citizen, but it's not the only one. The same issue occurs with amrnb plugin (see bug # 396148 - also from myself).

Both are using GST_CHECK_LIBHEADER to find needed header/libraries so I suspect that this macro is broken and ignore PATH and/or --prefix option.

A simple grep shows that several plugins are using this macro.

gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(GL, GL, glTexImage2D,,
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(BZ2, bz2, BZ2_bzCompress, ,bzlib.h, BZ2_LIBS="-lbz2")
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(DTS, dts_pic, dts_init, -lm, dts.h,
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(FAAC, faac, faacEncOpen, -lm, faac.h,
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(FAAD, faad, faacDecOpen, -lm, faad.h,
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
gst-plugins-bad/configure.ac:    GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
gst-plugins-bad/configure.ac:  GST_CHECK_LIBHEADER(ZLIB,
gst-plugins-base/configure.ac:  GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, 
gst-plugins-base/configure.ac:    GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, 
gst-plugins-base/configure.ac:    GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
gst-plugins-good/configure.ac:  GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm")
gst-plugins-good/configure.ac:       GST_CHECK_LIBHEADER(AVC1394,
gst-plugins-good/configure.ac:       GST_CHECK_LIBHEADER(ROM1394,
gst-plugins-good/configure.ac:    GST_CHECK_LIBHEADER(AVC1394,
gst-plugins-good/configure.ac:    GST_CHECK_LIBHEADER(ROM1394,
gst-plugins-good/configure.ac:    GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex/speex.h, [
gst-plugins-good/configure.ac:        GST_CHECK_LIBHEADER(SPEEX, speex, speex_encode_int, , speex/speex.h, [
gst-plugins-good/configure.ac:  GST_CHECK_LIBHEADER(ZLIB,
gst-plugins-ugly/configure.ac:  GST_CHECK_LIBHEADER(AMRNB, amrnb,
gst-plugins-ugly/configure.ac:  GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
gst-plugins-ugly/configure.ac:  GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,

Note: speex plugin checks for .pc first

PS ok to rename this bug and makr 396148 as duplicate?
Comment 3 Tim-Philipp Müller 2007-01-30 13:26:07 UTC
> PS ok to rename this bug and mark 396148 as duplicate?

Heh, of course.

Patch to make FLAC provide .pc files filed upstream:
http://sourceforge.net/tracker/index.php?func=detail&aid=1647881&group_id=13478&atid=313478
Comment 4 Luca Ferretti 2007-01-30 13:52:32 UTC
*** Bug 396148 has been marked as a duplicate of this bug. ***
Comment 5 Tim-Philipp Müller 2007-05-18 17:36:20 UTC
> Both are using GST_CHECK_LIBHEADER to find needed header/libraries so I
> suspect that this macro is broken and ignore PATH and/or --prefix option.

I just had a look and all GST_CHECK_LIBHEADER() really does is call AC_CHECK_LIB() and then AC_CHECK_HEADER(). I find it hard to believe that those are broken in this respect.

It seems more likely to me that the jhbuild environment doesn't set the right environment variables for this, whatever they are (LIBRARY_PATH? LDFLAGS?), but then, jhbuild is made for the particular purpose to do builds into another prefix, so it also seems a bit hard to believe it doesn't get this right as well (unless all other dependencies use .pc files already ...)

(found this: http://osdir.com/ml/sysutils.autoconf.general/2004-08/msg00041.html)
Comment 6 Sebastian Dröge (slomo) 2008-05-16 22:18:11 UTC
Libraries from outside the default linker search path must be added to LDFLAGS (i.e. LDFLAGS="-L/opt/gnome2/lib"). This is the intended autoconf behaviour so let's close this bug.

jhbuild should probably append "-L/opt/gnome2/lib" to LDFLAGS as it probably already appends /opt/gnome2/lib/pkgconfig to PKG_CONFIG_PATH.