diff options
author | Jim Meyering <jim@meyering.net> | 2001-08-04 16:55:58 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-08-04 16:55:58 +0000 |
commit | f2e49308014203746fc46a75e958be2470b99434 (patch) | |
tree | 52a562ac939a1d2c1804355c3e68ab5e168172c8 /m4 | |
parent | 697d5aade0e9093680fb7f717bc8316cdd74601d (diff) | |
download | coreutils-f2e49308014203746fc46a75e958be2470b99434.tar.xz |
Upgrade to serial AM2.
(AM_ICONV): Renamed from jm_ICONV; all uses changed.
Add --with-libconv-prefix.
Quote first arg of AC_DEFUN. Add description for ICONV_CONST.
(am_cv_func_iconv): Renamed from jm_cv_func_iconv.
(am_cv_lib_iconv): Renamed from jm_cv_lib_iconv.
(am_cv_proto_iconv): Renamed from jm_cv_proto_iconv.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/iconv.m4 | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 2ff196212..17237344a 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,37 +1,46 @@ -#serial 3 +#serial AM2 dnl From Bruno Haible. -AC_DEFUN(jm_ICONV, +AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). - AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [ - jm_cv_func_iconv="no, consider installing GNU libiconv" - jm_cv_lib_iconv=no + + AC_ARG_WITH([libiconv-prefix], +[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + ]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - jm_cv_func_iconv=yes) - if test "$jm_cv_func_iconv" != yes; then - jm_save_LIBS="$LIBS" + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - jm_cv_lib_iconv=yes - jm_cv_func_iconv=yes) - LIBS="$jm_save_LIBS" + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" fi ]) - if test "$jm_cv_func_iconv" = yes; then + if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(jm_cv_proto_iconv, [ + AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include <stdlib.h> #include <iconv.h> @@ -40,20 +49,20 @@ extern "C" #endif #if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft); +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif -], [], jm_cv_proto_iconv_arg1="", jm_cv_proto_iconv_arg1="const") - jm_cv_proto_iconv="extern size_t iconv (iconv_t cd, $jm_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"]) - jm_cv_proto_iconv=`echo "[$]jm_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- - }[$]jm_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $jm_cv_proto_iconv_arg1, + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= - if test "$jm_cv_lib_iconv" = yes; then + if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi AC_SUBST(LIBICONV) |