Update 'configure' for libiconv detection; only set HAVE_ICONV_H if header exists *and* an impl we can link with exists.
This commit is contained in:
parent
add9c7f6b9
commit
778c397d48
|
@ -5308,7 +5308,7 @@ fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
for ac_header in unistd.h syslog.h iconv.h langinfo.h sys/statfs.h
|
for ac_header in unistd.h syslog.h langinfo.h sys/statfs.h
|
||||||
do :
|
do :
|
||||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||||
|
@ -6103,6 +6103,118 @@ fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -lc" >&5
|
||||||
|
$as_echo_n "checking for iconv in -lc... " >&6; }
|
||||||
|
if ${ac_cv_lib_c_iconv+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-lc $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char iconv ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return iconv ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_c_iconv=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_c_iconv=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_iconv" >&5
|
||||||
|
$as_echo "$ac_cv_lib_c_iconv" >&6; }
|
||||||
|
if test "x$ac_cv_lib_c_iconv" = xyes; then :
|
||||||
|
|
||||||
|
for ac_header in iconv.h
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_iconv_h" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_ICONV_H 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5
|
||||||
|
$as_echo_n "checking for iconv in -liconv... " >&6; }
|
||||||
|
if ${ac_cv_lib_iconv_iconv+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-liconv $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char iconv ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return iconv ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_iconv_iconv=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_iconv_iconv=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5
|
||||||
|
$as_echo "$ac_cv_lib_iconv_iconv" >&6; }
|
||||||
|
if test "x$ac_cv_lib_iconv_iconv" = xyes; then :
|
||||||
|
|
||||||
|
LIBS="-liconv $LIBS"
|
||||||
|
for ac_header in iconv.h
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_iconv_h" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_ICONV_H 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ac_ext=cpp
|
ac_ext=cpp
|
||||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||||
|
|
|
@ -64,7 +64,7 @@ AC_CHECK_HEADERS(sys/mount.h,,,
|
||||||
#endif
|
#endif
|
||||||
]])
|
]])
|
||||||
AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h)
|
AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h)
|
||||||
AC_CHECK_HEADERS(unistd.h syslog.h iconv.h langinfo.h sys/statfs.h)
|
AC_CHECK_HEADERS(unistd.h syslog.h langinfo.h sys/statfs.h)
|
||||||
AC_CHECK_HEADERS(signum.h bits/signum.h, break )
|
AC_CHECK_HEADERS(signum.h bits/signum.h, break )
|
||||||
AC_CHECK_HEADERS(stdarg.h varargs.h, break )
|
AC_CHECK_HEADERS(stdarg.h varargs.h, break )
|
||||||
|
|
||||||
|
@ -128,9 +128,12 @@ AC_CHECK_LIB(c, gethostbyname, [:], [
|
||||||
]) ])
|
]) ])
|
||||||
|
|
||||||
dnl iconv? check the usual locations
|
dnl iconv? check the usual locations
|
||||||
AC_CHECK_LIB(c, iconv, [:], [
|
AC_CHECK_LIB(c, iconv, [
|
||||||
|
AC_CHECK_HEADERS(iconv.h)
|
||||||
|
], [
|
||||||
AC_CHECK_LIB(iconv, iconv, [
|
AC_CHECK_LIB(iconv, iconv, [
|
||||||
LIBS="-liconv $LIBS"
|
LIBS="-liconv $LIBS"
|
||||||
|
AC_CHECK_HEADERS(iconv.h)
|
||||||
], [:]) ])
|
], [:]) ])
|
||||||
|
|
||||||
dnl check for stl library
|
dnl check for stl library
|
||||||
|
|
Loading…
Reference in New Issue