-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 These patches to libshout and shout.m4 reduce the level of self-hatred significantly. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRX7anAAoJEOs4Jb6SI2Cw2VgH/RDFPJjXdds1Cq3c0QyVyWs4 JWhPw2SI4vNGHF6U2q/DJQeBtsyY5BiUGckdew8skR5q0qc3D7iqBG5kiSC+G3Aq ElBiBmx0vDe13MdRfeAFkesPisPPLP3g6wsrHQxKSh0vm89PAQGwkXIPTeSAemw6 1zi3wPB9MH4rFNqjrRx8LgSlvS+bayrky1PJ5DAaLpfEBq3p6cOWJKLh3m8RlQqp y5Tn7f2jqsKc9uXea2bd9PjMK3vGKEixilZZ+qvRDuijsV/Hdrb0U4pyv2mYMhbX W9dcFc2JPm6OTJU4f7NqrB1yIs3LsR7fCbBvsiBsfF1n8udyFm5T08zrVOI4yjw=WrDt -----END PGP SIGNATURE----- -------------- next part -------------- Index: configure.ac ==================================================================--- configure.ac (revision 18912) +++ configure.ac (working copy) @@ -175,28 +175,15 @@ fi AM_CONDITIONAL([HAVE_PKGCONFIG], [test "$PKGCONFIG" != "no"]) # Collect flags for shout.pc - -# I hate myself for doing this. -save_prefix="$prefix" -if test "$prefix" = "NONE" -then - prefix="$ac_default_prefix" -fi -eval shout_includedir="$includedir" -prefix="$save_prefix" - SHOUT_VERSION="$VERSION" -SHOUT_CPPFLAGS="-I$shout_includedir $VORBIS_CFLAGS $PTHREAD_CPPFLAGS" -SHOUT_CFLAGS="$PTHREAD_CFLAGS" +SHOUT_CFLAGS="$VORBIS_CFLAGS $PTHREAD_CFLAGS" SHOUT_LIBS="-lshout" -XIPH_CLEAN_CCFLAGS([$SHOUT_CPPFLAGS], [SHOUT_CPPFLAGS]) XIPH_CLEAN_CCFLAGS([$SHOUT_CFLAGS], [SHOUT_CFLAGS]) XIPH_CLEAN_CCFLAGS([$VORBIS_LIBS $THEORA_LIBS $SPEEX_LIBS $PTHREAD_LIBS $LIBS], [SHOUT_LIBDEPS]) AC_SUBST(PTHREAD_CPPFLAGS) AC_SUBST(SHOUT_LIBDEPS) AC_SUBST(SHOUT_REQUIRES) -AC_SUBST(SHOUT_CPPFLAGS) AC_SUBST(SHOUT_CFLAGS) dnl Make substitutions Index: shout.pc.in ==================================================================--- shout.pc.in (revision 18912) +++ shout.pc.in (working copy) @@ -4,8 +4,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -cppflags=@SHOUT_CPPFLAGS@ -cflags_only=@SHOUT_CFLAGS@ Name: Shout Description: Audio streaming library for icecast encoders -------------- next part -------------- Index: shout.m4 ==================================================================--- shout.m4 (revision 18912) +++ shout.m4 (working copy) @@ -27,8 +27,8 @@ export PKG_CONFIG_PATH AC_PATH_PROG([PKGCONFIG], [pkg-config], [no]) if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout` then - SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout` - SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout` + SHOUT_CFLAGS=`$PKGCONFIG --cflags-only-other shout` + SHOUT_CPPFLAGS=`$PKGCONFIG --cflags-only-I shout` SHOUT_LIBS=`$PKGCONFIG --libs shout` xt_have_shout="maybe" else
"Thomas B. Rücker"
2013-Apr-06 08:57 UTC
[Icecast-dev] Don't hate yourself anymore, brendan
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? Thanks in advance! Thomas B. Ruecker
-----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-----