Bug 442785

Summary: broken gd pkg-config/gdlib-config results
Product: [Fedora] Fedora Reporter: Juliano F. Ravasi <bugs+fedora>
Component: gdAssignee: Jiri Moskovcak <jmoskovc>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: dfediuck, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.0.35-3.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-09 02:53:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juliano F. Ravasi 2008-04-16 19:14:17 UTC
Description of problem:
The list of link libraries returned by both `pkg-config gdlib --libs` and
`gdlib-config --libs` contains only the libraries used to link libgd itself, not
the libraries needed to link programs that make use gd, contrary to all other
packages that offer pkg-config modules or *-config helpers.

The output just misses a "-lgd" on the output.

Version-Release number of selected component (if applicable): 2.0.35

Steps to Reproduce:
1. pkg-config gdlib --libs
2. gdlib-config --libs

Actual results:
-lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm

Expected results:
-lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm -lgd


Compare with the results of:
  sdl-config --libs
  freetype-config --libs
  pkg-config glib-2.0 --libs 
  pkg-config libpng12 --libs

Note that all of them print the switch needed to link programs to the library,
among other dependencies. With gdlib it prints only the dependencies, and not
the actual -lgd library.

Comment 1 Rex Dieter 2008-04-17 14:20:37 UTC
I'd argue the "Expected results" should simply be:
-lgd
Everything else is extraneous in the non-static linking case.

That said, there are exceptions to our expectations taht *config output what 
client programs expect, including mysql_config, pg_config (which report libs 
that mysql, postgresql were built with, not necessarily what client apps 
should use).

Comment 2 Rex Dieter 2008-04-17 14:22:10 UTC
For pkgconfig, the fix would be relatively easy, put everything except -lgd in 
a new tag in the *.pc file:
Libs.private:
which is included only when pkg-config --static is used. 

Comment 3 Juliano F. Ravasi 2008-04-17 19:51:58 UTC
Yes, I just checked and really, -lgd is enough to pull all the link dependencies
needed by libgd.

This seems to be a problem on the libgd package itself:

http://cvs.php.net/viewcvs.cgi/gd/libgd/src/config/gdlib-config.in?revision=1.2&view=markup

gdlib-config is generated with @LIBS@ and @LIBICONV@ as provided by the libgd
configure script, used to compile and link libgd itself.

Comment 4 Jiri Moskovcak 2008-04-22 12:16:47 UTC
Hi,
on my Fedora 8 $ pkg-config gdlib --libs returns -ldg (should be -lgd, but 
that's just typo). And I'll ask upstream about the output of glib-config.

Jirka

Comment 5 Fedora Update System 2008-04-25 12:13:05 UTC
gd-2.0.35-3.fc8 has been submitted as an update for Fedora 8

Comment 6 Fedora Update System 2008-04-29 20:48:55 UTC
gd-2.0.35-3.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gd'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-3296

Comment 7 Juliano F. Ravasi 2008-05-13 21:41:32 UTC
Jirka,

The package in testing fixed all issues. Now it returns -lgd as expected (the
current F8 package is really returning -ldg, which breaks configure scripts
relying on it, so it is welcome to push the package to updates).

Thanks.

Comment 8 Fedora Update System 2008-07-09 02:53:38 UTC
gd-2.0.35-3.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.