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>
This commit is contained in:
Sebastian Kemper 2020-06-11 19:27:48 +02:00
parent ea6d48b680
commit edbeb1b9a3
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/wdoekes/asterisk-chan-dongle.git
PKG_SOURCE_VERSION:=328b2b7ded3b3c59c2e6c7e7afca6b0ac6f146ce
PKG_SOURCE_DATE=2020-05-28
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MIRROR_HASH:=b0af444840340722ecee111a7b1f819de441acf290799ae11bc18e16569c6388
PKG_FIXUP:=autoreconf

View file

@ -5,7 +5,7 @@
dnl Checks for libraries.
dnl AC_CHECK_LIB([pthread], [pthread_create]) # should use ast_pthread_join everywhere?
-AC_SEARCH_LIBS([iconv], [c iconv],,AC_MSG_ERROR([iconv library missing]))
+AC_CHECK_LIB([iconv], [iconv],,AC_MSG_ERROR([iconv library missing]))
+AC_SEARCH_LIBS([libiconv], [iconv],,AC_MSG_ERROR([iconv library missing]))
AC_CHECK_LIB([sqlite3], [sqlite3_open],,AC_MSG_ERROR([sqlite3 library missing]))
dnl Checks for header files.