source: rtems/cpukit/aclocal/rtems-top.m4 @ 894b7f97

4.104.114.84.95
Last change on this file since 894b7f97 was 894b7f97, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/29/04 at 12:35:15

2004-03-29 Ralf Corsepius <ralf_corsepius@…>

  • aclocal/rtems-top.m4: Add MULTISUBDIR. Add MULTIBUILDTOP. Add rtems_updir. Remove version.m4 check. Add PROJECT_ROOT/with_project_root processing. Add PROJECT_INCLUDE. Add PROJECT_LIB.
  • aclocal/env-rtemscpu.a4: Remove cpukit_topdir. Remove with_project_root processing. Remove PROJECT_INCLUDE, PROJECT_LIB.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1dnl $Id$
2
3m4_define([RTEMS_API],[4.7])
4
5dnl
6dnl RTEMS_TOP($1)
7dnl
8dnl $1 .. relative path from this configure.ac to the toplevel configure.ac
9dnl
10AC_DEFUN([RTEMS_TOP],
11[dnl
12AC_REQUIRE([RTEMS_VERSIONING])
13AC_REQUIRE([AM_SET_LEADING_DOT])
14AC_CONFIG_AUX_DIR([$1])
15AC_CHECK_PROGS(MAKE, gmake make)
16AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
17
18AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API])
19
20AC_SUBST([RTEMS_TOPdir],["$1"])
21
22# HACK: The sed pattern below strips of "../", corresponding to "cpukit/"
23rtems_updir="/"m4_if([$2],[],[`echo "$1/" | sed s,^\.\.\/,,`],[$2/])
24
25AS_IF([test -n "$with_multisubdir"],
26  [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`])
27AC_SUBST(MULTIBUILDTOP)
28 
29AS_IF([test -n "$with_multisubdir"],
30  [MULTISUBDIR="/$with_multisubdir"])
31AC_SUBST(MULTISUBDIR)
32
33AC_ARG_WITH([project-root],[
34AS_HELP_STRING(--with-project-root,directory to pre-install files into)],[
35## Make sure to have a terminating '/'
36case "${with_project_root}" in
37*/) ;;
38*) with_project_root="${with_project_root}/" ;;
39esac
40
41case "${with_project_root}" in
42  [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
43   PROJECT_ROOT=${with_project_root}
44   ;;
45  *) # relative directory
46   sav0dir=`pwd` && cd ./${rtems_updir}
47   sav1dir=`pwd` && cd ../${MULTIBUILDTOP}
48   sav2dir=`pwd` && cd $sav0dir
49   mydir=`echo $sav1dir | sed s,^$sav2dir${MULTISUBDIR}/,,`
50   PROJECT_ROOT='$(top_builddir)'${rtems_updir}'../$(MULTIBUILDTOP)'${mydir}/${with_project_root}
51   ;;
52esac],[
53## Defaults: Note: Two different defaults!
54## ../ for multilib
55## '.' for non-multilib
56AS_IF([test "$enable_multilib" = "yes"],[
57  PROJECT_ROOT='$(top_builddir)'${rtems_updir}'../$(MULTIBUILDTOP)'],[
58  PROJECT_ROOT='$(top_builddir)'${rtems_updir}])
59])
60AC_SUBST([PROJECT_ROOT])
61
62AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"])
63AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"])
64
65AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
66])dnl
Note: See TracBrowser for help on using the repository browser.