Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 202059 - dev-libs/icu-3.6-r1 provided icu-config reports CFLAGS and LDFLAGS used while compiling icu
Summary: dev-libs/icu-3.6-r1 provided icu-config reports CFLAGS and LDFLAGS used while...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://bugs.icu-project.org/trac/tick...
Whiteboard:
Keywords: InVCS
Depends on: 200010
Blocks: as-needed
  Show dependency tree
 
Reported: 2007-12-12 17:09 UTC by Mart Raudsepp
Modified: 2013-10-15 21:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2007-12-12 17:09:46 UTC
dev-libs/icu-3.6-r1 provided icu-config reports CFLAGS, CXXFLAGS, LDFLAGS and so on used while compiling icu, not what is necessary to compile stuff against icu or link icu.
This is typically caused by such custom *-config scripts getting their CFLAGS and LDFLAGS (that they are going to report for that installation) from configure's CFLAGS and LDFLAGS and co. This is a no-no - it should store any necessary for build (that it probably adds to LDFLAGS and co inside configure.in) flags inside AM_CFLAGS, AM_LDFLAGS or such, and in Makefile.{in,am}'s use those variables together with CFLAGS/LDFLAGS (I believe this is automatic with autotools) and the *-config tool should only start reporting AM_CFLAGS and co, and NOT CFLAGS/LDFLAGS.
Otherwise icu-config is reporting things mostly out of /etc/make.conf, overriding what is asked for the compilation of an application that happens to use icu.
The most unpleasant side-effect is that --as-needed LDFLAGS can't be succesfully filtered out by applications/libraries that break with it, because icu-config forces it onto them regardless of any strip-ldflags in the ebuild.

In summary again, such *-config --cflags and *-config --ldflags should never report what was passed as CFLAGS, LDFLAGS and so on by the user (portage in our case), but only what is found necessary by the configure script.

I'd be happy to explain this further if necessary, here or preferably over IRC (leio).
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-12-12 20:33:46 UTC
Considering we apply exactly *zero* patches to this, if you can reproduce it w/ 3.8 [1] then send this upstream please.

[1] http://overlays.gentoo.org/svn/proj/php/testing/migration/dev-libs/icu/
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-12-14 11:05:04 UTC
Still broken in 3.8.1. A quick fix is in the overlay and will get to the tree whenever Bug 200010 is fixed. Also, 
THREADSCPPFLAGS="-D_REENTRANT" is apparently never reported with --cppflags as it's definited in a wrong place, I really don't care enough ATM.

# for i in cflags{,-dynamic} cxxflags{,-dynamic} cppflags{,-dynamic,-searchpath} ldflags{,-layout,-libsonly,-searchpath,-system,-icuio,-obsolete} ; do echo ${i}: $(icu-config --${i}) ; done

cflags:
cflags-dynamic: -fPIC
cxxflags:
cxxflags-dynamic: -fPIC
cppflags: -I/usr/include
cppflags-dynamic: -DPIC
cppflags-searchpath: -I/usr/include
ldflags: -lpthread -lm -L/usr/lib -licui18n -licuuc -licudata -lpthread -lm
ldflags-layout: -licule -liculx
ldflags-libsonly: -licui18n -licuuc -licudata
ldflags-searchpath: -L/usr/lib
ldflags-system: -lpthread -lm
ldflags-icuio: -licuio
ldflags-obsolete: -licuobsolete

Whatever, please report this stuff upstream: http://bugs.icu-project.org/trac/
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-01-04 13:41:14 UTC
Fixed in dev-libs/icu-3.8.1
Comment 4 Steven R. Loomis 2013-10-15 21:41:17 UTC
(In reply to Jakub Moc (RETIRED) from comment #3)
> Fixed in dev-libs/icu-3.8.1

sorry that I missed this.

Please use the pkg-config and NOT the icu-config files. If you must use icu-config , just use --cppflags and not any other options.