ex_check_save_CPPFLAGS=${CPPFLAGS}
ex_check_save_LDFLAGS=${LDPFLAGS}
if test "x$7" != "x"; then
- CPPFLAGS="-I$7 $CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$7"
fi
dnl try compiling naked first
AC_CHECK_LIB($1,$2, [
LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l $4`
dnl remove the cached value and test again
unset ac_cv_lib_$1_$2
- AC_CHECK_LIB($1,$2,[ AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[])],[])
+ AC_CHECK_LIB($1,$2,[
+ unset ac_cv_header_`echo $3 | sed "s/[^a-z]/_/"`
+ AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[])
+ ],[])
else
AC_MSG_WARN([
----------------------------------------------------------------------------
dnl Checks for libraries.
AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos))
+dnl Use libiconv if we have one but fall back to libc otherwhise
+AC_CHECK_LIB(iconv, iconv_open, , [
+ AC_CHECK_FUNC(iconv_open,,)
+ ])
dnl add pic flag in any case this makes sure all our code is relocatable
eval `./libtool --config | grep pic_flag`