# replaced with Check's replacement of these functions.
HW_LIBRT_TIMERS
-AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r putenv setenv sleep strdup strsignal unsetenv])
-AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv])
+# The following checks will replace missing functions from libcompat
+AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r putenv sleep strdup strsignal unsetenv])
+AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, putenv, sleep, strdup, strsignal, unsetenv])
+
+# The following checks are to only detect if the functions exist, but
+# not replace them
+AC_CHECK_DECLS([setenv])
AC_CHECK_FUNCS([setitimer])
set(SOURCES ${SOURCES} realloc.c)
endif(NOT HAVE_REALLOC)
-if(NOT HAVE_DECL_SETENV)
- set(SOURCES ${SOURCES} setenv.c)
-endif(NOT HAVE_DECL_SETENV)
-
if(NOT HAVE_DECL_SLEEP)
set(SOURCES ${SOURCES} sleep.c)
endif(NOT HAVE_DECL_SLEEP)
#define putenv _putenv;
#endif /* HAVE_DECL_PUTENV && !HAVE__PUTENV */
-#if !HAVE_DECL_SETENV
-CK_DLL_EXP int setenv (const char *name, const char *value, int overwrite);
-#endif /* !HAVE_DECL_SETENV */
-
#if !HAVE_DECL_SLEEP
CK_DLL_EXP unsigned int sleep (unsigned int seconds);
#endif /* !HAVE_DECL_SLEEP */