From 04e4829d46887039be024e83dc1951256e672ec1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Jul 2000 14:04:29 +0000 Subject: Patch rtems-rc-20000626-1.diff from Ralf Corsepius . Comments follow: Building linux/posix fails due to including lib/include/sys/cdefs.h instead of linux's sys/cdefs.h. AFAIS, this sys/cdefs.h is specific to newlib and should probably not be used on any unix host. Therefore, I changed the relevant Makefile.am/configure.in to condionally install sys/cdefs.h only if newlib is present. This triggered another bug inside of the newlib-check for one of RTEMS target's (Unfortunately I can't remember which - mips/i960 ? ... one of the more exotic ...), for which int func() isn't identical to void func(). Note: This patch needs to be tested under Cygwin and Solaris. I am particularily unsure about Cygwin/posix, as it applies a different version newlib which must not trigger RTEMS newlib check (it is supposed to fail) and if it may need RTEMS's sys/cdefs.h. --- aclocal/check-newlib.m4 | 10 +++++----- c/src/lib/configure.in | 5 +++-- c/src/lib/include/sys/Makefile.am | 7 +++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/aclocal/check-newlib.m4 b/aclocal/check-newlib.m4 index f417c65726..b8bdaa19b7 100644 --- a/aclocal/check-newlib.m4 +++ b/aclocal/check-newlib.m4 @@ -12,17 +12,17 @@ AC_CACHE_CHECK([for newlib], dnl some versions of newlib provide not_required_by_rtems AC_TRY_LINK( - [extern int not_required_by_rtems() ;], + [extern void not_required_by_rtems() ;], [not_required_by_rtems()], rtems_cv_use_newlib="yes") -dnl older versions of newlib provided rtems_provides_crt0 +dnl some versions of newlib provide rtems_provides_crt0() if test -z "$rtems_cv_use_newlib"; then AC_TRY_LINK( - [extern int rtems_provides_crt0 ;], - [rtems_provides_crt0 = 0], + [extern void rtems_provides_crt0() ;], + [rtems_provides_crt0()], rtems_cv_use_newlib="yes", - rtems_cv_use_newlib="no") + rtems_cv_use_newlib="no") fi CC=$rtems_save_CC]) RTEMS_USE_NEWLIB="$rtems_cv_use_newlib" diff --git a/c/src/lib/configure.in b/c/src/lib/configure.in index 893f816188..b86edceb3c 100644 --- a/c/src/lib/configure.in +++ b/c/src/lib/configure.in @@ -24,12 +24,13 @@ RTEMS_PROJECT_ROOT RTEMS_PROG_CC_FOR_TARGET RTEMS_CANONICALIZE_TOOLS - +RTEMS_CHECK_NEWLIB RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP) RTEMS_CHECK_NETWORKING(RTEMS_BSP) -AM_CONDITIONAL(UNIX,test "$RTEMS_CPU" = "unix") +AM_CONDITIONAL(UNIX,test x"$RTEMS_CPU" = x"unix") +AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") # find all the CPU dependent library Makefiles AC_CONFIG_SUBDIRS(libcpu) diff --git a/c/src/lib/include/sys/Makefile.am b/c/src/lib/include/sys/Makefile.am index 3d6045697b..1e6b181515 100644 --- a/c/src/lib/include/sys/Makefile.am +++ b/c/src/lib/include/sys/Makefile.am @@ -9,12 +9,11 @@ else NETWORKING_H_FILES += ioctl.h endif -if UNIX -else -NEWLIB_H_FILES += termios.h +if NEWLIB +NEWLIB_H_FILES += termios.h cdefs.h endif -H_FILES = cdefs.h ioccom.h utime.h $(NEWLIB_H_FILES) $(NETWORKING_H_FILES) +H_FILES = ioccom.h utime.h $(NEWLIB_H_FILES) $(NETWORKING_H_FILES) noinst_HEADERS = utime.h termios.h ioctl.h ioccom.h -- cgit v1.2.3