[Icecast-dev] Don't hate yourself anymore, brendan

LRN lrn1986 at gmail.com
Sat Apr 6 07:03:39 PDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06.04.2013 12:57, "Thomas B. Rücker" wrote:
> Hi LRN,
> 
> On 04/06/2013 05:46 AM, LRN wrote:
>> These patches to libshout and shout.m4 reduce the level of
>> self-hatred significantly.
> 
> Thanks for your patch. I appreciate your care for Brendan's peace
> of mind, sadly it looks like he's not been active in the libshout
> context for the last few years. I hope it was not this code which
> led to that. ;-)
> 
> My dilemma is, that I'm not exactly sure what your patch does and
> if it potentially breaks anything with regard to e.g. older systems
> or platforms. Would you mind to explain briefly what this does /
> fixes / improves?
> 
It removes the hackery around cppflags and cflags.
AFAIU, the original intent was to use --variable=cflags_only in
shout.m4 to get only cflags ($PTHREAD_CFLAGS), while
- --variable=cppflags would get $VORBIS_CFLAGS $PTHREAD_CPPFLAGS and
- -I$shout_includedir (the last one is the important bit here).

My problem with that approach (which totally works) is that
- -I$shout_includedir is hardcoded into .pc file.
On my platform it looks like -I/mingw/include, and that's a normal
include directory for gcc.
However, pkg-config has some code to NOT to return such flags when
asked (i.e. it would strip normal gcc include directories from what it
returns). Without that, the -I/mingw/include would leak into other .pc
files (for dependencies), because people usually just pkg-config
- --cflags, and then put that output, with some additions, into .pc.
That special code does not get invoked with --variable is used.

Also, hardcoding /mingw into .pc files looks wrong (${prefix} should
be used in place of /mingw).

Maybe it could be fixed by pre-processing -I$shout_includedir (see if
it is the same as default gcc include, and omit it in that case), but
i decided to fix the root of the problem, and to strike at the weird
- --variable usage. This patch makes it use --cflags-only-I to only grab
include directories (what --variable=cppflags used to do), and
- --cflags-only-other to grab all cflags that are not -I (what
- --variable=cflags_only used to do).

As a side effect, it removes the need to obtain $shout_includedir, and
thus allows me to remove the code that had so much hatred in it :)

The --cflags-only-I and --cflags-only-other are available since
pkg-config 0.15.
The only problem, AFAICS, is using new variableless .pc file with old
versions of shout.m4 (which other projects may keep in their source
trees, unupdated).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRYCs5AAoJEOs4Jb6SI2Cw7kUH/1dotlKglLmcWSAbSygT7CB+
ZT/IC/7Wxp6UoBI8L2HE07JzIE1BBsDHFKwjtEW5ULsDq+G7HO+LDsak7caJEM11
fGMYg9JYr1VY/eZthI6rg/U1YgWDOvlXMH5CvouerFgKk6earcSLD1vTM1Bu7/8e
Hry8VAY2VQ/t83COzRQsT/QsRo9eaAo05gdK409s9zDnNGA4EHJMQg5GdEZNz1EG
Jc9lRQWF/yco5+1WLpqV6IPOLdOrN1Ibo6If+awxJvLhua31KIJcwWKu5COH/V9V
bY5taUsgSR7PbMkQpnL2RpVPX1zB215u5xnc5uZ+a1FESCjOOCAYN5Mtx8GZaRc=
=zJmC
-----END PGP SIGNATURE-----


More information about the Icecast-dev mailing list