From c7078611fcf9abc940f49c269f60119577792220 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Fri, 6 Dec 2002 06:25:58 +0000 Subject: 2002-12-06 Ralf Corsepius * configure.ac: Add various checks to enhance portability. * src/termios.c: Reflect changes to configure.ac. --- cpukit/libcsupport/ChangeLog | 5 +++++ cpukit/libcsupport/configure.ac | 29 +++++++++++++++++++++++++++++ cpukit/libcsupport/src/termios.c | 32 +++++++++++++++++++++----------- 3 files changed, 55 insertions(+), 11 deletions(-) (limited to 'cpukit') diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog index 8c2d787efc..99e81c45aa 100644 --- a/cpukit/libcsupport/ChangeLog +++ b/cpukit/libcsupport/ChangeLog @@ -1,3 +1,8 @@ +2002-12-06 Ralf Corsepius + + * configure.ac: Add various checks to enhance portability. + * src/termios.c: Reflect changes to configure.ac. + 2002-12-02 Joel Sherrill * include/rtems/libio.h: Internally use a union of an unsigned64 diff --git a/cpukit/libcsupport/configure.ac b/cpukit/libcsupport/configure.ac index 5294b41ed1..ff33062572 100644 --- a/cpukit/libcsupport/configure.ac +++ b/cpukit/libcsupport/configure.ac @@ -43,6 +43,35 @@ AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[ AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include ]) AC_CHECK_DECLS([CHAR_BIT],,,[#include ]) +AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[ +ac_cv_have_decl_XTABS=yes +ac_cv_have_decl_OLCUC=yes +## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD) +ac_cv_have_decl_ONLRET=yes +ac_cv_have_decl_ONOCR=yes +ac_cv_have_decl_TABDLY=yes +ac_cv_have_decl_OCRNL=yes +ac_cv_have_decl_IUCLC=yes +## SUSV3-XSI extension +ac_cv_have_decl_ECHOPRT=yes +]) + +# FIXME: Some cruft to work around portability issues with termios.c +## Seemingly not covered by any standard. +AC_CHECK_DECLS([XTABS],,,[#include ]) +AC_CHECK_DECLS([OLCUC],,,[#include ]) +## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD) +AC_CHECK_DECLS([ONLRET],,,[#include ]) +AC_CHECK_DECLS([ONOCR],,,[#include ]) +AC_CHECK_DECLS([TABDLY],,,[#include ]) +AC_CHECK_DECLS([OCRNL],,,[#include ]) +AC_CHECK_DECLS([IUCLC],,,[#include ]) +## SUSV3-XSI extension +AC_CHECK_DECLS([ECHOPRT],,,[#include ]) + +## BSD-ism, excluded from POSIX, but available on most platforms +AC_CHECK_DECLS([sbrk],,,[#include ]) + AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"]) AM_CONFIG_HEADER([src/config.h]) diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 25b8f00c9a..c8af569600 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -34,23 +34,33 @@ /* * FreeBSD does not support a full POSIX termios so we have to help it out */ - -#if defined(__FreeBSD__) +#if !HAVE_DECL_XTABS #define XTABS 0 +#endif + +#if !HAVE_DECL_ONLRET #define ONLRET 0 -#define ONOCR 0 +#endif +#if !HAVE_DECL_ONOCR +#define ONOCR 0 +#endif +#if !HAVE_DECL_TABDLY #define TABDLY 0 -#define OLCUC 0 -#define ILCUC 0 -#define OCRNL 0 +#endif +#if !HAVE_DECL_OLCUC +#define OLCUC 0 +#endif +#if !HAVE_DECL_ILCUC +#define ILCUC 0 +#endif +#if !HAVE_DECL_OCRNL +#define OCRNL 0 +#endif +#if !HAVE_DECL_IUCLC #define IUCLC 0 #endif -/* - * Cygwin does not define these - */ - -#if defined(__CYGWIN__) +#if !HAVE_DECL_ECHOPRT #define ECHOPRT 0 #endif -- cgit v1.2.3