dnl iconv support (might fail in case of non-default iconv installation)
dnl
AC_SUBST(USE_ICONV)
+AC_SUBST(ICONV_LDFLAGS)
+ICONV_LDFLAGS=
USE_ICONV=1
AC_ARG_WITH(iconv,
[ --without-iconv disable unicode support],
)
if test "$USE_ICONV" = 1; then
- AC_CHECK_LIB(c, iconv_open,
+ AC_CHECK_LIB(iconv, iconv_open,
USE_ICONV=1
+ ICONV_LDFLAGS=-liconv
,
- USE_ICONV=0
+ AC_CHECK_LIB(iconv, iconv_open,
+ USE_ICONV=1
+ ,
+ USE_ICONV=0
+ )
)
fi
if test $USE_PROJ -gt 0; then
AC_MSG_RESULT([ PROJ: dir=$PROJ_DIR])
fi
-AC_MSG_RESULT([ ICONV: $USE_ICONV])
+AC_MSG_RESULT([ ICONV: $USE_ICONV $ICONV_LDFLAGS])
dnl AC_MSG_RESULT([ FLEX: path=$FLEX])
dnl AC_MSG_RESULT([ YACC: path=$YACC])
ifeq ($(USE_ICONV),1)
override CFLAGS += -DUSE_ICONV
+ override LDFLAGS += $(ICONV_LDFLAGS)
endif
override CFLAGS := -g -Wall -I.. $(CFLAGS) -DUSE_VERSION=$(USE_VERSION)