diff options
Diffstat (limited to 'cpukit/aclocal')
26 files changed, 635 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..230583bf8c --- /dev/null +++ b/cpukit/aclocal/canonical-target-name.m4 @@ -0,0 +1,27 @@ +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 +*-*-rtems*) + RTEMS_CPU="$host_cpu";; +*) + ;; +esac +AS_IF([test -n "$RTEMS_CPU"], +[dnl +AC_MSG_RESULT($RTEMS_CPU)], +[dnl +AC_MSG_RESULT([<none>]) +AC_MSG_ERROR([unsupported host $host])]) +AC_SUBST(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-func.m4 b/cpukit/aclocal/check-func.m4 new file mode 100644 index 0000000000..92787e1b87 --- /dev/null +++ b/cpukit/aclocal/check-func.m4 @@ -0,0 +1,23 @@ +# $Id$ + +# Check whether FUNCTION is declared in INCLUDES +# and whether rtems_stub_FUNCTION or FUNCTION is supplied. + +# RTEMS_CHECK_FUNC(FUNCTION[,INCLUDES]) +AC_DEFUN([RTEMS_CHECK_FUNC], +[AC_REQUIRE([RTEMS_CHECK_NEWLIB]) +AC_CHECK_DECLS([$1],,,[$2]) + +AC_CACHE_CHECK([for $1],[ac_cv_$1],[ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[$2]],[[rtems_stub_$1()]])], + [ac_cv_$1="stub"], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[$2]],[[$1()]])], + [ac_cv_$1="yes"], + [ac_cv_$1="no"]) + ]) + ]) +AS_IF([test "$ac_cv_$1" = yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1),[1],[Define to 1 if you have the `$1' function.])]) +]) 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..1b8fe38fd9 --- /dev/null +++ b/cpukit/aclocal/check-networking.m4 @@ -0,0 +1,32 @@ +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 "$host" in + *-*-rtems*) + AS_IF([test "${RTEMS_HAS_NETWORKING}" = "yes"],[ +# suppress libnetworking if one these types is not available + AS_IF([test x"$ac_cv_type_int8_t" = xyes \ + && test x"$ac_cv_type_uint8_t" = xyes \ + && test x"$ac_cv_type_int16_t" = xyes \ + && test x"$ac_cv_type_uint16_t" = xyes \ + && test x"$ac_cv_type_int32_t" = xyes \ + && test x"$ac_cv_type_uint32_t" = xyes \ + && test x"$ac_cv_type_int64_t" = xyes \ + && test x"$ac_cv_type_uint64_t" = xyes], + [rtems_cv_HAS_NETWORKING=yes], + [rtems_cv_HAS_NETWORKING=no]) + ],[ + rtems_cv_HAS_NETWORKING=disabled + ]) + ;; + esac + ]) + ]) +]) 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..a00dc2456b --- /dev/null +++ b/cpukit/aclocal/check-posix.m4 @@ -0,0 +1,20 @@ +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 "$host" in + *-*-rtems*) + 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..ef5c14efef --- /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-smp.m4 b/cpukit/aclocal/check-smp.m4 new file mode 100644 index 0000000000..294f5c9d2c --- /dev/null +++ b/cpukit/aclocal/check-smp.m4 @@ -0,0 +1,19 @@ +dnl $Id$ +dnl +AC_DEFUN([RTEMS_CHECK_SMP], +[dnl +AC_REQUIRE([RTEMS_ENABLE_SMP])dnl + +AC_CACHE_CHECK([whether CPU supports libposix], + rtems_cv_HAS_SMP, + [dnl + case "$RTEMS_CPU" in + *) + if test "${RTEMS_HAS_SMP}" = "yes"; then + rtems_cv_HAS_SMP="yes"; + else + rtems_cv_HAS_SMP="disabled"; + fi + ;; + esac]) +]) 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-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..8859e54e7f --- /dev/null +++ b/cpukit/aclocal/enable-posix.m4 @@ -0,0 +1,23 @@ +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 + no_cpu-*rtems*) + 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/enable-smp.m4 b/cpukit/aclocal/enable-smp.m4 new file mode 100644 index 0000000000..84561f8bbd --- /dev/null +++ b/cpukit/aclocal/enable-smp.m4 @@ -0,0 +1,18 @@ +dnl $Id$ + +AC_DEFUN([RTEMS_ENABLE_SMP], +[ +## AC_BEFORE([$0], [RTEMS_CHECK_SMP])dnl + +AC_ARG_ENABLE(smp, +[AS_HELP_STRING([--enable-smp],[enable smp interface])], +[case "${enableval}" in + yes) case "${RTEMS_CPU}" in + sparc|i386) RTEMS_HAS_SMP=yes ;; + *) RTEMS_HAS_SMP=no ;; + esac + ;; + no) RTEMS_HAS_SMP=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for enable-smp option) ;; +esac],[RTEMS_HAS_SMP=no]) +]) diff --git a/cpukit/aclocal/env-rtemscpu.m4 b/cpukit/aclocal/env-rtemscpu.m4 new file mode 100644 index 0000000000..65dea4ef49 --- /dev/null +++ b/cpukit/aclocal/env-rtemscpu.m4 @@ -0,0 +1,8 @@ +dnl $Id$ + +AC_DEFUN([RTEMS_ENV_RTEMSCPU], +[ + AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) + + AM_CONDITIONAL([MULTILIB],[test x"$multilib" = x"yes"]) +]) 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/gcc-sanity.m4 b/cpukit/aclocal/gcc-sanity.m4 new file mode 100644 index 0000000000..0177009e28 --- /dev/null +++ b/cpukit/aclocal/gcc-sanity.m4 @@ -0,0 +1,114 @@ +# Some GCC sanity checks to check for known bugs in the rtems gcc toolchains + +# Internal macro +# _RTEMS_GCC_WARNING(msg,cache-variable,include,main) +AC_DEFUN([_RTEMS_GCC_WARNING],[ + AC_CACHE_CHECK([$1], + [$2],[ + AS_IF([test x"$GCC" = xyes],[ + save_CFLAGS=$CFLAGS + CFLAGS="-Wall -Werror"]) + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([$3],[$4])], + [$2=yes], + [$2=no]) + + AS_IF([test x"$GCC" = xyes],[ + CFLAGS=$save_CFLAGS]) + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRIxPTR],[ + _RTEMS_GCC_WARNING( + [if printf("%" PRIxPTR, uintptr_t) works], + [rtems_cv_PRIxPTR],[ + #include <inttypes.h> + #include <stdio.h> + ],[ + uintptr_t ptr = 42; + printf("%" PRIxPTR "\n", ptr); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRIuPTR],[ + _RTEMS_GCC_WARNING( + [if printf("%" PRIuPTR, uintptr_t) works], + [rtems_cv_PRIuPTR],[ + #include <inttypes.h> + #include <stdio.h> + ],[ + uintptr_t ptr = 42; + printf("%" PRIuPTR "\n", ptr); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRIdPTR],[ + _RTEMS_GCC_WARNING( + [if printf("%" PRIdPTR, intptr_t) works], + [rtems_cv_PRIdPTR],[ + #include <inttypes.h> + #include <stdio.h> + ],[ + intptr_t ptr = -1; + printf("%" PRIdPTR "\n", ptr); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_ZU_SIZE_T],[ + _RTEMS_GCC_WARNING( + [if printf("%zu", size_t) works], + [rtems_cv_PRINTF_ZU_SIZE_T],[ + #include <sys/types.h> + #include <stdio.h> + ],[ + size_t sz = 1; + printf("%zu\n", sz); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_ZD_SSIZE_T],[ + _RTEMS_GCC_WARNING( + [if printf("%zd", ssize_t) works], + [rtems_cv_PRINTF_ZD_SSIZE_T],[ + #include <sys/types.h> + #include <stdio.h> + ],[ + ssize_t sz = 1; + printf("%zd\n", sz); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_LD_OFF_T],[ + _RTEMS_GCC_WARNING( + [if printf("%ld", off_t) works], + [rtems_cv_PRINTF_LD_OFF_T],[ + #include <sys/types.h> + #include <stdio.h> + ],[ + off_t off = 1; + printf("%ld\n", off); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_LLD_OFF_T],[ + _RTEMS_GCC_WARNING( + [if printf("%lld", off_t) works], + [rtems_cv_PRINTF_LLD_OFF_T],[ + #include <sys/types.h> + #include <stdio.h> + ],[ + off_t off = 1; + printf("%lld\n", off); + ]) +]) + +AC_DEFUN([RTEMS_CHECK_GCC_SANITY],[ +RTEMS_CHECK_GCC_PRIxPTR +RTEMS_CHECK_GCC_PRIuPTR +RTEMS_CHECK_GCC_PRIdPTR +RTEMS_CHECK_GCC_PRINTF_ZU_SIZE_T +RTEMS_CHECK_GCC_PRINTF_ZD_SSIZE_T +RTEMS_CHECK_GCC_PRINTF_LD_OFF_T +RTEMS_CHECK_GCC_PRINTF_LLD_OFF_T +]) diff --git a/cpukit/aclocal/gcc-weak.m4 b/cpukit/aclocal/gcc-weak.m4 new file mode 100644 index 0000000000..73cfb28e7e --- /dev/null +++ b/cpukit/aclocal/gcc-weak.m4 @@ -0,0 +1,19 @@ +AC_DEFUN([RTEMS_CHECK_GCC_WEAK],[ +AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))], +[rtems_cv_cc_attribute_weak],[ + AS_IF([test x"$GCC" = xyes],[ + save_CFLAGS=$CFLAGS + CFLAGS=-Werror]) + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [void myfunc(char c) __attribute__ ((weak)); + void myfunc(char c) {}], + [])], + [rtems_cv_cc_attribute_weak=yes], + [rtems_cv_cc_attribute_weak=no]) + + AS_IF([test x"$GCC" = xyes],[ + CFLAGS=$save_CFLAGS]) +]) +]) diff --git a/cpukit/aclocal/multi.m4 b/cpukit/aclocal/multi.m4 new file mode 100644 index 0000000000..7cdc3cb023 --- /dev/null +++ b/cpukit/aclocal/multi.m4 @@ -0,0 +1,50 @@ +#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_CONFIG_COMMANDS([default-1],[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..6de5b33d57 --- /dev/null +++ b/cpukit/aclocal/prog-cc.m4 @@ -0,0 +1,41 @@ +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_CHECK_TOOL(CC,gcc) +test -z "$CC" && \ + AC_MSG_ERROR([no acceptable cc found in \$PATH]) +AC_PROG_CC +AC_PROG_CPP +]) + +AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET], +[ +# Was CFLAGS set? +rtems_cv_CFLAGS_set="${CFLAGS+set}" +dnl check target cc +RTEMS_PROG_CC +dnl check if the target compiler may use --pipe +RTEMS_GCC_PIPE +test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" + +# Append warning flags if CFLAGS wasn't set. +AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set], +[CFLAGS="$CFLAGS -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"]) + +RTEMS_CPPFLAGS="-I\$(top_builddir) -I\$(PROJECT_INCLUDE)" +AC_SUBST(RTEMS_CPPFLAGS) + +AS_IF([test "$GCC" = yes],[ + RTEMS_RELLDFLAGS="-qnolinkcmds -nostdlib -r" +]) +AC_SUBST(RTEMS_RELLDFLAGS) +]) diff --git a/cpukit/aclocal/prog-ccas.m4 b/cpukit/aclocal/prog-ccas.m4 new file mode 100644 index 0000000000..15b1a2c9b8 --- /dev/null +++ b/cpukit/aclocal/prog-ccas.m4 @@ -0,0 +1,8 @@ +## $Id$ + +AC_DEFUN([RTEMS_PROG_CCAS], +[ +AC_REQUIRE([RTEMS_PROG_CC]) +AM_PROG_AS +AC_SUBST(RTEMS_CCASFLAGS,["-DASM \$(CFLAGS)"]) +]) diff --git a/cpukit/aclocal/rtems-ampolish.m4 b/cpukit/aclocal/rtems-ampolish.m4 new file mode 100644 index 0000000000..328df7afcb --- /dev/null +++ b/cpukit/aclocal/rtems-ampolish.m4 @@ -0,0 +1,12 @@ +# $Id$ + +AC_DEFUN([RTEMS_AMPOLISH3], +[ +AC_REQUIRE([AM_MAINTAINER_MODE]) +AC_PATH_PROG([PERL],[perl],[]) +AC_SUBST(AMPOLISH3,["\$(PERL) ${am_aux_dir}/ampolish3"]) +AM_CONDITIONAL([AMPOLISH3], +[test x"$USE_MAINTAINER_MODE" = x"yes" \ + && test -n "${PERL}"]) +]) + diff --git a/cpukit/aclocal/rtems-top.m4 b/cpukit/aclocal/rtems-top.m4 new file mode 100644 index 0000000000..357ea55c4d --- /dev/null +++ b/cpukit/aclocal/rtems-top.m4 @@ -0,0 +1,72 @@ +dnl $Id$ + +# AC_DISABLE_OPTION_CHECKING is not available before 2.62 +AC_PREREQ(2.62) + +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_REQUIRE([AC_DISABLE_OPTION_CHECKING]) +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/version.m4 b/cpukit/aclocal/version.m4 new file mode 100644 index 0000000000..6ca81ac661 --- /dev/null +++ b/cpukit/aclocal/version.m4 @@ -0,0 +1,4 @@ +AC_DEFUN([RTEMS_VERSIONING], +m4_define([_RTEMS_VERSION],[4.10.99.0])) + +m4_define([_RTEMS_API],[4.11]) |