summaryrefslogtreecommitdiffstats
path: root/aclocal
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-02 15:44:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-02 15:44:04 +0000
commit2e0fd4273d942d48194c27530a67cd5323c80812 (patch)
tree076d11c8567fc9d138dbfc50e8c6d1c20e74252c /aclocal
parent2000-11-01 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-2e0fd4273d942d48194c27530a67cd5323c80812.tar.bz2
2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* aclocal/*: Replace with contents of macros/*.m4 * macros/: Remove. * aclocal/ar-s.m4 aclocal/tool-prefix.m4: Remove. * Makefile.am: Reflect changes to aclocal/ and macros/.
Diffstat (limited to 'aclocal')
-rw-r--r--aclocal/ar-s.m425
-rw-r--r--aclocal/canonicalize-tools.m446
-rw-r--r--aclocal/check-cxx.m42
-rw-r--r--aclocal/check-newlib.m41
-rw-r--r--aclocal/enable-rtemsbsp.m49
-rw-r--r--aclocal/gcc-pipe.m46
-rw-r--r--aclocal/gcc-specs.m46
-rw-r--r--aclocal/i386-gas-code16.m49
-rw-r--r--aclocal/multilib.m414
-rw-r--r--aclocal/prog-cc.m455
-rw-r--r--aclocal/prog-cxx.m464
-rw-r--r--aclocal/project-root.m419
-rw-r--r--aclocal/rtems-top.m430
-rw-r--r--aclocal/target.m454
-rw-r--r--aclocal/tool-prefix.m422
15 files changed, 99 insertions, 263 deletions
diff --git a/aclocal/ar-s.m4 b/aclocal/ar-s.m4
deleted file mode 100644
index 2119c43a6d..0000000000
--- a/aclocal/ar-s.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
-[
-AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
-rtems_cv_AR_FOR_TARGET_S,
-[
-cat > conftest.$ac_ext <<EOF
-int foo( int b )
-{ return b; }
-EOF
-if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
- && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
- && test -s conftest.a ; \
-then
- rtems_cv_AR_FOR_TARGET_S="yes"
-else
- rtems_cv_AR_FOR_TARGET_S="no"
-fi
- rm -f conftest*
-])
-])
-
diff --git a/aclocal/canonicalize-tools.m4 b/aclocal/canonicalize-tools.m4
index 7d76ab74b1..811825b538 100644
--- a/aclocal/canonicalize-tools.m4
+++ b/aclocal/canonicalize-tools.m4
@@ -3,17 +3,16 @@ dnl $Id$
dnl
dnl Set target tools
dnl
-dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl fixing cache/environment variable handling
-dnl adding checks for cygwin/egcs '\\'-bug
-dnl adding checks for ranlib/ar -s problem
-dnl
-dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl
+
+AC_DEFUN(RTEMS_HOST_AR,
+[AC_CHECK_TOOL(AR,ar,no)])
+
+AC_DEFUN(RTEMS_HOST_RANLIB,
+[AC_CHECK_TOOL(RANLIB,ranlib,:)])
AC_DEFUN(RTEMS_GCC_PRINT,
[
- $1=`$CC_FOR_TARGET --print-prog-name=$2`
+ $1=`$CC --print-prog-name=$2`
])
AC_DEFUN(RTEMS_PATH_TOOL,
@@ -28,7 +27,7 @@ if test -n "$ac_cv_path_$1"; then
else
dnl the cache was not set
if test -z "[$]$1" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
+ if test "$ac_cv_prog_gcc" = "yes"; then
# We are using gcc, ask it about its tool
# NOTE: Necessary if gcc was configured to use the target's
# native tools or uses prefixes for gnutools (e.g. gas instead of as)
@@ -61,29 +60,16 @@ AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
[AC_REQUIRE([RTEMS_PROG_CC])dnl
dnl FIXME: What shall be done if these tools are not available?
- RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
- RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
- RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
- RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
+ RTEMS_HOST_AR(AR,ar,no)
+ RTEMS_PATH_TOOL(AS,as,no)
+ RTEMS_PATH_TOOL(LD,ld,no)
+ RTEMS_PATH_TOOL(NM,nm,no)
dnl special treatment of ranlib
- RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
- if test "$RANLIB_FOR_TARGET" = "no"; then
- # ranlib wasn't found; check if ar -s is available
- RTEMS_AR_FOR_TARGET_S
- if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
- dnl override RANLIB_FOR_TARGET's cache
- ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
- RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
- else
- AC_MSG_ERROR([***]
- [Can't figure out how to build a library index]
- [Neither ranlib nor ar -s seem to be available] )
- fi
- fi
+ RTEMS_HOST_RANLIB
dnl NOTE: These may not be available if not using gnutools
- RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
- RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
- RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
+ AC_CHECK_TOOL(OBJCOPY,objcopy,no)
+ AC_CHECK_TOOL(SIZE,size,no)
+ AC_CHECK_TOOL(STRIP,strip,:)
])
diff --git a/aclocal/check-cxx.m4 b/aclocal/check-cxx.m4
index 997f0fbf6a..aa51596de5 100644
--- a/aclocal/check-cxx.m4
+++ b/aclocal/check-cxx.m4
@@ -8,7 +8,7 @@ AC_REQUIRE([RTEMS_PROG_CXX_FOR_TARGET])dnl
AC_CACHE_CHECK([whether to build rtems++],
rtems_cv_HAS_CPLUSPLUS,
[ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
- if test -n "$CXX_FOR_TARGET"; then
+ if test -n "$CXX"; then
rtems_cv_HAS_CPLUSPLUS="yes"
else
rtems_cv_HAS_CPLUSPLUS="no"
diff --git a/aclocal/check-newlib.m4 b/aclocal/check-newlib.m4
index e5f55f9f2f..1984001dc8 100644
--- a/aclocal/check-newlib.m4
+++ b/aclocal/check-newlib.m4
@@ -8,7 +8,6 @@ AC_CACHE_CHECK([for newlib],
rtems_cv_use_newlib,
[
rtems_save_CC=$CC
- CC=$CC_FOR_TARGET
dnl some versions of newlib provide not_required_by_rtems
AC_TRY_LINK(
diff --git a/aclocal/enable-rtemsbsp.m4 b/aclocal/enable-rtemsbsp.m4
index fd31997d3c..a1fb24a335 100644
--- a/aclocal/enable-rtemsbsp.m4
+++ b/aclocal/enable-rtemsbsp.m4
@@ -38,8 +38,9 @@ RTEMS_ENABLE_BARE
AC_SUBST(BARE_CPU_MODEL)
AC_SUBST(BARE_CPU_CFLAGS)
-## RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
-## AC_SUBST(RTEMS_ROOT)
+RTEMS_ROOT=$PROJECT_ROOT/c/$RTEMS_BSP
+AC_SUBST(RTEMS_ROOT)
+AM_CONDITIONAL(RTEMS_CONFIG_PER_BSP, test x = x);
])
AC_DEFUN(RTEMS_ENV_RTEMSCPU,
@@ -52,7 +53,7 @@ else
rtems_cv_RTEMS_BSP="multilib"
RTEMS_BSP="$rtems_cv_RTEMS_BSP"
AC_SUBST(RTEMS_BSP)
-## RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c
-## AC_SUBST(RTEMS_ROOT)
+ RTEMS_ROOT=$PROJECT_ROOT/c
+ AC_SUBST(RTEMS_ROOT)
fi
])
diff --git a/aclocal/gcc-pipe.m4 b/aclocal/gcc-pipe.m4
index cb78506723..dd3a9581d4 100644
--- a/aclocal/gcc-pipe.m4
+++ b/aclocal/gcc-pipe.m4
@@ -7,12 +7,12 @@ dnl
AC_DEFUN(RTEMS_GCC_PIPE,
[AC_REQUIRE([RTEMS_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
+AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe,
[
rtems_cv_gcc_pipe=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
+if test "$ac_cv_prog_gcc" = "yes"; then
echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
+ if test -z "`${CC} --pipe -c conftest.c 2>&1`";then
rtems_cv_gcc_pipe=yes
fi
rm -f conftest*
diff --git a/aclocal/gcc-specs.m4 b/aclocal/gcc-specs.m4
index 1c77eb634a..7d90d24644 100644
--- a/aclocal/gcc-specs.m4
+++ b/aclocal/gcc-specs.m4
@@ -6,13 +6,13 @@ dnl
AC_DEFUN(RTEMS_GCC_SPECS,
[AC_REQUIRE([RTEMS_PROG_CC])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
+AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs,
[
rtems_cv_gcc_specs=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
+if test "$ac_cv_prog_gcc" = "yes"; then
touch confspec
echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
+ if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then
rtems_cv_gcc_specs=yes
fi
fi
diff --git a/aclocal/i386-gas-code16.m4 b/aclocal/i386-gas-code16.m4
index 864f38a5bd..9bb0030d94 100644
--- a/aclocal/i386-gas-code16.m4
+++ b/aclocal/i386-gas-code16.m4
@@ -6,7 +6,7 @@ dnl check for i386 gas supporting 16 bit mode
dnl - binutils 2.9.1.0.7 and higher
AC_DEFUN(RTEMS_I386_GAS_CODE16,
-[ if test "${target_cpu}" = "i386"; then
+[ if test "${host_cpu}" = "i386"; then
AC_CACHE_CHECK([for 16 bit mode assembler support],
rtems_cv_prog_gas_code16,
[cat > conftest.s << EOF
@@ -15,7 +15,7 @@ AC_DEFUN(RTEMS_I386_GAS_CODE16,
addr32
lgdt 0
EOF
- if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
+ if AC_TRY_COMMAND($AS -o conftest.o conftest.s); then
rtems_cv_prog_gas_code16=yes
else
rtems_cv_prog_gas_code16=no
@@ -23,6 +23,9 @@ EOF
RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
fi
AC_SUBST(RTEMS_GAS_CODE16)
- AC_DEFINE_UNQUOTED(NEW_GAS,1,[if using 16 bit mode assembler support])
+ if test x"${RTEMS_GAS_CODE16}" = x"yes";
+ then
+ AC_DEFINE_UNQUOTED(NEW_GAS,1,[if using 16 bit mode assembler support])
+ fi
])
diff --git a/aclocal/multilib.m4 b/aclocal/multilib.m4
index 1d11561f0a..5e0c5272d1 100644
--- a/aclocal/multilib.m4
+++ b/aclocal/multilib.m4
@@ -22,8 +22,6 @@ AC_REQUIRE([RTEMS_ENABLE_MULTILIB])
dnl We may get other options which we don't document:
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-test -z "[$]{with_target_subdir}" && with_target_subdir=.
-
if test "[$]{srcdir}" = "."; then
if test "[$]{with_target_subdir}" != "."; then
multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])"
@@ -42,18 +40,18 @@ else
fi
AC_OUTPUT_COMMANDS(
- if test -n "$CONFIG_FILES"; do
- $ac_file" = ifelse([$1],,Makefile,[$1]) \
+ if test -n "$CONFIG_FILES"; then
+ ac_file=[]ifelse([$1],,Makefile,[$1]) \
. ${multilib_basedir}/../config-ml.in
- fi,
+ fi,[
srcdir=${srcdir}
host=${host}
target=${target}
-# with_multisrctop="${with_multisrctop}"
-# with_target_subdir="${with_target_subdir}"
+ 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}")
+ CC="${CC}"])
])
diff --git a/aclocal/prog-cc.m4 b/aclocal/prog-cc.m4
index 3cc83ff3c5..81ca5ca75a 100644
--- a/aclocal/prog-cc.m4
+++ b/aclocal/prog-cc.m4
@@ -9,62 +9,13 @@ 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
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
AC_REQUIRE([RTEMS_ENABLE_GCC28])dnl
-dnl Only accept gcc and cc
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
-test -z "$CC_FOR_TARGET" \
- && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+AC_CHECK_TOOL(CC,gcc)
+AC_PROG_CC
-dnl backup
-rtems_save_CC=$CC
-rtems_save_CFLAGS=$CFLAGS
-
-dnl temporarily set CC
-CC=$CC_FOR_TARGET
-
-AC_PROG_CC_WORKS
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-rtems_cv_prog_gcc=$ac_cv_prog_gcc
-rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
-rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
-rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
-
-dnl restore initial values
-CC=$rtems_save_CC
-CFLAGS=$rtems_save_CFLAGS
-
-unset ac_cv_prog_gcc
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cc_works
-unset ac_cv_prog_cc_cross
-
-AM_CONDITIONAL(RTEMS_USE_GCC,test x"$rtems_cv_prog_gcc" = x"yes")
+AM_CONDITIONAL(RTEMS_USE_GCC,test x"$ac_cv_prog_gcc" = x"yes")
])
AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
diff --git a/aclocal/prog-cxx.m4 b/aclocal/prog-cxx.m4
index aa8716df7e..d9159677b8 100644
--- a/aclocal/prog-cxx.m4
+++ b/aclocal/prog-cxx.m4
@@ -3,78 +3,28 @@ dnl $Id$
dnl
dnl Check for target g++
dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Completely reworked
AC_DEFUN(RTEMS_PROG_CXX,
[
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_BEFORE([$0], [AC_PROG_CXX])dnl
AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
-dnl Only accept g++ and c++
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
-test -z "$CXX_FOR_TARGET" \
+dnl Only accept g++
+dnl NOTE: This might be too restrictive
+AC_CHECK_TOOL(CXX,g++)
+AC_PROG_CXX
+test -z "$CXX" \
&& AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
-dnl backup
-rtems_save_CXX=$CXX
-rtems_save_CXXFLAGS=$CXXFLAGS
-
-dnl temporarily set CXX
-CXX=$CXX_FOR_TARGET
-
-AC_PROG_CXX_WORKS
-AC_PROG_CXX_GNU
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
-dnl Check whether -g works, even if CXXFLAGS is set, in case the package
-dnl plays around with CXXFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-
-rtems_cv_prog_gxx=$ac_cv_prog_gxx
-rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
-rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
-rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
-
-CXX=$rtems_save_CXX
-CXXFLAGS=$rtems_save_CXXFLAGS
-
-dnl restore initial values
-unset ac_cv_prog_gxx
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cxx_works
-unset ac_cv_prog_cxx_cross
-dnl somehow autoconf macros leave this file
-rm -f conftest.C
])
AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET,
[
RTEMS_PROG_CXX
- if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
+ if test "$ac_cv_prog_cc_cross" != "$ac_cv_prog_cxx_cross"; then
AC_MSG_ERROR([***]
[Inconsistency in compiler configuration:]
- [Target C compiler and Target C++ compiler]
+ [Target C compiler and target C++ compiler]
[must both either be cross compilers or native compilers]
[Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
fi
diff --git a/aclocal/project-root.m4 b/aclocal/project-root.m4
index 35fd15b7aa..1f5fb677f5 100644
--- a/aclocal/project-root.m4
+++ b/aclocal/project-root.m4
@@ -15,25 +15,6 @@ dnl
AC_DEFUN(RTEMS_PROJECT_ROOT,
[dnl
AC_REQUIRE([RTEMS_TOP])
-if test "$TARGET_SUBDIR" = "." ; then
-# Native
-PROJECT_TOPdir=${RTEMS_TOPdir}/'$(top_builddir)'
-PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)';
-else
-# FIXME: Moving the build-tree
-# PROJECT_TOPdir=../${RTEMS_TOPdir}/'$(top_builddir)'
-# PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)'
-
-# FIXME: Old, per-bsp building style
-PROJECT_TOPdir=../${RTEMS_TOPdir}/'$(top_builddir)'
-PROJECT_ROOT=../${RTEMS_TOPdir}/'$(top_builddir)'
-fi
-AC_SUBST(PROJECT_ROOT)
-AC_SUBST(PROJECT_TOPdir)
-
-# FIXME: This should not be here
-RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
-AC_SUBST(RTEMS_ROOT)
PACKHEX="\$(PROJECT_TOPdir)/tools/build/packhex"
AC_SUBST(PACKHEX)
diff --git a/aclocal/rtems-top.m4 b/aclocal/rtems-top.m4
index fa990e9105..fa79019df7 100644
--- a/aclocal/rtems-top.m4
+++ b/aclocal/rtems-top.m4
@@ -15,17 +15,37 @@ AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
ENDIF=endif
AC_SUBST(ENDIF)
-## HACK to destinguish between using GNU and RTEMS canonicalization
-AM_CONDITIONAL(RTEMS_CANONICALIZATION,test x=x)
-
+# with_target_subdir
AC_ARG_WITH(target-subdir,
[ --with-target-subdir=DIR],
-TARGET_SUBDIR="$withval",
-TARGET_SUBDIR=".")
+with_target_subdir="$withval",
+with_target_subdir=".")
RTEMS_TOPdir="$1";
AC_SUBST(RTEMS_TOPdir)
+if test "$with_target_subdir" = "." ; then
+# Native
+PROJECT_TOPdir=${RTEMS_TOPdir}/'$(top_builddir)'
+else
+# Cross
+changequote(, )dnl
+dots=`echo $with_target_subdir|\
+sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+changequote([, ])dnl
+PROJECT_TOPdir=${dots}${RTEMS_TOPdir}/'$(top_builddir)'
+fi
+AC_SUBST(PROJECT_TOPdir)
+
+if test "$with_target_subdir" = "." ; then
+# Native
+PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)';
+else
+# Cross
+PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)'
+fi
+AC_SUBST(PROJECT_ROOT)
+
dnl Determine RTEMS Version string from the VERSION file
dnl Hopefully, Joel never changes its format ;-
AC_MSG_CHECKING([for RTEMS Version])
diff --git a/aclocal/target.m4 b/aclocal/target.m4
index 517811d51b..9c84490880 100644
--- a/aclocal/target.m4
+++ b/aclocal/target.m4
@@ -1,19 +1,21 @@
dnl $Id$
-AC_DEFUN(RTEMS_CONFIG_SUBDIRS,
+## HACK: Work-around to structural issue with RTEMS
+## The macros below violate most autoconf and canonicalization standards
+AC_DEFUN(RTEMS_CONFIG_BUILD_SUBDIRS,
[
-define([RTEMS_TGT_SUBDIRS],
-ifdef([RTEMS_TGT_SUBDIRS], [RTEMS_TGT_SUBDIRS ],)[$1])dnl
-target_subdirs="RTEMS_TGT_SUBDIRS"
-AC_SUBST(target_subdirs)
+define([RTEMS_BUILD_SUBDIRS],
+ifdef([RTEMS_BUILD_SUBDIRS], [RTEMS_BUILD_SUBDIRS ],)[$1])dnl
+build_subdirs="RTEMS_BUILD_SUBDIRS"
+AC_SUBST(build_subdirs)
])
dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS
-AC_DEFUN(RTEMS_OUTPUT_SUBDIRS,
+AC_DEFUN(RTEMS_OUTPUT_BUILD_SUBDIRS,
[
if test "$no_recursion" != yes; then
- if test $target_alias != $host_alias; then
- target_subdir="$target_alias"
+ if test $build_alias != $host_alias; then
+ target_subdir="$host_alias"
else
target_subdir="."
fi
@@ -36,11 +38,13 @@ if test "$no_recursion" != yes; then
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
+ --target*) ;;
+ --build*) ;;
+ --host*) ;;
*) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
esac
done
- test -d $target_subdir || mkdir $target_subdir
for ac_config_dir in $1; do
# Do not complain, so a configure script can configure whichever
@@ -49,24 +53,24 @@ if test "$no_recursion" != yes; then
continue
fi
- echo configuring in $target_subdir/$ac_config_dir
+ echo configuring in $ac_config_dir
case "$srcdir" in
## .) ;;
*)
- if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :;
+ if test -d $ac_config_dir || mkdir $ac_config_dir; then :;
else
- AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir)
+ AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
fi
;;
esac
ac_popdir=`pwd`
- cd $target_subdir/$ac_config_dir
+ cd $ac_config_dir
changequote(, )dnl
# A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $target_subdir/$ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
changequote([, ])dnl
case "$srcdir" in
@@ -78,11 +82,9 @@ changequote([, ])dnl
ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
esac
- # Check for guested configure; otherwise get Cygnus style configure.
+ # Check for configure
if test -f $ac_sub_srcdir/configure; then
ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
else
AC_MSG_WARN(no configuration information is in $ac_config_dir)
ac_sub_configure=
@@ -90,17 +92,7 @@ changequote([, ])dnl
# The recursion is here.
if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- if test "$target_alias" != "$host_alias"; then
- ac_sub_cache_file=$cache_file
- else
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- fi
+ ac_sub_cache_file=./config.cache
ifdef([AC_PROVIDE_AC_PROG_INSTALL],
[ case "$ac_given_INSTALL" in
changequote(, )dnl
@@ -113,8 +105,10 @@ changequote([, ])dnl
echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
# The eval makes quoting arguments work.
if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \
- $ac_sub_configure_args --srcdir=$ac_sub_srcdir \
- --with-target-subdir=$target_subdir --cache-file=$ac_sub_cache_file
+ $ac_sub_configure_args \
+ --srcdir=$ac_sub_srcdir \
+ --with-target-subdir=$target_subdir \
+ --cache-file=$ac_sub_cache_file
then :
else
AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
diff --git a/aclocal/tool-prefix.m4 b/aclocal/tool-prefix.m4
deleted file mode 100644
index 563cca8e8f..0000000000
--- a/aclocal/tool-prefix.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Set program_prefix
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Extracted from configure
-
-AC_DEFUN(RTEMS_TOOL_PREFIX,
-[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-
-changequote(,)dnl
-if [ "${program_prefix}" = "NONE" ] ; then
- if [ "${target}" = "${host}" ] ; then
- program_prefix=
- else
- program_prefix=${target}-
- fi
-fi
-changequote([,])dnl
-])