From 3174a7edaefd2d1f59af44c7f6856c69327ecf9d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 31 Oct 2000 21:20:00 +0000 Subject: 2000-10-30 Ralf Corsepius * 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. --- configure.in | 276 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 255 insertions(+), 21 deletions(-) (limited to 'configure.in') 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 -- cgit v1.2.3