-AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
-ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
-alarm access fork execl wait setmode execve pipe dup2 close \
-strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
-getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
-readlink getgid getpid getppid getuid geteuid umask getegid \
-secure_getenv __secure_getenv)
+if test "${hardwire_newlib:-0}" -eq 1; then
+ # We are being configured with a cross compiler. AC_REPLACE_FUNCS
+ # may not work correctly, because the compiler may not be able to
+ # link executables.
+ AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.])
+ AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.])
+ AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.])
+ AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.])
+ AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.])
+ AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.])
+ AC_DEFINE(HAVE_STRNLEN, 1, [Define if you have strnlen.])
+ AC_DEFINE(HAVE_STRNDUP, 1, [Define if you have strndup.])
+
+ # At some point, we should differentiate between architectures
+ # like x86, which have long double versions, and alpha/powerpc/etc.,
+ # which don't. For the time being, punt.
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
+ fi
+else
+ AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
+ ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
+ alarm access fork setmode fcntl \
+ gettimeofday stat fstat lstat getpwuid vsnprintf dup \
+ getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
+ getgid getpid getuid geteuid umask getegid \
+ secure_getenv __secure_getenv mkostemp strnlen strndup newlocale \
+ freelocale uselocale strerror_l)
+fi