From 3da33bf8132ee46cb268ae732670bd0c534c3ada Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Thu, 20 Nov 2003 07:02:53 +0000 Subject: 2003-11-20 Ralf Corsepius * acinclude.m4: New. * configure.ac: Don't use AUTOHEADER to generate cpuopts.h. Add local autoheader config.h. * aclocal/canonical-target-name.m4: Require AC_CANONICAL_HOST. * aclocal/enable-inlines.m4: Remove USE_MACROS (Unused). --- cpukit/ChangeLog | 8 +++ cpukit/acinclude.m4 | 12 ++++ cpukit/aclocal/canonical-target-name.m4 | 3 +- cpukit/aclocal/enable-inlines.m4 | 7 +-- cpukit/configure.ac | 102 +++++++++++++++++++++++--------- 5 files changed, 96 insertions(+), 36 deletions(-) create mode 100644 cpukit/acinclude.m4 diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 2aed62221b..034f0f9dcc 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2003-11-20 Ralf Corsepius + + * acinclude.m4: New. + * configure.ac: Don't use AUTOHEADER to generate cpuopts.h. + Add local autoheader config.h. + * aclocal/canonical-target-name.m4: Require AC_CANONICAL_HOST. + * aclocal/enable-inlines.m4: Remove USE_MACROS (Unused). + 2003-10-21 Ralf Corsepius * aclocal/check-posix.m4: Add m4-quotes. diff --git a/cpukit/acinclude.m4 b/cpukit/acinclude.m4 new file mode 100644 index 0000000000..8cceb11682 --- /dev/null +++ b/cpukit/acinclude.m4 @@ -0,0 +1,12 @@ +# RTEMS_CPUOPT(NAME,CONDITION,VALUE,EXPLANATION) + +AC_DEFUN([RTEMS_CPUOPT], +[ + echo >> cpuopts.tmp + echo "/* $4 */" >> cpuopts.tmp + if $2; then + echo "#define $1 $3" >> cpuopts.tmp + else + echo "/* #undef $1 */" >> cpuopts.tmp + fi +]) diff --git a/cpukit/aclocal/canonical-target-name.m4 b/cpukit/aclocal/canonical-target-name.m4 index ff1750111b..963a71cda3 100644 --- a/cpukit/aclocal/canonical-target-name.m4 +++ b/cpukit/aclocal/canonical-target-name.m4 @@ -9,8 +9,7 @@ dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them dnl and we have to fix it for rtems ourselves AC_DEFUN([RTEMS_CANONICAL_TARGET_CPU], -[ -AC_CANONICAL_HOST +[AC_REQUIRE([AC_CANONICAL_HOST]) AC_MSG_CHECKING(rtems target cpu) case "${host}" in # hpux unix port should go here diff --git a/cpukit/aclocal/enable-inlines.m4 b/cpukit/aclocal/enable-inlines.m4 index 972f78b733..f3853587ca 100644 --- a/cpukit/aclocal/enable-inlines.m4 +++ b/cpukit/aclocal/enable-inlines.m4 @@ -10,12 +10,9 @@ AC_HELP_STRING([--enable-rtems-inlines],[enable RTEMS inline functions (default: esac],[RTEMS_USE_MACROS=no]) AC_SUBST(RTEMS_USE_MACROS)dnl -if test x"${RTEMS_USE_MACROS}" = x"yes"; -then - AC_DEFINE_UNQUOTED(USE_MACROS,1,[if using macros]) -else +AS_IF([test x"${RTEMS_USE_MACROS}" = x"yes"],[],[ AC_DEFINE_UNQUOTED(USE_INLINES,1,[if using inlines]) -fi +]) ]) diff --git a/cpukit/configure.ac b/cpukit/configure.ac index caa80e4182..68872bb6b8 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -79,16 +79,10 @@ RTEMS_DEFINE_MULTIPROCESSING # HACK: We should use a feature-based configuration. AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ - AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix]) # HACK: silently accept --enable-unixlib test -n "${enable_unixlib}" || enable_unixlib="yes" ]) -AS_IF([test x"${enable_unixlib}" = x"yes"], - [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1], - [to indicate RTEMS using RTEMS's unixlib])] -) - # BSD-isms, used throughout the sources # Not really used by this configure script # FIXME: They should be eliminated if possible. @@ -96,33 +90,81 @@ AC_CHECK_FUNCS([strsep strcasecmp snprintf]) AC_CHECK_FUNCS([bcopy bcmp]) AC_CHECK_FUNCS([isascii fileno]) -AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[ -echo "/* target cpu dependent options file */" >$tmp/config.h -echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h -echo >>$tmp/config.h -echo "#ifndef __CPU_OPTIONS_h" >>$tmp/config.h -echo "#define __CPU_OPTIONS_h" >>$tmp/config.h -echo >>$tmp/config.h -sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h -echo >>$tmp/config.h -echo "#endif" >>$tmp/config.h -AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null], - [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) - rm -f $tmp/config.h], - [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) - rm -f score/include/rtems/score/cpuopts.h - mv $tmp/config.h score/include/rtems/score/cpuopts.h]) +cat << EOF > cpuopts.tmp +/* target cpu dependent options file */ +/* automatically generated -- DO NOT EDIT!! */ +#ifndef __CPU_OPTIONS_h +#define __CPU_OPTIONS_h +EOF + +RTEMS_CPUOPT([USE_INLINES], + [! test x"${RTEMS_USE_MACROS}" = x"yes"], + [1], + [if using inlines]) + +RTEMS_CPUOPT([RTEMS_ITRON_API], + [test x"$rtems_cv_HAS_ITRON_API" = x"yes"], + [1], + [if itron api is supported]) + +RTEMS_CPUOPT([RTEMS_MULTILIBS], + [test x"$RTEMS_MULTILIBS" = x"yes"], + [1], + [using multilib'ed RTEMS]) + +RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], + [test x"$HAS_MP" = "yes"], + [1], + [if multiprocessing is enabled]) + +RTEMS_CPUOPT([RTEMS_NEWLIB], + [test x"$RTEMS_USE_NEWLIB" = x"yes"], + [1], + [if using newlib]) + +RTEMS_CPUOPT([RTEMS_POSIX_API], + [test x"$HAS_POSIX_API" = x"yes"], + [1], + [if posix api is supported]) + +RTEMS_CPUOPT([RTEMS_UNIX], + [test x"$RTEMS_CPU" = x"unix"], + [1], + [to indicate RTEMS unix]) + +RTEMS_CPUOPT([RTEMS_UNIXLIB], + [test x"${enable_unixlib}" = x"yes"], + [1], + [to indicate RTEMS using RTEMS's unixlib]) + +RTEMS_CPUOPT([RTEMS_VERSION], + [true], + [\"]_RTEMS_VERSION[\"], + [RTEMS version string]) + +echo >> cpuopts.tmp +echo "#endif" >> cpuopts.tmp + +AS_MKDIR_P(score/include/rtems/score) +AS_IF([test -f score/include/rtems/score/cpuopts.h], +[ + AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null], + [ + AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) + rm -f cpuopts.tmp + ],[ + AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) + rm -f score/include/rtems/score/cpuopts.h + mv cpuopts.tmp score/include/rtems/score/cpuopts.h + ]) +],[ + AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) + rm -f score/include/rtems/score/cpuopts.h + mv cpuopts.tmp score/include/rtems/score/cpuopts.h ]) AC_ENABLE_MULTILIB([Makefile],[..]) -## HACK: Add a define to cpuopts.h to indicate using multilibs -## Can be applied to produce compiler errors if using -## multilib-incompatible settings somewhere else (eg. bspopts.h). -AS_IF([test x"${enable_multilib}" = x"yes"],[ - AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS]) -]) - # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. AC_MSG_CHECKING([for assignable stdio]) AC_COMPILE_IFELSE( @@ -231,6 +273,8 @@ 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"]) +AC_CONFIG_HEADER(config.h) + # Explicitly list all Makefiles here AC_CONFIG_FILES([ Makefile -- cgit v1.2.3