[b5ddb74] | 1 | dnl some macros for rtems host configuration checks |
---|
| 2 | dnl |
---|
[37717818] | 3 | dnl Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de), 97/11/29 |
---|
[b5ddb74] | 4 | dnl |
---|
| 5 | |
---|
| 6 | dnl macro to detect mkdir |
---|
| 7 | AC_DEFUN(RTEMS_PATH_MKDIR, |
---|
| 8 | [AC_PATH_PROG(MKDIR,mkdir) |
---|
| 9 | ]) |
---|
| 10 | |
---|
| 11 | dnl macro to check for mkdir -p |
---|
| 12 | AC_DEFUN(RTEMS_PROG_MKDIR_P, |
---|
| 13 | [ |
---|
| 14 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
| 15 | AC_MSG_CHECKING([for working $MKDIR -p]) |
---|
| 16 | AC_CACHE_VAL(rtems_cv_prog_mkdir_p, |
---|
| 17 | [rm -rf conftestdata |
---|
| 18 | if $MKDIR -p conftestdata 2>/dev/null ;then |
---|
| 19 | rtems_cv_prog_MKDIR_P="yes" |
---|
| 20 | else |
---|
| 21 | rtems_cv_prog_MKDIR_P="no" |
---|
| 22 | fi])dnl |
---|
| 23 | rm -rf conftestdata |
---|
| 24 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_P) |
---|
| 25 | ]) |
---|
| 26 | |
---|
| 27 | dnl macro to check for mkdir -m 0755 |
---|
| 28 | AC_DEFUN(RTEMS_PROG_MKDIR_M, |
---|
| 29 | [ |
---|
| 30 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
| 31 | AC_MSG_CHECKING([for working $MKDIR -m 0755]) |
---|
| 32 | AC_CACHE_VAL(rtems_cv_prog_MKDIR_P, |
---|
| 33 | [rm -rf conftestdata |
---|
| 34 | if $MKDIR -m 0775 conftestdata 2>/dev/null; then |
---|
| 35 | rtems_cv_prog_MKDIR_M="yes" |
---|
| 36 | else |
---|
| 37 | rtems_cv_prog_MKDIR_M="no" |
---|
| 38 | fi])dnl |
---|
| 39 | rm -rf conftestdata |
---|
| 40 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_M) |
---|
| 41 | ]) |
---|
[1670eede] | 42 | |
---|
[37717818] | 43 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
| 44 | dnl path .. path relative to srcdir, where to start searching for files |
---|
| 45 | dnl file .. name of the files to search for |
---|
| 46 | dnl var .. shell variable to append found files |
---|
| 47 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
| 48 | [ |
---|
| 49 | AC_MSG_CHECKING(for $2 in $1) |
---|
| 50 | if test -d $srcdir/$1; then |
---|
| 51 | rtems_av_save_dir=`pwd`; |
---|
| 52 | cd $srcdir; |
---|
[af231b4] | 53 | rtems_av_tmp=`find $1 -name $2 -print | sed 's%\.in%%' | sort`; |
---|
[37717818] | 54 | $3="$$3 $rtems_av_tmp"; |
---|
| 55 | cd $rtems_av_save_dir; |
---|
| 56 | AC_MSG_RESULT(done) |
---|
| 57 | else |
---|
| 58 | AC_MSG_RESULT(no) |
---|
| 59 | fi |
---|
[1670eede] | 60 | ]) |
---|
| 61 | |
---|
| 62 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
[37717818] | 63 | dnl Search for Makefile.in's within the directory starting |
---|
[1670eede] | 64 | dnl at path and append an entry for Makefile to global variable |
---|
| 65 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
| 66 | dnl |
---|
| 67 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
[37717818] | 68 | [RTEMS_CHECK_FILES_IN($1,Makefile.in,makefiles) |
---|
[1670eede] | 69 | ]) |
---|
| 70 | |
---|
| 71 | dnl canonicalize target name |
---|
[37717818] | 72 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
| 73 | dnl target naming conventions "processor-vendor-os" |
---|
[1670eede] | 74 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
| 75 | dnl and we have to fix it for rtems ourselves |
---|
| 76 | |
---|
| 77 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
| 78 | [AC_MSG_CHECKING(rtems target cpu) |
---|
| 79 | changequote(<<, >>)dnl |
---|
[37717818] | 80 | target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
[1670eede] | 81 | changequote([, ])dnl |
---|
| 82 | AC_MSG_RESULT($target_cpu) |
---|
| 83 | ]) |
---|