[Iftop-users] libtinfo compatibility patch
justin
jlec at gentoo.org
Mon, 20 Jan 2014 15:21:28 +0100
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--jTH5t4LJor7VCNftXqrV5sW6eiglArnR1
Content-Type: multipart/mixed;
boundary="------------010304020303070709010001"
This is a multi-part message in MIME format.
--------------010304020303070709010001
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
if libncurses if build with split out libtinfo as done in many distros
we need to link against both libs. Please find attached a patch which
utilizes pkg-conifg to detect the correct libs to link with. If that
fails it falls back to the original configure structure.
Regards,
Justin
--------------010304020303070709010001
Content-Type: text/x-patch;
name="iftop-1.0_pre4-tinfo.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="iftop-1.0_pre4-tinfo.patch"
Makefile.am | 2 +-
configure.ac | 18 +++++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 1a9320c..a9bd7f1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,7 +25,7 @@ iftop_SOURCES =3D addr_hash.c edline.c hash.c iftop.c n=
s_hash.c \
# addrs_ioctl.c addrs_dlpi.c dlcommon.c \
# stringmap.c cfgfile.c=20
=20
-
+iftop_LDADD =3D $(NCURSES_LIBS)
=20
noinst_HEADERS =3D addr_hash.h ether.h ethertype.h extract.h hash.h ifto=
p.h \
integers.h ip.h llc.h ns_hash.h options.h resolver.h \
diff --git a/configure.ac b/configure.ac
index 671241e..83352c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,19 +348,23 @@ dnl a solid chance that mvchgat is a macro, so we c=
an't just use
dnl AC_SEARCH_LIBS....
dnl
=20
-AC_MSG_CHECKING([for a curses library containing mvchgat])
-oldLIBS=3D$LIBS
-for curseslib in ncursesw curses ncurses ; do
- LIBS=3D"$oldLIBS -l$curseslib"
- AC_TRY_LINK([
+PKG_CHECK_MODULES([NCURSES], [ncursesw], [foundcurseslib=3D"$NCURSES_LIB=
S"], [
+ PKG_CHECK_MODULES([NCURSES], [ncurses], [foundcurseslib=3D"$NCURSES_=
LIBS"], [
+ AC_MSG_CHECKING([for a curses library containing mvchgat])
+ oldLIBS=3D$LIBS
+ for curseslib in ncursesw curses ncurses ; do
+ LIBS=3D"$oldLIBS -l$curseslib"
+ AC_TRY_LINK([
#include <$curseslib.h>
], [
mvchgat(0, 0, 1, A_REVERSE, 0, NULL)
], [
- foundcurseslib=3D$curseslib
+ foundcurseslib=3D-l$curseslib
break
])
-done
+ done
+ ])
+])
=20
if test x$foundcurseslib =3D x ; then
AC_MSG_RESULT([none found])
--------------010304020303070709010001--
--jTH5t4LJor7VCNftXqrV5sW6eiglArnR1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCgAGBQJS3TDoAAoJELnU8jG9FVirH6gP/0wnBMEfkswmGg4hkqcgj07V
kzPuZCN0Octt5xmz+7hpv6I0xoJ73iKP7868f2H04il3sMuFyLQXLNJ/DEDE8Rpd
3E+NqvJdAo+ClmUpRO2bHbCEb6P7PnbAkJx9MJSmfoVM7eMzQuoAdTTqw5lgNh1g
oJvhHqErLmJzP8VE2i/JqhSDkyL8mAK+33n7kU0BLw6jp/4jHPTAX8+yEmsMdMYw
hb2VLKmVtBD8kKFnOeW5VJ8cBu3cyL65VlL4L/PE0FwhepMgto+dCYhtpNf6Kgpc
cAmYDdaCpFw8j/26DWfc83jdg8mlWKNU8Ge2DHaYXvKAT+hSirVUVZGCfW6l8FyJ
Sqtx8ICUxPJemLRhi4r4Cvj+PX/YPS1ZykYvAPVr2YcJr3OVzSHuRkH4l+IlIabd
HAaEsALh6TPrHXz1fwFCiBvNyWuAemYfs/CZn6DwVHBM6iOCI+RW10wQkahFT7Sk
Lh33gaLnQoda5thWw2NL/Mo3E9BUV954bmbfTrpb92kWC36cysfekbIVas8Rmnhv
kwTT5IAoviO0rBoj5HRBgq71/5day19demNj+P+dmzmgLShq8ILgJ/vm+L9O1Pw/
EV2QtR8ZuK099LD7BdYUxKbLuMWXzOJOwWHw/CZF+15d+LOgQdqi/uzyKJo6UwNc
ASdAIRACU4Sr8vdjsYln
=hJFR
-----END PGP SIGNATURE-----
--jTH5t4LJor7VCNftXqrV5sW6eiglArnR1--