From 2e0fd4273d942d48194c27530a67cd5323c80812 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 2 Nov 2000 15:44:04 +0000 Subject: 2000-11-02 Ralf Corsepius * 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/. --- aclocal/ar-s.m4 | 25 ----------------- aclocal/canonicalize-tools.m4 | 46 +++++++++++-------------------- aclocal/check-cxx.m4 | 2 +- aclocal/check-newlib.m4 | 1 - aclocal/enable-rtemsbsp.m4 | 9 +++--- aclocal/gcc-pipe.m4 | 6 ++-- aclocal/gcc-specs.m4 | 6 ++-- aclocal/i386-gas-code16.m4 | 9 ++++-- aclocal/multilib.m4 | 14 ++++------ aclocal/prog-cc.m4 | 55 ++----------------------------------- aclocal/prog-cxx.m4 | 64 +++++-------------------------------------- aclocal/project-root.m4 | 19 ------------- aclocal/rtems-top.m4 | 30 ++++++++++++++++---- aclocal/target.m4 | 54 ++++++++++++++++-------------------- aclocal/tool-prefix.m4 | 22 --------------- 15 files changed, 99 insertions(+), 263 deletions(-) delete mode 100644 aclocal/ar-s.m4 delete mode 100644 aclocal/tool-prefix.m4 (limited to 'aclocal') 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 <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 -]) -- cgit v1.2.3