1 | dnl $Id$ |
---|
2 | |
---|
3 | m4_define([RTEMS_API],[4.7]) |
---|
4 | |
---|
5 | dnl |
---|
6 | dnl RTEMS_TOP($1) |
---|
7 | dnl |
---|
8 | dnl $1 .. relative path from this configure.in to the toplevel configure.in |
---|
9 | dnl |
---|
10 | AC_DEFUN([RTEMS_TOP], |
---|
11 | [dnl |
---|
12 | AC_REQUIRE([RTEMS_VERSIONING]) |
---|
13 | AC_REQUIRE([AM_SET_LEADING_DOT]) |
---|
14 | AC_CONFIG_AUX_DIR([$1]) |
---|
15 | AC_CHECK_PROGS(MAKE, gmake make) |
---|
16 | AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl |
---|
17 | |
---|
18 | AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API]) |
---|
19 | |
---|
20 | ## HACK to allow gnu-make conditionals in automake-Makefiles. |
---|
21 | ENDIF=endif |
---|
22 | AC_SUBST(ENDIF) |
---|
23 | |
---|
24 | AC_SUBST([RTEMS_TOPdir],["$1"]) |
---|
25 | |
---|
26 | rtems_updir=m4_if([$2],[],[],[$2/]) |
---|
27 | |
---|
28 | AC_ARG_ENABLE([rtems-root],[ |
---|
29 | AS_HELP_STRING(--enable-rtems-root,directory containing make/custom)], |
---|
30 | [case ${enable_rtems_root} in |
---|
31 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
32 | rtems_rootdir=${enable_rtems_root} |
---|
33 | RTEMS_ROOT=${enable_rtems_root} |
---|
34 | ;; |
---|
35 | *) # relative directory |
---|
36 | rtems_rootdir=${enable_rtems_root}${rtems_updir} |
---|
37 | RTEMS_ROOT=${enable_rtems_root}${rtems_updir}'$(top_builddir)' |
---|
38 | ;; |
---|
39 | esac],[ |
---|
40 | rtems_rootdir=${rtems_updir} |
---|
41 | RTEMS_ROOT=${rtems_updir}'$(top_builddir)' |
---|
42 | ]) |
---|
43 | AC_SUBST([RTEMS_ROOT]) |
---|
44 | |
---|
45 | AS_IF([test -n "${with_target_subdir}"], |
---|
46 | [project_top="../${with_project_top}"], |
---|
47 | [project_top="${with_project_top}"]) |
---|
48 | AC_SUBST([PROJECT_TOPdir],[${project_top}${rtems_updir}'$(top_builddir)']) |
---|
49 | |
---|
50 | AC_SUBST([PROJECT_ROOT],[${with_project_root}${rtems_updir}'$(top_builddir)']) |
---|
51 | |
---|
52 | AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp]) |
---|
53 | ])dnl |
---|