source: rtems/aclocal/rtems-top.m4 @ 2e0fd427

4.104.114.84.9
Last change on this file since 2e0fd427 was 2e0fd427, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 2, 2000 at 3:44:04 PM

2000-11-02 Ralf Corsepius <corsepiu@…>

  • 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/.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1dnl $Id$
2
3dnl
4dnl RTEMS_TOP($1)
5dnl
6dnl $1 .. relative path from this configure.in to the toplevel configure.in
7dnl
8AC_DEFUN(RTEMS_TOP,
9[dnl
10AC_CHECK_PROGS(MAKE, gmake make)
11AC_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl
12AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
13
14## HACK to allow gnu-make conditionals in automake-Makefiles.
15ENDIF=endif
16AC_SUBST(ENDIF)
17
18# with_target_subdir
19AC_ARG_WITH(target-subdir,
20[  --with-target-subdir=DIR],
21with_target_subdir="$withval",
22with_target_subdir=".")
23
24RTEMS_TOPdir="$1";
25AC_SUBST(RTEMS_TOPdir)
26
27if test "$with_target_subdir" = "." ; then
28# Native
29PROJECT_TOPdir=${RTEMS_TOPdir}/'$(top_builddir)'
30else
31# Cross
32changequote(, )dnl
33dots=`echo $with_target_subdir|\
34sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
35changequote([, ])dnl
36PROJECT_TOPdir=${dots}${RTEMS_TOPdir}/'$(top_builddir)'
37fi
38AC_SUBST(PROJECT_TOPdir)
39
40if test "$with_target_subdir" = "." ; then
41# Native
42PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)';
43else
44# Cross
45PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)'
46fi
47AC_SUBST(PROJECT_ROOT)
48
49dnl Determine RTEMS Version string from the VERSION file
50dnl Hopefully, Joel never changes its format ;-
51AC_MSG_CHECKING([for RTEMS Version])
52if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
53changequote(,)dnl
54RTEMS_VERSION=`grep 'RTEMS Version' ${srcdir}/${RTEMS_TOPdir}/VERSION | \
55sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
56changequote([,])dnl
57else
58AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
59fi
60if test -z "$RTEMS_VERSION"; then
61AC_MSG_ERROR(Unable to determine version)
62fi
63AC_MSG_RESULT($RTEMS_VERSION)
64])dnl
Note: See TracBrowser for help on using the repository browser.