Bug #863

Gnome won't compile: cannot find -lpcre

Added by stephane.russell almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Hi, I'm really having a hard time compiling gnome with pkgsrc 2007Q3.
Most problems are minors, but I'm getting this one that's less obvious:

/usr/libexec/binutils217/elf/ld: cannot find -lpcre

The pcgr package is well installed and /usr/pkg/lib is added in the ld
library list in /etc/rc.conf. It looks like this "ld" from binutils
ignores it. Is there a different configuration for the binutils tools?
I've upgraded from DF 1.8 to 1.10 by recompiling all my server.

Thanks for any help.

SR

---
-c -o queryimmodules.o `test -f 'queryimmodules.c' || echo
'./'`queryi
mmodules.c; \
then mv -f ".deps/queryimmodules.Tpo" ".deps/queryimmodules.Po"; \
else rm -f ".deps/queryimmodules.Tpo"; exit 1; \
fi
/bin/sh ../libtool --mode=link cc -O2 -pthread -I/usr/pkg/include
-I/usr/includ
e -I/usr/pkg/include/freetype2 -Wall -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
-L/usr/l
ib -Wl,-R/usr/lib -pthread -o gtk-query-immodules-2.0 queryimmodules.o
libgtk-x
11-2.0.la ../gdk-pixbuf/libgdk_pixbuf-2.0.la ../gdk/libgdk-x11-2.0.la
cc -O2 -pthread -I/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/include
-I/usr/obj/pk
gsrc/x11/gtk2/work/.buildlink/include/freetype2 -Wall -Wl,-R/usr/pkg/lib
-pthrea
d -o .libs/gtk-query-immodules-2.0 queryimmodules.o
-L/usr/obj/pkgsrc/x11/gtk2/
work/gtk+-2.12.0/gdk-pixbuf/.libs
-L/usr/obj/pkgsrc/x11/gtk2/work/gtk+-2.12.0/gd
k/.libs -L/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib
./.libs/libgtk-x11-2.0.so
/usr/obj/pkgsrc/x11/gtk2/work/gtk+-2.12.0/gdk/.libs/libgdk-x11-2.0.so
/usr/obj/
pkgsrc/x11/gtk2/work/.buildlink/lib/libatk-1.0.so -lpcre
./gdk-pixbuf/.libs/lib
gdk_pixbuf-2.0.so ../gdk/.libs/libgdk-x11-2.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.
buildlink/lib/libpangocairo-1.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/
libpangoft2-1.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libpango-1.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libcairo.so
/usr/obj/pkgsrc/x11/gtk
2/work/.buildlink/lib/libglitz.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/l
ibpng12.so -lpthread
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libfontconfig.
so /usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libfreetype.so -lz
/usr/obj/pkgs
rc/x11/gtk2/work/.buildlink/lib/libexpat.so
/usr/obj/pkgsrc/x11/gtk2/work/.build
link/lib/libXinerama.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libXi.so /u
sr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libXrandr.so
/usr/obj/pkgsrc/x11/gtk2
/work/.buildlink/lib/libXext.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/lib
Xcursor.so /usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libXrender.so
/usr/obj/p
kgsrc/x11/gtk2/work/.buildlink/lib/libXfixes.so
/usr/obj/pkgsrc/x11/gtk2/work/.b
uildlink/lib/libX11.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libXau.so /u
sr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libXdmcp.so -lrpcsvc
/usr/obj/pkgsrc/
x11/gtk2/work/gtk+-2.12.0/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so -pthread
/usr/ob
j/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule-2.0.so
/usr/obj/pkgsrc/x11/gtk2
/work/.buildlink/lib/libgobject-2.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/
lib/libglib-2.0.so
/usr/obj/pkgsrc/x11/gtk2/work/.buildlink/lib/libintl.so -lm
-Wl,--rpath -Wl,/usr/pkg/lib -Wl,--rpath
-Wl,/usr/obj/pkgsrc/x11/gtk2/work/.buil
dlink/lib
/usr/libexec/binutils217/elf/ld: cannot find -lpcre
gmake[4]: *** [gtk-query-immodules-2.0] Error 1
gmake[4]: Leaving directory `/usr/obj/pkgsrc/x11/gtk2/work/gtk+-2.12.0/gtk'
gmake[3]: *** [all-recursive] Error 1
---

History

#1 Updated by justin almost 7 years ago

I don't have an answer for why that isn't compiling for you, but for an
immediate fix:

pkg_add
http://pkgbox.dragonflybsd.org/packages/DragonFly-1.10.1/i386/x11/gtk2+-2.12.0nb1.tgz

#2 Updated by wa1ter almost 7 years ago

On Tue, 27 Nov 2007, Stephane Russell wrote:

^^^^^^^^^^^^^^^^^^^

The pkgsource build system does not look in /usr/pkg/lib during the
compile. It looks in the .buildlink/lib directory instead, as I
marked above. Now, the real question is whether libpcre appears
in your .buildlink/lib directory.

Here is mine, for example:

~# ls -l /usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.*
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.a -> /usr/pkg/lib/libpcre.a
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.la
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.so -> /usr/pkg/lib/libpcre.so
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.so.0 -> /usr/pkg/lib/libpcre.so.0
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libpcre.so.0.0.1 -> /usr/pkg/lib/libpcre.so.0.0.1

If those links are not created properly during the buildlink phase,
the compile will fail later on.

#3 Updated by stephane.russell almost 7 years ago

You were right, pcre was not a dependency, so it wasn't added in the
buildlink process. pcre was included in the gtk2 link with a "-lpcre"
statement, for a reason I still don't understand. I could'nt find why
that flag is added, since nothing in gtk2 requires it, not even in the
gtk2 pkgsrc build files.

Anyway, I solved the problem by adding pcre as a dependency in gtk2, and
everything is fine since. If somebody ever finds why this flag was
added, please advise me.

Thanks for the help.

SR

#4 Updated by wa1ter almost 7 years ago

On Wed, 28 Nov 2007, Stephane Russell wrote:

The 'magic' is in the buildlink3 files, which are a fundamental part of
the pkgsrc build system.

Look at x11/gtk2/buildlink3.mk, for example, and you will see
.include "../../devel/glib2/buildlink3.mk", which make sense because
glib2 is an important part of gtk2.

Between the buildlink3 system and the universally beloved libtool, you
eventually pull in /usr/pkg/lib/libglib-2.0.la, which contains this:

# Libraries that this one depends upon.
dependency_libs='-L/usr/pkg/lib -lpcre -lintl'

Trivial, really, once you've spent a decade bashing your head against
the inevitability of it all :o)

A quick and dirty way to investigate these dependencies is to do a
'bmake patch' for gtk2, which takes only a minute, and then poke
around in the work/.buildlink directory to see if libpcre shows up.
If not, you can try to work backwards from there. The work/.work.log
can also be very helpful.

#5 Updated by stephane.russell almost 7 years ago

I looked at glib2 after your post, and I could see that pcre is not a
dependecy of glib2 because glib2 provides it's own. But it's not
intalling it (it's not in it's PLIST), so it's not in it's buildlink
either. Mystery solved. ;-)

Thanks for the help.

SR

Also available in: Atom PDF