summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-13 15:15:28 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-13 15:15:28 +0000
commita5777f043d742b107d5aaaf9cb92249c11ae859b (patch)
treee8c83e1a0300b87f122cddf27541643010d819fb /cpukit
parent2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-a5777f043d742b107d5aaaf9cb92249c11ae859b.tar.bz2
2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org>
* configure.ac: Rework stdint.h/inttypes.h support. Add RTEMS_USES_STDINT_H. Add RTEMS_USES_INTTYPES_H. Remove NEED_STDINT_H. Remove NEED_INTTYPES_H. Remove termios-flag detection. * libcsupport/Makefile.am: Install include/stdint.h and include/inttypes.h for NEWLIB only. * libcsupport/include/stdint.h: Rework; Now newlib specific. * libcsupport/src/termios.c: Make newlib specific. * include/rtems/stdint.h: Rework; Now wrapper to <stdint.h>.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog12
-rw-r--r--cpukit/configure.ac59
-rw-r--r--cpukit/include/rtems/stdint.h41
-rw-r--r--cpukit/libcsupport/Makefile.am9
-rw-r--r--cpukit/libcsupport/include/stdint.h15
-rw-r--r--cpukit/libcsupport/src/termios.c33
6 files changed, 80 insertions, 89 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 62db9052fe..301acf8e26 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org>
+
+ * configure.ac: Rework stdint.h/inttypes.h support.
+ Add RTEMS_USES_STDINT_H. Add RTEMS_USES_INTTYPES_H.
+ Remove NEED_STDINT_H. Remove NEED_INTTYPES_H.
+ Remove termios-flag detection.
+ * libcsupport/Makefile.am: Install include/stdint.h and
+ include/inttypes.h for NEWLIB only.
+ * libcsupport/include/stdint.h: Rework; Now newlib specific.
+ * libcsupport/src/termios.c: Make newlib specific.
+ * include/rtems/stdint.h: Rework; Now wrapper to <stdint.h>.
+
2004-04-12 Ralf Corsepius <ralf_corsepius@rtems.org>
* acinclude.m4 (RTEMS_CPUOPT): Use AC_DEFINE_UNQUOTED.
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index e487857085..5611088853 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -88,6 +88,17 @@ AC_CHECK_FUNCS([strsep strcasecmp snprintf])
AC_CHECK_FUNCS([bcopy bcmp])
AC_CHECK_FUNCS([isascii fileno])
+## Check if the installed toolchain has these headers
+AC_CHECK_HEADER(stdint.h)
+AC_CHECK_HEADER(inttypes.h)
+
+AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
+ RTEMS_USES_STDINT_H=yes
+ RTEMS_USES_INTTYPES_H=yes],[
+ RTEMS_USES_STDINT_H=$ac_cv_header_stdint_h
+ RTEMS_USES_INTTYPES_H=$ac_cv_header_inttypes_h
+])
+
AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
## FIXME: This check is doubtful
AS_IF([test "$HAS_MP" = "yes"],
@@ -160,6 +171,16 @@ RTEMS_CPUOPT([RTEMS_UNIXLIB],
[1],
[to indicate RTEMS using RTEMS's unixlib])
+RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
+ [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
+ [1],
+ [if RTEMS uses stdint.h])
+
+RTEMS_CPUOPT([RTEMS_USES_INTTYPES_H],
+ [test x"${RTEMS_USES_INTTYPES_H}" = x"yes"],
+ [1],
+ [if RTEMS uses inttypes.h])
+
RTEMS_CPUOPT([RTEMS_VERSION],
[true],
["]_RTEMS_VERSION["],
@@ -227,47 +248,11 @@ AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
-AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
-## Provide headers only if the host doesn't.
- AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
- AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
-],[
-## Using newlib, we provide sys/cdefs.h
- NEED_STDINT_H=yes
- NEED_INTTYPES_H=yes
-])
-
# FIXME: These checks are only in here to provide
# configuration-time diagnostics and are not really used.
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>])
@@ -297,8 +282,6 @@ AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
-AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
-AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
diff --git a/cpukit/include/rtems/stdint.h b/cpukit/include/rtems/stdint.h
index 0922d45d1c..5703f4273f 100644
--- a/cpukit/include/rtems/stdint.h
+++ b/cpukit/include/rtems/stdint.h
@@ -13,20 +13,39 @@
extern "C" {
#endif
-#include <rtems/score/types.h>
+#include <rtems/score/cpuopts.h>
+#if RTEMS_USES_STDINT_H
+#include <stdint.h>
+
+#elif RTEMS_USES_INTTYPES_H
+#include <inttypes.h>
+
+#else
/*
- * map RTEMS internal types onto C99 types
+ * Wild guesses on systems not providing stdint.h nor inttypes.h
+ * Known to work on Cywgin-1.3
*/
-typedef signed8 int8_t;
-typedef signed16 int16_t;
-typedef signed32 int32_t;
-typedef signed64 int64_t;
-
-typedef unsigned8 uint8_t;
-typedef unsigned16 uint16_t;
-typedef unsigned32 uint32_t;
-typedef unsigned64 uint64_t;
+
+#include <sys/types.h>
+
+#if !defined(uint8_t) && defined(__uint8_t)
+typedef __uint8_t uint8_t;
+#endif
+
+#if !defined(uint16_t) && defined(__uint16_t)
+typedef __uint16_t uint16_t;
+#endif
+
+#if !defined(uint32_t) && defined(__uint32_t)
+typedef __uint32_t uint32_t;
+#endif
+
+#if !defined(uint64_t) && defined(__uint64_t)
+typedef __uint64_t uint64_t;
+#endif
+
+#endif
#ifdef __cplusplus
}
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index 1601f18fa8..933c773dcc 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -21,10 +21,9 @@ include_rtems_HEADERS = include/chain.h include/console.h include/clockdrv.h \
include/timerdrv.h include/vmeintr.h
include_HEADERS =
-if NEED_STDINT_H
+
+if NEWLIB
include_HEADERS += include/stdint.h
-endif
-if NEED_INTTYPES_H
include_HEADERS += include/inttypes.h
endif
@@ -177,13 +176,11 @@ $(PROJECT_INCLUDE)/rtems/vmeintr.h: include/vmeintr.h $(PROJECT_INCLUDE)/rtems/$
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/vmeintr.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/vmeintr.h
-if NEED_STDINT_H
+if NEWLIB
$(PROJECT_INCLUDE)/stdint.h: include/stdint.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/stdint.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/stdint.h
-endif
-if NEED_INTTYPES_H
$(PROJECT_INCLUDE)/inttypes.h: include/inttypes.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/inttypes.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/inttypes.h
diff --git a/cpukit/libcsupport/include/stdint.h b/cpukit/libcsupport/include/stdint.h
index 6dbfd44c0f..f31032b625 100644
--- a/cpukit/libcsupport/include/stdint.h
+++ b/cpukit/libcsupport/include/stdint.h
@@ -13,7 +13,20 @@
extern "C" {
#endif
-#include <rtems/stdint.h>
+#include <rtems/score/types.h>
+
+/*
+ * map RTEMS internal types onto C99 types
+ */
+typedef signed8 int8_t;
+typedef signed16 int16_t;
+typedef signed32 int32_t;
+typedef signed64 int64_t;
+
+typedef unsigned8 uint8_t;
+typedef unsigned16 uint16_t;
+typedef unsigned32 uint32_t;
+typedef unsigned64 uint64_t;
#ifdef __cplusplus
}
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index 8e053b9c4c..7040846cca 100644
--- a/cpukit/libcsupport/src/termios.c
+++ b/cpukit/libcsupport/src/termios.c
@@ -32,39 +32,6 @@
#include <rtems/termiostypes.h>
/*
- * FreeBSD does not support a full POSIX termios so we have to help it out
- */
-#if !HAVE_DECL_XTABS
-#define XTABS 0
-#endif
-
-#if !HAVE_DECL_ONLRET
-#define ONLRET 0
-#endif
-#if !HAVE_DECL_ONOCR
-#define ONOCR 0
-#endif
-#if !HAVE_DECL_TABDLY
-#define TABDLY 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
-
-#if !HAVE_DECL_ECHOPRT
-#define ECHOPRT 0
-#endif
-
-/*
* The size of the cooked buffer
*/
#define CBUFSIZE (rtems_termios_cbufsize)