summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-31 21:20:00 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-31 21:20:00 +0000
commit3174a7edaefd2d1f59af44c7f6856c69327ecf9d (patch)
tree101990c9e3421b7d76dd2a0962442005b357efab
parent846027b9b8e2d1a645681f9c0a5f3e75a02422df (diff)
downloadrtems-3174a7edaefd2d1f59af44c7f6856c69327ecf9d.tar.bz2
2000-10-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.in: New, Cygnus/GNU style configuration. * Makefile.am: Add macros/, reflect new configure.in, ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/macros * automake/compile.am: BSP_SPECS, remove RTEMS_CANONICALIZATION. * automake/lib.am: Remove RTEMS_CANONICALIZATION. * macros/tool-prefix.m4: Remove. * macros/target.m4: Remove RTEMS_CONFIG_SUBDIRS, RTEMS_OUTPUT_SUBDIRS. * macros/enable-rtemsbsp.m4: Add RTEMS_CONFIG_PER_BSP, add setting RTEMS_ROOT. * macros/i386-gas-code16.m4: Define NEW_GAS only for 16bit mode- * macros/multilib.m4: Various minor fixes. * macros/project-root.m4: Remove setting PROJECT_TOPdir, PROJECT_ROOT, RTEMS_ROOT. * macros/rtems-top.m4: Remove RTEMS_CANONICALIZATION, TARGET_SUBDIRS; Add with_target_subdirs, PROJECT_TOPdir, PROJECT_ROOT.
-rw-r--r--ChangeLog18
-rw-r--r--Makefile.am42
-rw-r--r--automake/compile.am31
-rw-r--r--automake/lib.am3
-rw-r--r--configure.in276
-rw-r--r--macros/enable-rtemsbsp.m49
-rw-r--r--macros/i386-gas-code16.m45
-rw-r--r--macros/multilib.m414
-rw-r--r--macros/prog-cc.m41
-rw-r--r--macros/prog-cxx.m41
-rw-r--r--macros/project-root.m419
-rw-r--r--macros/rtems-top.m430
-rw-r--r--macros/target.m4129
-rw-r--r--macros/tool-prefix.m422
14 files changed, 339 insertions, 261 deletions
diff --git a/ChangeLog b/ChangeLog
index b0f74d1d10..7e095b1d81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2000-10-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * configure.in: New, Cygnus/GNU style configuration.
+ * Makefile.am: Add macros/, reflect new configure.in,
+ ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/macros
+ * automake/compile.am: BSP_SPECS, remove RTEMS_CANONICALIZATION.
+ * automake/lib.am: Remove RTEMS_CANONICALIZATION.
+ * macros/tool-prefix.m4: Remove.
+ * macros/target.m4: Remove RTEMS_CONFIG_SUBDIRS, RTEMS_OUTPUT_SUBDIRS.
+ * macros/enable-rtemsbsp.m4: Add RTEMS_CONFIG_PER_BSP, add setting
+ RTEMS_ROOT.
+ * macros/i386-gas-code16.m4: Define NEW_GAS only for 16bit mode-
+ * macros/multilib.m4: Various minor fixes.
+ * macros/project-root.m4: Remove setting PROJECT_TOPdir,
+ PROJECT_ROOT, RTEMS_ROOT.
+ * macros/rtems-top.m4: Remove RTEMS_CANONICALIZATION, TARGET_SUBDIRS;
+ Add with_target_subdirs, PROJECT_TOPdir, PROJECT_ROOT.
+
2000-10-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* automake/multilib.am: New file.
diff --git a/Makefile.am b/Makefile.am
index c13e8e2a09..d91ad10096 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,31 +7,29 @@
##
AUTOMAKE_OPTIONS = foreign 1.4
-ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/macros
-SUBDIRS = doc make tools @TARGET_SUBDIRS@
+SUBDIRS = doc make tools $(HOST_SUBDIRS) $(TARGET_SUBDIRS)
AUTOMAKE_FILES = automake/compile.am automake/host.am automake/lib.am \
- automake/local.am automake/multilib.am automake/subdirs.am
-
-ACLOCAL_FILES += aclocal/ar-s.m4 aclocal/bsp-alias.m4 \
- aclocal/canonical-host.m4 aclocal/canonical-target-name.m4 \
- aclocal/canonicalize-tools.m4 aclocal/check-bsps.m4 \
- aclocal/check-bsp-cache.m4 aclocal/check-cpu.m4 aclocal/check-cxx.m4 \
- aclocal/check-itron.m4 aclocal/check-multiprocessing.m4 \
- aclocal/check-networking.m4 aclocal/check-newlib.m4 \
- aclocal/check-posix.m4 aclocal/check-rdbg.m4 aclocal/enable-bare.m4 \
- aclocal/enable-cxx.m4 aclocal/enable-gcc28.m4 \
- aclocal/enable-inlines.m4 aclocal/enable-itron.m4 \
- aclocal/enable-libcdir.m4 aclocal/enable-multiprocessing.m4 \
- aclocal/enable-networking.m4 aclocal/enable-posix.m4 \
- aclocal/enable-rdbg.m4 aclocal/enable-rtemsbsp.m4 \
- aclocal/enable-tests.m4 aclocal/gcc-pipe.m4 aclocal/gcc-specs.m4 \
- aclocal/i386-gas-code16.m4 aclocal/path-ksh.m4 aclocal/path-perl.m4 \
- aclocal/prog-cc.m4 aclocal/prog-cxx.m4 aclocal/project-root.m4 \
- aclocal/rtems-top.m4 aclocal/sysv-ipc.m4 aclocal/target.m4 \
- aclocal/tool-paths.m4 aclocal/tool-prefix.m4 aclocal/multilib.m4 \
- aclocal/rtems-debug.m4 aclocal/rtems-test-no-pause.m4
+ automake/local.am automake/multilib.am automake/subdirs.am
+
+ACLOCAL_FILES += macros/bsp-alias.m4 macros/canonical-host.m4 \
+ macros/canonical-target-name.m4 macros/canonicalize-tools.m4 \
+ macros/check-bsp-cache.m4 macros/check-bsps.m4 macros/check-cpu.m4 \
+ macros/check-cxx.m4 macros/check-itron.m4 \
+ macros/check-multiprocessing.m4 macros/check-networking.m4 \
+ macros/check-newlib.m4 macros/check-posix.m4 macros/check-rdbg.m4 \
+ macros/enable-bare.m4 macros/enable-cxx.m4 macros/enable-gcc28.m4 \
+ macros/enable-inlines.m4 macros/enable-itron.m4 macros/enable-libcdir.m4 \
+ macros/enable-multiprocessing.m4 macros/enable-networking.m4 \
+ macros/enable-posix.m4 macros/enable-rdbg.m4 macros/enable-rtemsbsp.m4 \
+ macros/enable-tests.m4 macros/gcc-pipe.m4 macros/gcc-specs.m4 \
+ macros/i386-gas-code16.m4 macros/multilib.m4 macros/path-ksh.m4 \
+ macros/path-perl.m4 macros/prog-cc.m4 macros/prog-cxx.m4 \
+ macros/project-root.m4 macros/rtems-debug.m4 \
+ macros/rtems-test-no-pause.m4 macros/rtems-top.m4 macros/sysv-ipc.m4 \
+ macros/target.m4 macros/tool-paths.m4
noinst_SCRIPTS = bootstrap
diff --git a/automake/compile.am b/automake/compile.am
index 938722f277..5090ce0eee 100644
--- a/automake/compile.am
+++ b/automake/compile.am
@@ -64,8 +64,11 @@ LINK_LIBS_RTEMS = $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
LINK_LIBS_GCC272 = $(LINK_LIBS_RTEMS) $(LIBC_LIBC) $(LIBC_LIBGCC)
else
## gcc >= 2.8.x
-## FIXME: This is BSP-specific and will fail for BSP-independent directories
-GCCSPECS = -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems
+if RTEMS_CONFIG_PER_BSP
+BSP_SPECS = -specs bsp_specs -qrtems
+endif
+
+GCCSPECS = -B$(PROJECT_RELEASE)/lib/ $(BSP_SPECS)
endif
else
## fall back to the old style compilers/*.cfg
@@ -273,36 +276,12 @@ RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V)
## -------------------------------------------------------------------------
-## FIXME: This will probably vanish, when GNU canonicalization will be
-## introduced
-if RTEMS_CANONICALIZATION
-
-CC = $(CC_FOR_TARGET) $(GCCSPECS)
-CXX = $(CXX_FOR_TARGET) $(GCCSPECS)
-AR_FOR_TARGET = @AR_FOR_TARGET@
-AR = $(AR_FOR_TARGET)
-AS_FOR_TARGET = @AS_FOR_TARGET@
-AS = $(AS_FOR_TARGET)
-RANLIB_FOR_TARGET = @RANLIB_FOR_TARGET@
-RANLIB = $(RANLIB_FOR_TARGET)
-LD_FOR_TARGET = @LD_FOR_TARGET@
-LD = $(LD_FOR_TARGET)
-NM_FOR_TARGET = @NM_FOR_TARGET@
-NM = $(NM_FOR_TARGET)
-OBJCOPY_FOR_TARGET = @OBJCOPY_FOR_TARGET@
-OBJCOPY = $(OBJCOPY_FOR_TARGET)
-SIZE_FOR_TARGET = @SIZE_FOR_TARGET@
-SIZE = $(SIZE_FOR_TARGET)
-STRIP_FOR_TARGET = @STRIP_FOR_TARGET@
-STRIP = $(STRIP_FOR_TARGET)
-else
CC = @CC@ $(GCCSPECS)
CXX = @CXX@ $(GCCSPECS)
OBJCOPY = @OBJCOPY@
NM = @NM@
SIZE = @SIZE@
STRIP = @STRIP@
-endif
##
## FIXME: DEFS and INCLUDES should not be passed as AM_CPPFLAGS
diff --git a/automake/lib.am b/automake/lib.am
index 8fe1af1e03..0bab98fa5b 100644
--- a/automake/lib.am
+++ b/automake/lib.am
@@ -2,11 +2,8 @@
## $Id$
##
-if RTEMS_CANONICALIZATION
-else
AR = @AR@
RANLIB = @RANLIB@
-endif
define make-library
$(RM) $@
diff --git a/configure.in b/configure.in
index e99b8e874d..af9a919258 100644
--- a/configure.in
+++ b/configure.in
@@ -14,13 +14,10 @@ if test -f VERSION; then
[Please use a separate build directory, instead] )
fi
-RTEMS_CANONICAL_TARGET_CPU
-AM_INIT_AUTOMAKE(rtems,$RTEMS_VERSION,no)
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE(cross,0,no)
AM_MAINTAINER_MODE
-dnl RTEMS_ENABLE_BARE
-dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp)
-
dnl These option are only in here to let --help report all supported
dnl options.
RTEMS_ENABLE_MULTIPROCESSING
@@ -32,37 +29,274 @@ RTEMS_ENABLE_INLINES
RTEMS_ENABLE_CXX
RTEMS_ENABLE_GCC28
RTEMS_ENABLE_LIBCDIR
-RTEMS_ENABLE_TESTS
+RTEMS_ENABLE_TESTS
RTEMS_ENABLE_RTEMS_DEBUG
-RTEMS_CHECK_CPU
-RTEMS_CANONICAL_HOST
+# these tools are built for the build environment
+#
+build_tools="tools/build tools/update tools/cpu"
+
+# these libraries are used for the host environment
+#
+host_libs=""
+
+# these tools are built for the host environment
+#
+host_tools=""
+
+# these libraries are built for the target environment, and are built after
+# the host libraries and the host tools (which may be a cross compiler)
+#
+target_libs="c"
+
+# these tools are built using the target libs, and are intended to run only
+# in the target environment
+#
+target_tools=""
-AC_CONFIG_SUBDIRS(tools/build)
-AC_CONFIG_SUBDIRS(tools/update)
-AC_CONFIG_SUBDIRS(tools/cpu)
+## All tools belong in one of the four categories, and are assigned above
+## We assign ${configdirs} this way to remove all embedded newlines. This
+## is important because configure will choke if they ever get through.
+## ${configdirs} is directories we build using the host tools.
+## ${target_configdirs} is directories we build using the target tools.
+#
+configdirs="${host_libs} ${host_tools}"
+AC_SUBST(configdirs)
-# List all subdirectories to be compiled for the target here
-RTEMS_CONFIG_SUBDIRS(c)
+target_configdirs="${target_libs} ${target_tools}"
+AC_SUBST(target_configdirs)
+
+# Record target_configdirs and the configure arguments in Makefile.
+targargs=`echo "${ac_configure_args}" | \
+ sed -e 's/--no[^ ]*//' \
+ -e 's/--cache[a-z-]*=[^ ]*//' \
+ -e 's/--ho[a-z-]*=[^ ]*//' \
+ -e 's/--bu[a-z-]*=[^ ]*//' \
+ -e 's/--ta[a-z-]*=[^ ]*//'`;
+
+targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
+AC_SUBST(targargs)
+
+target_subdir=${target_alias}
-if test "$target_alias" != "$host_alias"; then
changequote(,)dnl
-TARGET_SUBDIRS=`echo "$target_subdirs" | \
- sed -e "s%\([a-zA-Z0-9][a-zA-Z0-9]*\)%${target_alias}/\1%g"`
+if test $target_alias = $host_alias;
+then
+ HOST_SUBDIRS="$configdirs $target_configdirs"
+ TARGET_SUBDIRS=""
+else
+ HOST_SUBDIRS="$configdirs"
+ TARGET_SUBDIRS=`echo "$target_configdirs" | \
+ sed -e "s%\([^ ]\+\)%$target_alias/\1%g"`
+fi
changequote([,])dnl
+
+if test $host_alias = $build_alias;
+then
+ HOST_SUBDIRS="$build_tools $HOST_SUBDIRS"
else
-TARGET_SUBDIRS="$target_subdirs"
+ build_configdirs="$build_tools"
fi
+
+AC_CONFIG_SUBDIRS($HOST_SUBDIRS)
AC_SUBST(TARGET_SUBDIRS)
+AC_SUBST(HOST_SUBDIRS)
-# Explicitly list all Makefiles here
-AC_OUTPUT(
+AC_OUTPUT(
Makefile
tools/Makefile
make/Makefile
make/custom/Makefile
make/Templates/Makefile
-make/compilers/Makefile
+make/compilers/Makefile
doc/Makefile)
-RTEMS_OUTPUT_SUBDIRS(RTEMS_TGT_SUBDIRS)
+if test "$no_recursion" != yes; then
+
+ if test $target_alias != $host_alias; then
+ # Remove --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $targargs; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ test -d $target_subdir || mkdir $target_subdir
+ for ac_config_dir in $target_configdirs; do
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $target_subdir/$ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :;
+ else
+ AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir)
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $target_subdir/$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'`
+changequote([, ])dnl
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for configure
+ if test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ else
+ AC_MSG_WARN(no configuration information is in $ac_config_dir)
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ ac_sub_cache_file=$cache_file
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],
+ [ case "$ac_given_INSTALL" in
+changequote(, )dnl
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+changequote([, ])dnl
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+])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 \
+ --libdir='${exec_prefix}'/$target_alias/lib
+ then :
+ else
+ AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+ fi
+
+ if test $build_alias != $host_alias; then
+ # Remove --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $targargs; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+# test -d $target_subdir || mkdir $target_subdir
+ for ac_config_dir in $build_configdirs; do
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d $ac_config_dir || mkdir $ac_config_dir; then :;
+ else
+ AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+changequote(, )dnl
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+changequote([, ])dnl
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ else
+ AC_MSG_WARN(no configuration information is in $ac_config_dir)
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ ac_sub_cache_file=$cache_file
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],
+ [ case "$ac_given_INSTALL" in
+changequote(, )dnl
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+changequote([, ])dnl
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+])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 \
+ --cache-file=$ac_sub_cache_file \
+ --build=$build_alias --host=$build_alias
+ then :
+ else
+ AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+ fi
+fi
diff --git a/macros/enable-rtemsbsp.m4 b/macros/enable-rtemsbsp.m4
index fd31997d3c..a1fb24a335 100644
--- a/macros/enable-rtemsbsp.m4
+++ b/macros/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/macros/i386-gas-code16.m4 b/macros/i386-gas-code16.m4
index 8bfb2a5859..9bb0030d94 100644
--- a/macros/i386-gas-code16.m4
+++ b/macros/i386-gas-code16.m4
@@ -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/macros/multilib.m4 b/macros/multilib.m4
index 1d11561f0a..5e0c5272d1 100644
--- a/macros/multilib.m4
+++ b/macros/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/macros/prog-cc.m4 b/macros/prog-cc.m4
index f3cf4a70df..81ca5ca75a 100644
--- a/macros/prog-cc.m4
+++ b/macros/prog-cc.m4
@@ -9,7 +9,6 @@ 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
diff --git a/macros/prog-cxx.m4 b/macros/prog-cxx.m4
index 72d3a20957..d9159677b8 100644
--- a/macros/prog-cxx.m4
+++ b/macros/prog-cxx.m4
@@ -8,7 +8,6 @@ AC_DEFUN(RTEMS_PROG_CXX,
[
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
dnl Only accept g++
diff --git a/macros/project-root.m4 b/macros/project-root.m4
index 35fd15b7aa..1f5fb677f5 100644
--- a/macros/project-root.m4
+++ b/macros/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/macros/rtems-top.m4 b/macros/rtems-top.m4
index 26abdf330d..fa79019df7 100644
--- a/macros/rtems-top.m4
+++ b/macros/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" = "y")
-
+# 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/macros/target.m4 b/macros/target.m4
index e807fd2a39..9c84490880 100644
--- a/macros/target.m4
+++ b/macros/target.m4
@@ -15,7 +15,7 @@ AC_DEFUN(RTEMS_OUTPUT_BUILD_SUBDIRS,
[
if test "$no_recursion" != yes; then
if test $build_alias != $host_alias; then
- target_subdir="$target_alias"
+ target_subdir="$host_alias"
else
target_subdir="."
fi
@@ -119,130 +119,3 @@ changequote([, ])dnl
done
fi
])
-dnl $Id$
-
-AC_DEFUN(RTEMS_CONFIG_SUBDIRS,
-[
-define([RTEMS_TGT_SUBDIRS],
-ifdef([RTEMS_TGT_SUBDIRS], [RTEMS_TGT_SUBDIRS ],)[$1])dnl
-target_subdirs="RTEMS_TGT_SUBDIRS"
-AC_SUBST(target_subdirs)
-])
-
-dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS
-AC_DEFUN(RTEMS_OUTPUT_SUBDIRS,
-[
-if test "$no_recursion" != yes; then
- if test $target_alias != $host_alias; then
- target_subdir="$target_alias"
- else
- target_subdir="."
- fi
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) 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
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $target_subdir/$ac_config_dir
-
- case "$srcdir" in
-## .) ;;
- *)
- if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :;
- else
- AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir)
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $target_subdir/$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'`
-changequote([, ])dnl
-
- case "$srcdir" in
-## .) # No --srcdir option. We are building in place.
-## ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style 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=
- fi
-
- # 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
-ifdef([AC_PROVIDE_AC_PROG_INSTALL],
- [ case "$ac_given_INSTALL" in
-changequote(, )dnl
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
-changequote([, ])dnl
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-])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
- then :
- else
- AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-])
diff --git a/macros/tool-prefix.m4 b/macros/tool-prefix.m4
deleted file mode 100644
index 563cca8e8f..0000000000
--- a/macros/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
-])