source: rtems/cpukit/aclocal/rtems-top.m4 @ ea68ed5

4.104.114.84.95
Last change on this file since ea68ed5 was 0598fb8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/08/05 at 02:50:06

2005-02-08 Ralf Corsepius <ralf.corsepius@…>

  • aclocal/rtems-top.m4 (rtems_updir): Quote sed args.
  • Property mode set to 100644
File size: 2.0 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])
60
61AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"])
62AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"])
63
64libdir="${libdir}\$(MULTISUBDIR)"
65
66AC_SUBST([project_libdir],["\$(libdir)"])
67AC_SUBST([project_includedir],["\$(includedir)"])
68
69AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
70])dnl
Note: See TracBrowser for help on using the repository browser.