summaryrefslogtreecommitdiffstats
path: root/cpukit/aclocal
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/aclocal')
-rw-r--r--cpukit/aclocal/canonical-target-name.m440
-rw-r--r--cpukit/aclocal/canonicalize-tools.m415
-rw-r--r--cpukit/aclocal/check-itron.m423
-rw-r--r--cpukit/aclocal/check-multiprocessing.m49
-rw-r--r--cpukit/aclocal/check-networking.m428
-rw-r--r--cpukit/aclocal/check-newlib.m430
-rw-r--r--cpukit/aclocal/check-posix.m423
-rw-r--r--cpukit/aclocal/check-rtems-debug.m47
-rw-r--r--cpukit/aclocal/check-tool.m411
-rw-r--r--cpukit/aclocal/enable-inlines.m411
-rw-r--r--cpukit/aclocal/enable-itron.m433
-rw-r--r--cpukit/aclocal/enable-multiprocessing.m412
-rw-r--r--cpukit/aclocal/enable-networking.m414
-rw-r--r--cpukit/aclocal/enable-posix.m433
-rw-r--r--cpukit/aclocal/enable-rtems-debug.m412
-rw-r--r--cpukit/aclocal/env-rtemscpu.m414
-rw-r--r--cpukit/aclocal/gcc-isystem.m425
-rw-r--r--cpukit/aclocal/gcc-pipe.m421
-rw-r--r--cpukit/aclocal/multi.m452
-rw-r--r--cpukit/aclocal/multilib.m414
-rw-r--r--cpukit/aclocal/prog-cc.m446
-rw-r--r--cpukit/aclocal/prog-ccas.m48
-rw-r--r--cpukit/aclocal/prog-gnat.m445
-rw-r--r--cpukit/aclocal/rtems-flags.m411
-rw-r--r--cpukit/aclocal/rtems-top.m470
-rw-r--r--cpukit/aclocal/sysv-ipc.m4125
-rw-r--r--cpukit/aclocal/version.m42
27 files changed, 734 insertions, 0 deletions
diff --git a/cpukit/aclocal/canonical-target-name.m4 b/cpukit/aclocal/canonical-target-name.m4
new file mode 100644
index 0000000000..963a71cda3
--- /dev/null
+++ b/cpukit/aclocal/canonical-target-name.m4
@@ -0,0 +1,40 @@
+dnl
+dnl $Id$
+dnl
+
+dnl canonicalize target cpu
+dnl NOTE: Most rtems targets do not fullfil autoconf's
+dnl target naming conventions "processor-vendor-os"
+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_REQUIRE([AC_CANONICAL_HOST])
+AC_MSG_CHECKING(rtems target cpu)
+case "${host}" in
+ # hpux unix port should go here
+ i[[34567]]86-*linux*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ i[[34567]]86-*freebsd*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :)
+ RTEMS_CPU=unix
+ ;;
+ no_cpu-*rtems*)
+ RTEMS_CPU=no_cpu
+ ;;
+ sparc-sun-solaris*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ tic4x-*rtems*) # gcc changed the name
+ RTEMS_CPU=c4x
+ ;;
+ *)
+ RTEMS_CPU=`echo $host | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'`
+ ;;
+esac
+AC_SUBST(RTEMS_CPU)
+AC_MSG_RESULT($RTEMS_CPU)
+])
diff --git a/cpukit/aclocal/canonicalize-tools.m4 b/cpukit/aclocal/canonicalize-tools.m4
new file mode 100644
index 0000000000..540c9a4c29
--- /dev/null
+++ b/cpukit/aclocal/canonicalize-tools.m4
@@ -0,0 +1,15 @@
+dnl
+dnl $Id$
+dnl
+dnl Set target tools
+dnl
+
+AC_DEFUN([RTEMS_CANONICALIZE_TOOLS],
+[AC_REQUIRE([RTEMS_PROG_CC])dnl
+
+dnl FIXME: What shall be done if these tools are not available?
+ RTEMS_CHECK_TOOL(AR,ar,no)
+
+dnl special treatment of ranlib
+ RTEMS_CHECK_TOOL(RANLIB,ranlib,:)
+])
diff --git a/cpukit/aclocal/check-itron.m4 b/cpukit/aclocal/check-itron.m4
new file mode 100644
index 0000000000..88f4013e5e
--- /dev/null
+++ b/cpukit/aclocal/check-itron.m4
@@ -0,0 +1,23 @@
+dnl $Id$
+dnl
+AC_DEFUN([RTEMS_CHECK_ITRON_API],
+[dnl
+AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
+AC_REQUIRE([RTEMS_ENABLE_ITRON])dnl
+
+AC_CACHE_CHECK([whether CPU supports libitron],
+ rtems_cv_HAS_ITRON_API,
+ [dnl
+ case "$RTEMS_CPU" in
+ unix*)
+ rtems_cv_HAS_ITRON_API="no"
+ ;;
+ *)
+ if test "${RTEMS_HAS_ITRON_API}" = "yes"; then
+ rtems_cv_HAS_ITRON_API="yes";
+ else
+ rtems_cv_HAS_ITRON_API="disabled";
+ fi
+ ;;
+ esac])
+])
diff --git a/cpukit/aclocal/check-multiprocessing.m4 b/cpukit/aclocal/check-multiprocessing.m4
new file mode 100644
index 0000000000..ca4338b09a
--- /dev/null
+++ b/cpukit/aclocal/check-multiprocessing.m4
@@ -0,0 +1,9 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([RTEMS_CHECK_MULTIPROCESSING],
+[dnl
+AC_REQUIRE([RTEMS_ENV_RTEMSCPU])dnl
+AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl
+])
diff --git a/cpukit/aclocal/check-networking.m4 b/cpukit/aclocal/check-networking.m4
new file mode 100644
index 0000000000..289c1b3eb2
--- /dev/null
+++ b/cpukit/aclocal/check-networking.m4
@@ -0,0 +1,28 @@
+dnl $Id$
+dnl
+AC_DEFUN([RTEMS_CHECK_NETWORKING],
+[dnl
+AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
+AC_REQUIRE([RTEMS_ENABLE_NETWORKING])dnl
+
+AC_CACHE_CHECK([whether CPU supports networking],
+ rtems_cv_HAS_NETWORKING,
+ [dnl
+ case "$RTEMS_CPU" in
+ unix*)
+ rtems_cv_HAS_NETWORKING="no"
+ ;;
+ *)
+ if test "${RTEMS_HAS_NETWORKING}" = "yes"; then
+ rtems_cv_HAS_NETWORKING="yes";
+ else
+ rtems_cv_HAS_NETWORKING="disabled";
+ fi
+ ;;
+ esac])
+if test "$rtems_cv_HAS_NETWORKING" = "yes"; then
+ HAS_NETWORKING="yes";
+else
+ HAS_NETWORKING="no";
+fi
+])
diff --git a/cpukit/aclocal/check-newlib.m4 b/cpukit/aclocal/check-newlib.m4
new file mode 100644
index 0000000000..bbf5f68dc2
--- /dev/null
+++ b/cpukit/aclocal/check-newlib.m4
@@ -0,0 +1,30 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_CHECK_NEWLIB],
+[dnl
+AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
+AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl
+AC_CACHE_CHECK([for RTEMS newlib],
+ rtems_cv_use_newlib,
+ [
+dnl some versions of newlib provide not_required_by_rtems
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[extern void not_required_by_rtems() ;]],
+ [[not_required_by_rtems()]])],
+ [rtems_cv_use_newlib="yes"],[])
+
+dnl some versions of newlib provide rtems_provides_crt0()
+ AS_IF([test -z "$rtems_cv_use_newlib"],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[extern void rtems_provides_crt0() ;]],
+ [[rtems_provides_crt0()]])],
+ [rtems_cv_use_newlib="yes"],[rtems_cv_use_newlib="no"])
+ ])
+ ])
+ RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
+ AC_SUBST(RTEMS_USE_NEWLIB)
+
+ AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],
+ [ AC_DEFINE_UNQUOTED(RTEMS_NEWLIB,1,[if using newlib])]
+ )
+])
diff --git a/cpukit/aclocal/check-posix.m4 b/cpukit/aclocal/check-posix.m4
new file mode 100644
index 0000000000..be60c5f74a
--- /dev/null
+++ b/cpukit/aclocal/check-posix.m4
@@ -0,0 +1,23 @@
+dnl $Id$
+dnl
+AC_DEFUN([RTEMS_CHECK_POSIX_API],
+[dnl
+AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
+AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl
+
+AC_CACHE_CHECK([whether CPU supports libposix],
+ rtems_cv_HAS_POSIX_API,
+ [dnl
+ case "$RTEMS_CPU" in
+ unix*)
+ rtems_cv_HAS_POSIX_API="no"
+ ;;
+ *)
+ if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
+ rtems_cv_HAS_POSIX_API="yes";
+ else
+ rtems_cv_HAS_POSIX_API="disabled";
+ fi
+ ;;
+ esac])
+])
diff --git a/cpukit/aclocal/check-rtems-debug.m4 b/cpukit/aclocal/check-rtems-debug.m4
new file mode 100644
index 0000000000..d8d1818520
--- /dev/null
+++ b/cpukit/aclocal/check-rtems-debug.m4
@@ -0,0 +1,7 @@
+## $Id$
+
+AC_DEFUN([RTEMS_CHECK_RTEMS_DEBUG],
+[AC_REQUIRE([RTEMS_ENABLE_RTEMS_DEBUG])
+AS_IF([test x"${enable_rtems_debug}" = x"yes"]
+ [AC_DEFINE_UNQUOTED(RTEMS_DEBUG,1,[if RTEMS_DEBUG is enabled])])
+])
diff --git a/cpukit/aclocal/check-tool.m4 b/cpukit/aclocal/check-tool.m4
new file mode 100644
index 0000000000..4c412c074a
--- /dev/null
+++ b/cpukit/aclocal/check-tool.m4
@@ -0,0 +1,11 @@
+dnl $Id$
+
+## Check for a cross tool, similar to AC_CHECK_TOOL, but do not fall back to
+## the un-prefixed version of PROG-TO-CHECK-FOR.
+dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([RTEMS_CHECK_TOOL],
+[
+ AS_IF([test "x$build_alias" != "x$host_alias"],
+ [rtems_tool_prefix=${ac_tool_prefix}])
+ AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)
+])
diff --git a/cpukit/aclocal/enable-inlines.m4 b/cpukit/aclocal/enable-inlines.m4
new file mode 100644
index 0000000000..2c79538dce
--- /dev/null
+++ b/cpukit/aclocal/enable-inlines.m4
@@ -0,0 +1,11 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENABLE_INLINES],
+[AC_ARG_ENABLE(rtems-inlines,
+AS_HELP_STRING(--enable-rtems-inlines,enable RTEMS inline functions (default:enabled, disable to use macros)),
+[case "${enableval}" in
+ yes) enable_rtems_inlines=yes ;;
+ no) enable_rtems_inlines=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-rtems-inlines option) ;;
+esac],[enable_rtems_inlines=yes])
+])
diff --git a/cpukit/aclocal/enable-itron.m4 b/cpukit/aclocal/enable-itron.m4
new file mode 100644
index 0000000000..552e8df267
--- /dev/null
+++ b/cpukit/aclocal/enable-itron.m4
@@ -0,0 +1,33 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENABLE_ITRON],
+[
+## AC_BEFORE([$0], [RTEMS_CHECK_ITRON_API])dnl
+
+AC_ARG_ENABLE(itron,
+AS_HELP_STRING(--enable-itron,enable itron interface),
+[case "${enableval}" in
+ yes) RTEMS_HAS_ITRON_API=yes ;;
+ no) RTEMS_HAS_ITRON_API=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-itron option) ;;
+esac],[RTEMS_HAS_ITRON_API=yes])
+
+case "${host}" in
+ # hpux unix port should go here
+ i[[34567]]86-pc-linux*) # unix "simulator" port
+ RTEMS_HAS_ITRON_API=no
+ ;;
+ i[[34567]]86-*freebsd*) # unix "simulator" port
+ RTEMS_HAS_ITRON_API=no
+ ;;
+ no_cpu-*rtems*)
+ RTEMS_HAS_ITRON_API=no
+ ;;
+ sparc-sun-solaris*) # unix "simulator" port
+ RTEMS_HAS_ITRON_API=no
+ ;;
+ *)
+ ;;
+esac
+AC_SUBST(RTEMS_HAS_ITRON_API)
+])
diff --git a/cpukit/aclocal/enable-multiprocessing.m4 b/cpukit/aclocal/enable-multiprocessing.m4
new file mode 100644
index 0000000000..f664800e40
--- /dev/null
+++ b/cpukit/aclocal/enable-multiprocessing.m4
@@ -0,0 +1,12 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENABLE_MULTIPROCESSING],
+[
+AC_ARG_ENABLE(multiprocessing,
+AS_HELP_STRING(--enable-multiprocessing,enable multiprocessing interface),
+[case "${enable_multiprocessing}" in
+ yes) ;;
+ no) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
+esac],[enable_multiprocessing=no])
+])
diff --git a/cpukit/aclocal/enable-networking.m4 b/cpukit/aclocal/enable-networking.m4
new file mode 100644
index 0000000000..a7be7b4df7
--- /dev/null
+++ b/cpukit/aclocal/enable-networking.m4
@@ -0,0 +1,14 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENABLE_NETWORKING],
+[
+## AC_BEFORE([$0], [RTEMS_CHECK_NETWORKING])dnl
+
+AC_ARG_ENABLE(networking,
+AS_HELP_STRING(--enable-networking,enable TCP/IP stack),
+[case "${enableval}" in
+ yes) RTEMS_HAS_NETWORKING=yes ;;
+ no) RTEMS_HAS_NETWORKING=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
+esac],[RTEMS_HAS_NETWORKING=yes])
+])
diff --git a/cpukit/aclocal/enable-posix.m4 b/cpukit/aclocal/enable-posix.m4
new file mode 100644
index 0000000000..fe0f314e76
--- /dev/null
+++ b/cpukit/aclocal/enable-posix.m4
@@ -0,0 +1,33 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENABLE_POSIX],
+[
+## AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
+
+AC_ARG_ENABLE(posix,
+AS_HELP_STRING(--enable-posix,enable posix interface),
+[case "${enableval}" in
+ yes) RTEMS_HAS_POSIX_API=yes ;;
+ no) RTEMS_HAS_POSIX_API=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
+esac],[RTEMS_HAS_POSIX_API=yes])
+
+case "${host}" in
+ # hpux unix port should go here
+ i[[34567]]86-pc-linux*) # unix "simulator" port
+ RTEMS_HAS_POSIX_API=no
+ ;;
+ i[[34567]]86-*freebsd*) # unix "simulator" port
+ RTEMS_HAS_POSIX_API=no
+ ;;
+ no_cpu-*rtems*)
+ RTEMS_HAS_POSIX_API=no
+ ;;
+ sparc-sun-solaris*) # unix "simulator" port
+ RTEMS_HAS_POSIX_API=no
+ ;;
+ *)
+ ;;
+esac
+AC_SUBST(RTEMS_HAS_POSIX_API)
+])
diff --git a/cpukit/aclocal/enable-rtems-debug.m4 b/cpukit/aclocal/enable-rtems-debug.m4
new file mode 100644
index 0000000000..ada9fe30f4
--- /dev/null
+++ b/cpukit/aclocal/enable-rtems-debug.m4
@@ -0,0 +1,12 @@
+## $Id$
+
+AC_DEFUN([RTEMS_ENABLE_RTEMS_DEBUG],
+[
+AC_ARG_ENABLE(rtems-debug,
+AS_HELP_STRING(--enable-rtems-debug,enable RTEMS_DEBUG),
+[case "${enable_rtems_debug}" in
+ yes) enable_rtems_debug=yes ;;
+ no) enable_rtems_debug=no ;;
+ *) AC_MSG_ERROR([bad value ${enable_rtems_debug} for RTEMS_DEBUG]) ;;
+esac],[enable_rtems_debug=no])
+])
diff --git a/cpukit/aclocal/env-rtemscpu.m4 b/cpukit/aclocal/env-rtemscpu.m4
new file mode 100644
index 0000000000..eee3c5dd5f
--- /dev/null
+++ b/cpukit/aclocal/env-rtemscpu.m4
@@ -0,0 +1,14 @@
+dnl $Id$
+
+AC_DEFUN([RTEMS_ENV_RTEMSCPU],
+[
+ AC_REQUIRE([RTEMS_ENABLE_MULTILIB])
+
+ AC_ARG_VAR([CPU_CFLAGS],[])
+ AC_ARG_VAR([CFLAGS_OPTIMIZE_V],
+ [CFLAGS for building the optimized variant])
+ AC_ARG_VAR([CFLAGS_DEBUG_V],
+ [CFLAGS for building the debugging variant])
+
+ AM_CONDITIONAL([MULTILIB],[test x"$multilib" = x"yes"])
+])
diff --git a/cpukit/aclocal/gcc-isystem.m4 b/cpukit/aclocal/gcc-isystem.m4
new file mode 100644
index 0000000000..94098cf33c
--- /dev/null
+++ b/cpukit/aclocal/gcc-isystem.m4
@@ -0,0 +1,25 @@
+dnl
+dnl $Id$
+dnl
+dnl Check whether the gcc accepts -isystem
+dnl
+
+AC_DEFUN([RTEMS_GCC_ISYSTEM],
+[AC_REQUIRE([RTEMS_PROG_CC])
+AC_CACHE_CHECK(whether $CC accepts -isystem,rtems_cv_gcc_isystem,
+[
+rtems_cv_gcc_isystem=no
+if test x"$GCC" = x"yes"; then
+cat << EOF > conftest.h
+int conftest123();
+EOF
+cat << EOF > conftest.c
+#include <conftest.h>
+int conftest123() {}
+EOF
+ if test -z "`${CC} -isystem./ -c conftest.c 2>&1`";then
+ rtems_cv_gcc_isystem=yes
+ fi
+fi
+rm -f conftest*
+])])
diff --git a/cpukit/aclocal/gcc-pipe.m4 b/cpukit/aclocal/gcc-pipe.m4
new file mode 100644
index 0000000000..2a04629bb2
--- /dev/null
+++ b/cpukit/aclocal/gcc-pipe.m4
@@ -0,0 +1,21 @@
+dnl
+dnl $Id$
+dnl
+dnl Check whether the target compiler accepts -pipe
+dnl
+
+AC_DEFUN([RTEMS_GCC_PIPE],
+[AC_REQUIRE([RTEMS_PROG_CC])
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe,
+[
+rtems_cv_gcc_pipe=no
+if test x"$GCC" = x"yes"; then
+ echo 'void f(){}' >conftest.c
+ if test -z "`${CC} --pipe -c conftest.c 2>&1`";then
+ rtems_cv_gcc_pipe=yes
+ fi
+ rm -f conftest*
+fi
+])
+])
diff --git a/cpukit/aclocal/multi.m4 b/cpukit/aclocal/multi.m4
new file mode 100644
index 0000000000..d629840d25
--- /dev/null
+++ b/cpukit/aclocal/multi.m4
@@ -0,0 +1,52 @@
+#serial 99
+
+AC_DEFUN([AC_ENABLE_MULTILIB],
+[
+AC_ARG_ENABLE(multilib,
+AS_HELP_STRING(--enable-multilib,build many library versions (default=no)),
+[case "${enableval}" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [multilib=no])dnl
+
+AM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes")
+
+dnl We may get other options which we don't document:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+if test "[$]{srcdir}" = "."; then
+ if test "[$]{with_target_subdir}" != "."; then
+ multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])"
+ else
+ multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])"
+ fi
+else
+ multilib_basedir="[$]{srcdir}/ifelse([$2],,,[$2])"
+fi
+AC_SUBST(multilib_basedir)
+
+if test "${multilib}" = "yes"; then
+ multilib_arg="--enable-multilib"
+else
+ multilib_arg=
+fi
+
+AC_OUTPUT_COMMANDS(
+[case " $CONFIG_FILES " in
+ *" ]m4_if([$1],,Makefile,[$1])[ "*)
+ ac_file=]m4_if([$1],,Makefile,[$1])[ . ${multilib_basedir}/config-ml.in
+esac],
+[
+ srcdir=${srcdir}
+ host=${host}
+ target=${target}
+ with_multisrctop="${with_multisrctop}"
+ with_target_subdir="${with_target_subdir}"
+ with_multisubdir="${with_multisubdir}"
+ ac_configure_args="${multilib_arg} ${ac_configure_args}"
+ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ multilib_basedir=${multilib_basedir}
+ CC="${CC}"]
+)
+])
diff --git a/cpukit/aclocal/multilib.m4 b/cpukit/aclocal/multilib.m4
new file mode 100644
index 0000000000..90e6217780
--- /dev/null
+++ b/cpukit/aclocal/multilib.m4
@@ -0,0 +1,14 @@
+dnl This provides configure definitions used for multilib support
+
+AC_DEFUN([RTEMS_ENABLE_MULTILIB],
+[
+AC_ARG_ENABLE(multilib,
+AS_HELP_STRING(--enable-multilib,build many library versions (default=no)),
+[case "${enableval}" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [multilib=no])dnl
+
+AM_CONDITIONAL([MULTILIB],[test x"${multilib}" = x"yes"])
+])
diff --git a/cpukit/aclocal/prog-cc.m4 b/cpukit/aclocal/prog-cc.m4
new file mode 100644
index 0000000000..344081f98c
--- /dev/null
+++ b/cpukit/aclocal/prog-cc.m4
@@ -0,0 +1,46 @@
+dnl
+dnl $Id$
+dnl
+dnl Check for target gcc
+dnl
+
+AC_DEFUN([RTEMS_PROG_CC],
+[
+AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_BEFORE([$0], [AC_PROG_CC])dnl
+AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
+
+_RTEMS_FLAGS([CFLAGS],
+ ["\$(CPU_CFLAGS) \$(RTEMS_CFLAGS_\$(VARIANT_V)_V) \$(CFLAGS_\$(VARIANT_V)_V) -g"])
+
+RTEMS_CHECK_TOOL(CC,gcc)
+test -z "$CC" && \
+ AC_MSG_ERROR([no acceptable cc found in \$PATH])
+AC_PROG_CC
+AC_PROG_CPP
+
+AM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes")
+])
+
+AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],
+[
+dnl check target cc
+RTEMS_PROG_CC
+dnl check if the compiler supports -isystem
+RTEMS_GCC_ISYSTEM
+dnl check if the target compiler may use --pipe
+RTEMS_GCC_PIPE
+test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"
+
+if test "$GCC" = yes; then
+RTEMS_CFLAGS="$RTEMS_CFLAGS -Wall"
+m4_if([$1],,[],[RTEMS_CFLAGS="$RTEMS_CFLAGS $1"])
+fi
+
+AS_IF([test x"$rtems_cv_gcc_isystem" = x"yes"],[
+ RTEMS_CPPFLAGS="-isystem \$(PROJECT_INCLUDE)"],[
+ RTEMS_CPPFLAGS="-I\$(PROJECT_INCLUDE)"
+])
+AC_SUBST(RTEMS_CPPFLAGS)
+
+])
diff --git a/cpukit/aclocal/prog-ccas.m4 b/cpukit/aclocal/prog-ccas.m4
new file mode 100644
index 0000000000..aeef25ec0c
--- /dev/null
+++ b/cpukit/aclocal/prog-ccas.m4
@@ -0,0 +1,8 @@
+## $Id$
+
+AC_DEFUN([RTEMS_PROG_CCAS],
+[
+AC_REQUIRE([RTEMS_PROG_CC])
+AC_SUBST(CCAS,["$CC \$(GCCSPECS)"])
+AC_SUBST(CCASFLAGS,["-DASM \$(CFLAGS) \$(INCLUDES)"])
+])
diff --git a/cpukit/aclocal/prog-gnat.m4 b/cpukit/aclocal/prog-gnat.m4
new file mode 100644
index 0000000000..6e169a8dc7
--- /dev/null
+++ b/cpukit/aclocal/prog-gnat.m4
@@ -0,0 +1,45 @@
+## $Id$
+##
+## Partially borrowed from gcc-3.2
+##
+## WARNING: All the stuff below is pretty immature.
+
+AC_DEFUN([RTEMS_PROG_GNAT],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])
+
+AC_CHECK_TOOL([GNATMAKE],[gnatmake],[])
+AC_CACHE_CHECK([for compiler driver that understands Ada],
+ [rtems_cv_prog_CCADA],
+[cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+rtems_cv_prog_CCADA=
+# Have to do ac_tool_prefix and user overrides by hand.
+user_ccada=$CCADA
+user_cc=$CC
+for cand in ${ac_tool_prefix}$user_ccada $user_ccada \
+ ${ac_tool_prefix}$user_cc $user_cc \
+ ${ac_tool_prefix}gcc gcc \
+ ${ac_tool_prefix}cc cc \
+ ${ac_tool_prefix}gnatgcc gnatgcc \
+ ${ac_tool_prefix}gnatcc gnatcc \
+ ${ac_tool_prefix}adagcc adagcc \
+ ${ac_tool_prefix}adac adac ; do
+ # There is a bug in all released versions of GCC which causes the
+ # driver to exit successfully when the appropriate language module
+ # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
+ # Therefore we must check for the error message as well as an
+ # unsuccessful exit.
+ errors=`($cand -c conftest.adb) 2>&1 || echo failure`
+ AS_IF([test -z "$errors"],
+ [rtems_cv_prog_CCADA=$cand
+ break])
+done
+rm -f conftest.*])
+AC_SUBST([CCADA],[$rtems_cv_prog_CCADA])
+
+AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"],
+ [HAVE_GNAT=yes],
+ [HAVE_GNAT=no])
+])
diff --git a/cpukit/aclocal/rtems-flags.m4 b/cpukit/aclocal/rtems-flags.m4
new file mode 100644
index 0000000000..8e034e52c2
--- /dev/null
+++ b/cpukit/aclocal/rtems-flags.m4
@@ -0,0 +1,11 @@
+## $Id$
+##
+## Some hacks to set up RTEMS_*FLAGS
+## Internal macro, not supposed to be explictly used in configure.ac's
+
+AC_DEFUN([_RTEMS_FLAGS],[
+AS_IF([test -n "[$]{$1}"],
+ [RTEMS_$1=[$]{$1}],
+ [RTEMS_$1=$2])
+AC_SUBST([RTEMS_$1])
+])
diff --git a/cpukit/aclocal/rtems-top.m4 b/cpukit/aclocal/rtems-top.m4
new file mode 100644
index 0000000000..c3f74304e5
--- /dev/null
+++ b/cpukit/aclocal/rtems-top.m4
@@ -0,0 +1,70 @@
+dnl $Id$
+
+m4_define([RTEMS_API],[4.7])
+
+dnl
+dnl RTEMS_TOP($1)
+dnl
+dnl $1 .. relative path from this configure.ac to the toplevel configure.ac
+dnl
+AC_DEFUN([RTEMS_TOP],
+[dnl
+AC_REQUIRE([RTEMS_VERSIONING])
+AC_REQUIRE([AM_SET_LEADING_DOT])
+AC_CONFIG_AUX_DIR([$1])
+AC_CHECK_PROGS(MAKE, gmake make)
+AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
+
+AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API])
+
+AC_SUBST([RTEMS_TOPdir],["$1"])
+
+# HACK: The sed pattern below strips of "../", corresponding to "cpukit/"
+rtems_updir="/"m4_if([$2],[],[`echo "$1/" | sed s,^\.\.\/,,`],[$2/])
+
+AS_IF([test -n "$with_multisubdir"],
+ [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`])
+AC_SUBST(MULTIBUILDTOP)
+
+AS_IF([test -n "$with_multisubdir"],
+ [MULTISUBDIR="/$with_multisubdir"])
+AC_SUBST(MULTISUBDIR)
+
+AC_ARG_WITH([project-root],[
+AS_HELP_STRING(--with-project-root,directory to pre-install files into)],[
+## Make sure to have a terminating '/'
+case "${with_project_root}" in
+*/) ;;
+*) with_project_root="${with_project_root}/" ;;
+esac
+
+case "${with_project_root}" in
+ [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
+ PROJECT_ROOT=${with_project_root}
+ ;;
+ *) # relative directory
+ sav0dir=`pwd` && cd ./${rtems_updir}
+ sav1dir=`pwd` && cd ../${MULTIBUILDTOP}
+ sav2dir=`pwd` && cd $sav0dir
+ mydir=`echo $sav1dir | sed s,^$sav2dir${MULTISUBDIR}/,,`
+ PROJECT_ROOT='$(top_builddir)'${rtems_updir}'../$(MULTIBUILDTOP)'${mydir}/${with_project_root}
+ ;;
+esac],[
+## Defaults: Note: Two different defaults!
+## ../ for multilib
+## '.' for non-multilib
+AS_IF([test "$enable_multilib" = "yes"],[
+ PROJECT_ROOT='$(top_builddir)'${rtems_updir}'../$(MULTIBUILDTOP)'],[
+ PROJECT_ROOT='$(top_builddir)'${rtems_updir}])
+])
+
+AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"])
+AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"])
+
+libdir="${libdir}\$(MULTISUBDIR)"
+
+AC_SUBST([project_libdir],["\$(libdir)"])
+AC_SUBST([project_includedir],["\$(includedir)"])
+
+AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
+])dnl
diff --git a/cpukit/aclocal/sysv-ipc.m4 b/cpukit/aclocal/sysv-ipc.m4
new file mode 100644
index 0000000000..0b263b5f4c
--- /dev/null
+++ b/cpukit/aclocal/sysv-ipc.m4
@@ -0,0 +1,125 @@
+dnl
+dnl $Id$
+dnl
+dnl Check for System V IPC calls used by Unix simulators
+dnl
+dnl 98/07/17 Dario Alcocer alcocer@netcom.com
+dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
+dnl
+dnl Note: $host_os should probably *not* ever be used here to
+dnl determine if host supports System V IPC calls, since some
+dnl (e.g. FreeBSD 2.x) are configured by default to include only
+dnl a subset of the System V IPC calls. Therefore, to make sure
+dnl all of the required calls are found, test for each call explicitly.
+dnl
+dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
+dnl modify any existing key sets. See the man pages for semget, shmget,
+dnl msgget, semctl, shmctl and msgctl for details.
+
+AC_DEFUN([RTEMS_UNION_SEMUN],
+[
+AC_CACHE_CHECK([whether $host defines union semun],
+ rtems_cv_HAS_UNION_SEMUN,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>]], [[union semun arg ;]])],[rtems_cv_HAS_UNION_SEMUN="yes"],[rtems_cv_HAS_UNION_SEMUN="no"])
+])
+if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then
+ AC_DEFINE(HAS_UNION_SEMUN,[1],[if having union semum])
+fi
+])
+
+AC_DEFUN([RTEMS_SYSV_SEM],
+[AC_REQUIRE([AC_PROG_CC])
+AC_CACHE_CHECK(whether $host supports System V semaphores,
+rtems_cv_sysv_sem,
+[
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#if !HAS_UNION_SEMUN
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ } ;
+#endif
+int main () {
+ union semun arg ;
+
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ exit(1);
+ exit(0);
+}
+]])],[rtems_cv_sysv_sem="yes"],[rtems_cv_sysv_sem="no"],[:])
+])
+])
+
+AC_DEFUN([RTEMS_SYSV_SHM],
+[AC_REQUIRE([AC_PROG_CC])
+# AC_REQUIRE([RTEMS_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $host supports System V shared memory,
+rtems_cv_sysv_shm,
+[
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+ int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ exit(1);
+ exit(0);
+}
+]])],[rtems_cv_sysv_shm="yes"],[rtems_cv_sysv_shm="no"],[:])
+])
+])
+
+AC_DEFUN([RTEMS_SYSV_MSG],
+[AC_REQUIRE([AC_PROG_CC])
+# AC_REQUIRE([RTEMS_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $host supports System V messages,
+rtems_cv_sysv_msg,
+[
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+int main () {
+ int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (msgctl(id, IPC_RMID, 0) == -1)
+ exit(1);
+ exit(0);
+}
+]])],[rtems_cv_sysv_msg="yes"],[rtems_cv_sysv_msg="no"],[:])
+])
+])
+
+AC_DEFUN([RTEMS_CHECK_SYSV_UNIX],
+[# AC_REQUIRE([RTEMS_CANONICAL_HOST])
+if test "$RTEMS_CPU" = "unix" ; then
+ RTEMS_UNION_SEMUN
+ RTEMS_SYSV_SEM
+ if test "$rtems_cv_sysv_sem" != "yes" ; then
+ AC_MSG_ERROR([System V semaphores don't work, required by simulator])
+ fi
+ RTEMS_SYSV_SHM
+ if test "$rtems_cv_sysv_shm" != "yes" ; then
+ AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
+ fi
+ RTEMS_SYSV_MSG
+ if test "$rtems_cv_sysv_msg" != "yes" ; then
+ AC_MSG_ERROR([System V messages don't work, required by simulator])
+ fi
+fi
+])
diff --git a/cpukit/aclocal/version.m4 b/cpukit/aclocal/version.m4
new file mode 100644
index 0000000000..adf855f413
--- /dev/null
+++ b/cpukit/aclocal/version.m4
@@ -0,0 +1,2 @@
+AC_DEFUN([RTEMS_VERSIONING],
+m4_define([_RTEMS_VERSION],[4.6.99.0]))