summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2002-12-06 06:25:58 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2002-12-06 06:25:58 +0000
commitc7078611fcf9abc940f49c269f60119577792220 (patch)
tree4b54c2f3e2cb201242920889b20c80b39e622d85 /cpukit
parent2002-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-c7078611fcf9abc940f49c269f60119577792220.tar.bz2
2002-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Add various checks to enhance portability. * src/termios.c: Reflect changes to configure.ac.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libcsupport/ChangeLog5
-rw-r--r--cpukit/libcsupport/configure.ac29
-rw-r--r--cpukit/libcsupport/src/termios.c32
3 files changed, 55 insertions, 11 deletions
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 <corsepiu@faw.uni-ulm.de>
+
+ * configure.ac: Add various checks to enhance portability.
+ * src/termios.c: Reflect changes to configure.ac.
+
2002-12-02 Joel Sherrill <joel@OARcorp.com>
* 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 <limits.h>])
AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
+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 <termios.h>])
+AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
+## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
+AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
+AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
+AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
+AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
+AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
+## SUSV3-XSI extension
+AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
+
+## BSD-ism, excluded from POSIX, but available on most platforms
+AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
+
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