source: rtems/cpukit/aclocal/rtems-top.m4 @ 728c3167

4.104.114.84.95
Last change on this file since 728c3167 was 728c3167, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/15/06 at 14:19:47

Add RTEMS_AMPOLISH3.

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