asterisk-chan-dongle: fix iconv lib detection 540/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Thu, 11 Jun 2020 17:27:48 +0000 (19:27 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Thu, 11 Jun 2020 17:27:51 +0000 (19:27 +0200)
commitedbeb1b9a30153b06cbb8120cdd718e1ac0ba7d2
tree4889137aed7a80cc4d70f6220cae017633556e43
parentea6d48b680b97beac03a9cacfded4237d732e4d6
asterisk-chan-dongle: fix iconv lib detection

A small but important oversight crept into the last asterisk-chan-dongle
update. The iconv library detection was changed to look for iconv()
instead of libiconv().

Reminder: the autoconf macros for finding libraries do _not_ include any
extra headers when testing the compile. So the redefinitions done in
iconv.h provided by any libiconv (stub or regular) aren't visible during
the test the macros execute.

This means that when testing for iconv() the only iconv that can be
detected is the one from libc. Moreover, if the libc doesn't provide
iconv, the check will fail. Below example is with uclibc:

checking for iconv in -liconv... no
configure: error: iconv library missing
Makefile:87: recipe for target '/builder/shared-workdir/build/sdk/build_dir/target-arc_archs_uClibc/asterisk-chan-dongle-asterisk16/asterisk-chan-dongle-2020-05-28-328b2b7d/.configured_a17fb5ef857664f03cd0ce37cc5ea591' failed

So, this changes the patch to look for libiconv(), again.

Also, instead of using AC_CHECK_LIB this uses AC_SEARCH_LIBS, like
upstream does. There apparently was a problem with that in the past, but
now it works fine.

checking for rm... rm
checking for library containing libiconv... -liconv
checking for sqlite3_open in -lsqlite3... yes

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk-chan-dongle/Makefile
net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch