set(SOURCES libcompat.c)
-if(NOT HAVE_DECL_FILENO OR HAVE__FILENO)
+if(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO)
set(SOURCES ${SOURCES} fileno.c)
-endif(NOT HAVE_DECL_FILENO OR HAVE__FILENO)
+endif(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO)
if(NOT HAVE_GETTIMEOFDAY)
set(SOURCES ${SOURCES} gettimeofday.c)
set(SOURCES ${SOURCES} malloc.c)
endif(NOT HAVE_MALLOC)
-if(NOT HAVE_DECL_PIPE)
+if(NOT HAVE_DECL_PIPE AND NOT HAVE__PIPE)
set(SOURCES ${SOURCES} pipe.c)
-endif(NOT HAVE_DECL_PIPE)
+endif(NOT HAVE_DECL_PIPE AND NOT HAVE__PIPE)
-if(NOT HAVE_DECL_PUTENV)
+if(NOT HAVE_DECL_PUTENV AND NOT HAVE__PUTENV)
set(SOURCES ${SOURCES} putenv.c)
-endif(NOT HAVE_DECL_PUTENV)
+endif(NOT HAVE_DECL_PUTENV AND NOT HAVE__PUTENV)
if(NOT HAVE_REALLOC)
set(SOURCES ${SOURCES} realloc.c)
set(SOURCES ${SOURCES} sleep.c)
endif(NOT HAVE_DECL_SLEEP)
-if(NOT HAVE_DECL_STRDUP)
+if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
set(SOURCES ${SOURCES} strdup.c)
-endif(NOT HAVE_DECL_STRDUP)
+endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
if(NOT HAVE_DECL_STRSIGNAL)
set(SOURCES ${SOURCES} strsignal.c)