summaryrefslogtreecommitdiffstats
path: root/aclocal
diff options
context:
space:
mode:
Diffstat (limited to 'aclocal')
-rw-r--r--aclocal/bsp-alias.m418
-rw-r--r--aclocal/check-newlib.m431
-rw-r--r--aclocal/check-rdbg.m414
-rw-r--r--aclocal/enable-rtemsbsp.m431
-rw-r--r--aclocal/project-root.m424
-rw-r--r--aclocal/target.m4130
6 files changed, 248 insertions, 0 deletions
diff --git a/aclocal/bsp-alias.m4 b/aclocal/bsp-alias.m4
new file mode 100644
index 0000000000..8c726387d0
--- /dev/null
+++ b/aclocal/bsp-alias.m4
@@ -0,0 +1,18 @@
+dnl
+dnl $Id$
+dnl
+
+dnl RTEMS_BSP_ALIAS(BSP_ALIAS,BSP_RETURNED)
+dnl convert a bsp alias $1 into its bsp directory $2
+AC_DEFUN(RTEMS_BSP_ALIAS,
+[
+ # account for "aliased" bsps which share source code
+ case $1 in
+ mvme162lx) $2=mvme162 ;; # mvme162 board variant
+ gen68360_040) $2=gen68360 ;; # 68360 in companion mode
+ go32_p5) $2=go32 ;; # go32 on Pentium class CPU
+ p4600) $2=p4000 ;; # p4000 board with IDT 4600
+ p4650) $2=p4000 ;; # p4000 board with IDT 4650
+ *) $2=$1;;
+ esac
+])
diff --git a/aclocal/check-newlib.m4 b/aclocal/check-newlib.m4
new file mode 100644
index 0000000000..f417c65726
--- /dev/null
+++ b/aclocal/check-newlib.m4
@@ -0,0 +1,31 @@
+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 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(
+ [extern int not_required_by_rtems() ;],
+ [not_required_by_rtems()],
+ rtems_cv_use_newlib="yes")
+
+dnl older versions of newlib provided rtems_provides_crt0
+ if test -z "$rtems_cv_use_newlib"; then
+ AC_TRY_LINK(
+ [extern int rtems_provides_crt0 ;],
+ [rtems_provides_crt0 = 0],
+ rtems_cv_use_newlib="yes",
+ rtems_cv_use_newlib="no")
+ fi
+ CC=$rtems_save_CC])
+RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
+AC_SUBST(RTEMS_USE_NEWLIB)
+])
+
diff --git a/aclocal/check-rdbg.m4 b/aclocal/check-rdbg.m4
new file mode 100644
index 0000000000..432e255ab0
--- /dev/null
+++ b/aclocal/check-rdbg.m4
@@ -0,0 +1,14 @@
+AC_DEFUN(RTEMS_CHECK_RDBG,
+[dnl
+AC_REQUIRE([RTEMS_TOP])dnl
+AC_REQUIRE([RTEMS_CHECK_CPU])dnl
+AC_CACHE_CHECK([whether cpu supports librdbg],
+ rtems_cv_has_rdbg,
+ [
+ if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/librdbg/${RTEMS_CPU}"; then
+ rtems_cv_has_rdbg="yes" ;
+ else
+ rtems_cv_has_rdbg="no";
+ fi
+ ])
+])
diff --git a/aclocal/enable-rtemsbsp.m4 b/aclocal/enable-rtemsbsp.m4
new file mode 100644
index 0000000000..c1a952e505
--- /dev/null
+++ b/aclocal/enable-rtemsbsp.m4
@@ -0,0 +1,31 @@
+dnl $Id$
+
+dnl Override the set of BSPs to be built.
+dnl used by the toplevel configure script
+dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
+AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
+[
+AC_ARG_ENABLE(rtemsbsp,
+[ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build],
+[case "${enableval}" in
+ yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
+ *) $1=$enableval;;
+esac],[$1=""])
+])
+
+dnl Pass a single BSP via an environment variable
+dnl used by per BSP configure scripts
+AC_DEFUN(RTEMS_ENV_RTEMSBSP,
+[dnl
+AC_MSG_CHECKING([for RTEMS_BSP])
+AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
+[dnl
+ test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
+])dnl
+if test -z "$rtems_cv_RTEMS_BSP"; then
+ AC_MSG_ERROR([Missing RTEMS_BSP])
+fi
+RTEMS_BSP="$rtems_cv_RTEMS_BSP"
+AC_MSG_RESULT(${RTEMS_BSP})
+AC_SUBST(RTEMS_BSP)
+])
diff --git a/aclocal/project-root.m4 b/aclocal/project-root.m4
new file mode 100644
index 0000000000..2f795d23f0
--- /dev/null
+++ b/aclocal/project-root.m4
@@ -0,0 +1,24 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN(RTEMS_PROJECT_ROOT,
+[dnl
+AC_REQUIRE([RTEMS_TOP])
+if test "$TARGET_SUBDIR" = "." ; then
+PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
+else
+PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
+fi
+AC_SUBST(PROJECT_ROOT)
+
+RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
+AC_SUBST(RTEMS_ROOT)
+
+INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
+AC_SUBST(INSTALL_CHANGE)
+
+PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
+AC_SUBST(PACKHEX)
+])
+
diff --git a/aclocal/target.m4 b/aclocal/target.m4
new file mode 100644
index 0000000000..a731b0707e
--- /dev/null
+++ b/aclocal/target.m4
@@ -0,0 +1,130 @@
+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 This is a subroutine of AC_OUTPUT.
+dnl It is called after running config.status.
+dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
+AC_DEFUN(RTEMS_OUTPUT_SUBDIRS,
+[
+# bla
+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
+])