pkgconfigForum: Extension Development Topic: pkgconfig started by: Juanito Posted by Juanito on May 08 2008,09:26
I guess the first thing is to check that the format of the pkgconfig variable is correct, eg:
If this doesn't work (and sometimes it doesn't even when the pc files are present), then there are a couple of other options: 1. set compiler and library flags, eg:
2. set ./configure switches if possible, eg:
3. set other environment variables (usually listed by ./configure --help) eg:
4. (if the ./configure script completes) edit the Makefile(s) directly to add the location of headers/libs 5. (last option, since this is not a good idea) symlink the appropriate headers and libs to /usr/include and /usr/lib Posted by andrewb on May 09 2008,02:43
OK,I've gone back to the start with compiling gtkam, with the latest downloads of gtkam, libgphoto2, libexif, libexif-gtk & libusb. I use the compile -3.3.5.uci & gtk+-2.10.9.unc & gtk+-2.10.9.unc extensions loaded onto an otherwise base frugal install of DSL 4.3. I can compile & install libusb & libexif, but when compiling libexif-gtk the configure script exits with the following:
but make then fails with:
libXrender seems to be in /usr/X1R6/lib. I've created a symlink to /usr/lib, but it doesn't seem to make any difference. (there is no ".la" file there - just the .so.1.2 file & a symlink to it in .so.1) Posted by Juanito on May 09 2008,04:05
- I don't think libXrender is in the base dsl, did it come from an old version of gnu-utils or XFree86 maybe? This being said, this is the first time I saw an error complaining of missing the *.a version of a library. As a test, you could try loading the latest xorg72.uci (the headers/pc files are in it), including it in PKG_CONFIG_PATH and trying again to compile. Posted by ^thehatsrule^ on May 09 2008,05:08
A response (from the other thread):
Posted by Juanito on May 09 2008,06:51
In fact looking in /opt/compile-3.3.5/lib/pkgconfig, there are:
- all of which appear to refer to the base dsl libs, so I guess bison, flex, etc did not create any pc files and it's OK to leave what there is in place. Posted by Jason W on May 09 2008,12:28
Actually libXrender is in the base system, but no dev files of course. I had this same issue when building Xchat. It insisted on the .la file. I was building it against xorg72, and at the time I just compiled my own libXrender and installed it in xorg72 to provide the .la and .a file. That is why I asked earlier about xorg72 including the .a and .la files in the extension. So I am pretty sure if xorg72 is loaded and the pkgconfig stuff set that the compile error would go away. And xorg72 did not end up as a dependency with Xchat
Posted by Juanito on May 09 2008,13:37
I'd looked in /opt/gnu-utils (from an old gnu-utils) and found libXrender so I assumed that was where it came from, but you're right it's also in /KNOPPIX/X11R6/libI'd forgotten I'd submitted xorg72-dev.tar.gz - the .a and .la files for xorg72 are there - this doesn't get round not having the dev files for libXrender in the dsl base, but I never figured out where it came from so I couldn't include the dev files in compile-3.3.5 As you say, you could probably get away with compiling against xorg72 - not exactly the "done thing", but it could well work... Posted by andrewb on May 11 2008,10:15
I've not had a chance to do much with this over the weekend, but at the end of last week I loded up xorg72 & the dev.tar.gz - only problem is the tar.gz couldn't load over xorg72,uci as it is read-only. Once I'v managed to extract xorg72 to a r-w filesystem I'll let you know how I go.My reason for trying to recompile gtkam is that I get nothing but segmentation faults with the version in the repository - especially when trying to start downloading images. Someone else rported this recently & it reminded me to get on with attempting a recompilation with the newest version. Posted by andrewb on May 12 2008,02:05
OK,I've remounted xorg72.uci as rw, mounted the devs - managed to recompile libXrender so I have the .la files. Got libusb, libexif, libexif-gtk,libgphoto2, & gphoto2, compiled & installed. Now trying to compile gtkam. the configre script exits ok:
BUT.... make fails:
I've used the latest version of compile.3.3.5 from the testing area & gtk 2.10.9 + the dev headers for that version as well. Posted by ^thehatsrule^ on May 12 2008,03:23
You might be using the wrong png version? afaik theres 3(?) different versions if youre using compile-3.3.5?
Posted by Juanito on May 12 2008,03:38
By default compile-3.3.5 is set to use the headers for the most up to date libpng in the base dsl - I'd take a guess that libcairo in gtk 2.10.9 was compiled against a newer version of png but is looking at one of the dsl base versions instead.Setting PKG_CONFIG_PATH to the location of the libpng pc file in gtk+-2.10.9_devs.dsl might fix the problem - alternatively, you could modify the Makefile(s) by hand to point to libpng in gtk+-2.10.9.dsl and the libpng headers in gtk+-2.10.9_devs.dsl Posted by andrewb on May 12 2008,04:07
Setting PKG_CONFIG_PATH doesn't seems to change anything. modifying the Makefile is getting out of my depth now (used to know how to understand these files - but have now forgotten!)
Posted by Jason W on May 12 2008,04:30
andrewb - There should be a libpng.pc or png.pc included with the gtk+-2.1.09 extension and that would be the one to use since it is the one included in the gtk extension and it is the one cairo was built against. The libpng in gtk+-2.10.9 is version 1.2.8, and the latest version in base DSL is 1.2.5 I believe. That may be the issue if you are using the pc file from compile-3.3.5 in this case. Posted by Juanito on May 12 2008,04:50
- it shouldn't be too big a deal - if Jason's solution above doesn't work (sometimes the pkgconfig setting is ignored), you could try searching the Makefile on "lpng" which should turn up something like "PNG_LIBS = -lpng" and close to it there should be something like "PNG_CFLAGS = ...". You could then alter these to: PNG_LIBS = -L/path-to-lib/ -lpng PNG_CFLAGS = -I/path-to-header/ One issue I could see would be that it looks like you are compiling a dsl extension and that your libs will be amongst the base dsl libs in /usr/lib (unless the libpng in question is in /usr/local/lib). This means that there will be several libpng* in the same place and thus ./configure cannot figure out which one to use - you might need to modify the symlink libpng.so to point to the libpng* you want to use... ..or you could compile to /opt and hope to avoid this sort of pain Edit: BTW (and this is absolutely not a plug), libcairo in cairo-1.2.uci is compiled against the base dsl libpng -if all else fails, you could try compiling against this. Posted by andrewb on May 12 2008,05:42
No sign of any string 'png' in the Makefile, either in the top level, or in the src directory. (only reference is to a gtkam.png icon file)I've tried setting PKG_CONFIG_PATH to the pkconfig directory in gtk-+2.10.9 with libpng.pc in it & also creating a symlinkin /usr/local/lib (&/usr/lib) to the libpng.so in gtk-+2.10.9. Still get the same errors. Posted by Juanito on May 12 2008,06:46
I'm not at a dsl machine right now, which libpng* are there in gtk-+2.10.9? Are they in /usr/lib or /usr/local/lib?
Posted by andrewb on May 12 2008,07:15
/usr/local/libThey are:
I have added the following to the Makefile in the top level & src directories I am using to compile gtkam from:
/usr/local/lib has the libpng & libpng12 files in it (I symlinked them to to the ones in /opt/gtk-+2.10.9/usr/local/lib). There also seem to be copies in /usr/lib. I symlinked them the same as above. Posted by Juanito on May 12 2008,11:06
- sorry if I might have mislead you, this was just my guess at what the Makefile might say. If it doesn't say this, then I don't think adding the above would have any effect. I was concerned that I might be be causing your problems by a mistake in compile-3.3.5, so I tried compiling gtkam to /opt. It seems to compile without problems against cairo-1.2/gtk+-2.10, although I cannot test it as I do not have a webcam, camera, etc handy Posted by andrewb on May 12 2008,23:23
I can't get gtkam to compile under any conditions - even adding to the makefile. What version are yo compiling & what extensions / libraries do you have loaded when doing so? What version of DSL are you running the compile on?
Posted by Juanito on May 13 2008,04:08
Using dsl-3.4.11, I loaded the cairo-1.2.uci, gtk+-2.10.uci, xorg72.uci & compile-3.3.5.uci extensions - note that you need to be careful that the fontconfig (fc-*) and freetype symlinks in /opt/bin are pointing to cairo-1.2 and not to compile-3.3.5. [I guess this means that I missed these symlinks out out of user.tar.gz in cairo-1.2]The compilation went something like this:
- after making a *uci out of /opt/gtkam, I rebooted and loaded cairo-1.2 and gtk+-2.10 but not compile-3.3.5 nor xorg72 and got this error:
'hope this helps Posted by andrewb on May 13 2008,04:52
When I try to compile using the cairo-1.2 extension make fails compiling the libexif-gtk library with the message:
I had encountered this before your explanation of your compiling method. I have checked this under 3.11 using a base frugal installation and only cairo1.2, gtk+-2.10, xorg72 * compile3.3.5. I redid the symlinks in /opt/bin to point to the fc & freetype files in cairo. Posted by Juanito on May 13 2008,05:00
- I believe this is because libcairo is trying to use the freetype/fontconfig libs in the base dsl. You could try either: 1. Move "/opt/cairo-1.2/lib" above "/usr/lib" in /etc/ld.so.conf and then "sudo ldconfig" or 2. [Brute Force method] delete the freetype/fontconfig libs in /usr/lib then "sudo ldconfig" ..and then try make again. BTW, once compiled, the gtkam *uci I made starts up without touching /etc/ld.so.conf or deleting the freetype/fontconfig libs in /usr/lib Posted by andrewb on May 13 2008,07:40
OK,Finally got it compiled. Then got the error:
when I ran it. Sorted this by moving /opt/gtk+-2.10/lib above /urs/lib in ld.so.conf & running ldconfig. Now to try a reboot...... does the same - still need to edit ld.so.conf Posted by Juanito on May 13 2008,09:26
I had been starting gtkam with "LD_LIBRARY_PATH=/opt/gtkam/lib /opt/gtkam/bin/gtkam" and did not get this error, but you could try "LD_LIBRARY_PATH=/opt/gtkam/lib:/opt/gtk+-2.10/lib /opt/gtkam/bin/gtkam" or put symlinks to /opt/gtk+-2.10/lib/glib2* in /opt/gtkam/lib
Posted by andrewb on May 22 2008,06:05
Juanito - thanks for all the help. An update version of gtkam should be in testing soon - along with gnokii.
|