From 6c77bbab3977d70c7a7247061e2ee4ae1df3dccb Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 4 Feb 1998 14:54:27 +0000 Subject: New autoconf feature from Ralf Corsepius: It adds make rules for reconfiguring build-trees ("make Makefile") and adds dependency rules for configure and friends (i.e. calls autoconf). Most of this code has been "borrowed" from automake and was adapted to rtems. Addionally, I added automatic generation of the "aclocal.m4"-file by "aclocal" (from the automake package). Therefore I splitted aclocal.m4 into several separate files (attached to this mail), each containing one of rtems customized autoconf/m4-macros and have put them into a new subdirectory "aclocal". Normal users won't be influenced and won't even need this, unless they try to modify configure.in. The main advantage of this is: these aclocal/m4-macros become reusable and easier to administer. As a disadvantage, rtems becomes dependent of having aclocal/automake installed. To keep building rtems functional if autoconf or aclocal isn't installed, the related Makefile commands are prefixed by "-" -- only an error message should be issued by "make". --- aclocal/canonical-target-name.m4 | 15 +++++++++++++++ aclocal/check-files-in.m4 | 21 +++++++++++++++++++++ aclocal/check-makefile.m4 | 11 +++++++++++ aclocal/mkdir.m4 | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 aclocal/canonical-target-name.m4 create mode 100644 aclocal/check-files-in.m4 create mode 100644 aclocal/check-makefile.m4 create mode 100644 aclocal/mkdir.m4 (limited to 'aclocal') diff --git a/aclocal/canonical-target-name.m4 b/aclocal/canonical-target-name.m4 new file mode 100644 index 0000000000..e8c77d8a01 --- /dev/null +++ b/aclocal/canonical-target-name.m4 @@ -0,0 +1,15 @@ +dnl $Id$ + +dnl canonicalize target name +dnl NOTE: Most rtems targets do not fullfil autoconf's +dnl target naming conventions "processor-vendor-os" +dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them +dnl and we have to fix it for rtems ourselves + +AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, +[AC_MSG_CHECKING(rtems target cpu) +changequote(<<, >>)dnl +target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` +changequote([, ])dnl +AC_MSG_RESULT($target_cpu) +]) diff --git a/aclocal/check-files-in.m4 b/aclocal/check-files-in.m4 new file mode 100644 index 0000000000..f5e5556df1 --- /dev/null +++ b/aclocal/check-files-in.m4 @@ -0,0 +1,21 @@ +dnl $Id$ + +dnl RTEMS_CHECK_FILES_IN(path,file,var) +dnl path .. path relative to srcdir, where to start searching for files +dnl file .. name of the files to search for +dnl var .. shell variable to append found files +AC_DEFUN(RTEMS_CHECK_FILES_IN, +[ +AC_MSG_CHECKING(for $2 in $1) +if test -d $srcdir/$1; then + rtems_av_save_dir=`pwd`; + cd $srcdir; + rtems_av_tmp=`find $1 -name $2 -print | sed 's%\.in%%' | sort`; + $3="$$3 $rtems_av_tmp"; + cd $rtems_av_save_dir; + AC_MSG_RESULT(done) +else + AC_MSG_RESULT(no) +fi +]) + diff --git a/aclocal/check-makefile.m4 b/aclocal/check-makefile.m4 new file mode 100644 index 0000000000..07286d6318 --- /dev/null +++ b/aclocal/check-makefile.m4 @@ -0,0 +1,11 @@ +dnl $Id$ + +dnl RTEMS_CHECK_MAKEFILE(path) +dnl Search for Makefile.in's within the directory starting +dnl at path and append an entry for Makefile to global variable +dnl "makefiles" (from configure.in) for each Makefile.in found +dnl +AC_DEFUN(RTEMS_CHECK_MAKEFILE, +[RTEMS_CHECK_FILES_IN($1,Makefile.in,makefiles) +]) + diff --git a/aclocal/mkdir.m4 b/aclocal/mkdir.m4 new file mode 100644 index 0000000000..ba7db67a8d --- /dev/null +++ b/aclocal/mkdir.m4 @@ -0,0 +1,39 @@ +dnl $Id$ + +dnl macro to detect mkdir +AC_DEFUN(RTEMS_PATH_MKDIR, +[AC_PATH_PROG(MKDIR,mkdir) +]) + +dnl macro to check for mkdir -p +AC_DEFUN(RTEMS_PROG_MKDIR_P, +[ +AC_REQUIRE([RTEMS_PATH_MKDIR]) +AC_MSG_CHECKING([for working $MKDIR -p]) +AC_CACHE_VAL(rtems_cv_prog_mkdir_p, +[rm -rf conftestdata +if $MKDIR -p conftestdata 2>/dev/null ;then +rtems_cv_prog_MKDIR_P="yes" +else +rtems_cv_prog_MKDIR_P="no" +fi])dnl +rm -rf conftestdata +AC_MSG_RESULT($rtems_cv_prog_MKDIR_P) +]) + +dnl macro to check for mkdir -m 0755 +AC_DEFUN(RTEMS_PROG_MKDIR_M, +[ +AC_REQUIRE([RTEMS_PATH_MKDIR]) +AC_MSG_CHECKING([for working $MKDIR -m 0755]) +AC_CACHE_VAL(rtems_cv_prog_MKDIR_P, +[rm -rf conftestdata +if $MKDIR -m 0775 conftestdata 2>/dev/null; then +rtems_cv_prog_MKDIR_M="yes" +else +rtems_cv_prog_MKDIR_M="no" +fi])dnl +rm -rf conftestdata +AC_MSG_RESULT($rtems_cv_prog_MKDIR_M) +]) + -- cgit v1.2.3