1 | dnl $Id$ |
---|
2 | |
---|
3 | # AC_DISABLE_OPTION_CHECKING is not available before 2.62 |
---|
4 | AC_PREREQ(2.62) |
---|
5 | |
---|
6 | dnl |
---|
7 | dnl RTEMS_TOP($1) |
---|
8 | dnl |
---|
9 | dnl $1 .. relative path from this configure.in to the toplevel configure.in |
---|
10 | dnl |
---|
11 | AC_DEFUN([RTEMS_TOP], |
---|
12 | [dnl |
---|
13 | AC_REQUIRE([RTEMS_VERSIONING]) |
---|
14 | AC_REQUIRE([AM_SET_LEADING_DOT]) |
---|
15 | AC_REQUIRE([AC_DISABLE_OPTION_CHECKING]) |
---|
16 | AC_CONFIG_AUX_DIR([$1]) |
---|
17 | AC_CHECK_PROGS(MAKE, gmake make) |
---|
18 | AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl |
---|
19 | |
---|
20 | AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API]) |
---|
21 | |
---|
22 | ## HACK to allow gnu-make conditionals in automake-Makefiles. |
---|
23 | ENDIF=endif |
---|
24 | AC_SUBST(ENDIF) |
---|
25 | |
---|
26 | AC_SUBST([RTEMS_TOPdir],["$1"]) |
---|
27 | |
---|
28 | rtems_updir=m4_if([$2],[],[],[$2/]) |
---|
29 | |
---|
30 | AC_ARG_ENABLE([rtems-root],[ |
---|
31 | AS_HELP_STRING(--enable-rtems-root,directory containing make/custom)], |
---|
32 | [case ${enable_rtems_root} in |
---|
33 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
34 | rtems_rootdir=${enable_rtems_root} |
---|
35 | RTEMS_ROOT=${enable_rtems_root} |
---|
36 | ;; |
---|
37 | *) # relative directory |
---|
38 | rtems_rootdir=${rtems_updir}${enable_rtems_root} |
---|
39 | RTEMS_ROOT='$(top_builddir)'/${rtems_updir}${enable_rtems_root} |
---|
40 | ;; |
---|
41 | esac],[ |
---|
42 | rtems_rootdir=${rtems_updir} |
---|
43 | RTEMS_ROOT='$(top_builddir)'/${rtems_updir} |
---|
44 | ]) |
---|
45 | AC_SUBST([RTEMS_ROOT]) |
---|
46 | |
---|
47 | AS_IF([test -n "${with_target_subdir}"], |
---|
48 | [project_top="../${with_project_top}"], |
---|
49 | [project_top="${with_project_top}"]) |
---|
50 | AC_SUBST([PROJECT_TOPdir],[${project_top}${rtems_updir}'$(top_builddir)']) |
---|
51 | |
---|
52 | AC_ARG_ENABLE([cpukit-root],[ |
---|
53 | AS_HELP_STRING(--enable-cpukit-root,directory containing lib/librtemscpu.a)], |
---|
54 | [case ${enable_cpukit_root} in |
---|
55 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
56 | cpukit_rootdir=${enable_cpukit_root} |
---|
57 | CPUKIT_ROOT=${enable_cpukit_root} |
---|
58 | ;; |
---|
59 | *) # relative directory |
---|
60 | cpukit_rootdir=${rtems_updir}${enable_cpukit_root} |
---|
61 | CPUKIT_ROOT='$(top_builddir)'/${rtems_updir}${enable_cpukit_root} |
---|
62 | ;; |
---|
63 | esac],[ |
---|
64 | cpukit_rootdir= |
---|
65 | CPUKIT_ROOT= |
---|
66 | ]) |
---|
67 | AC_SUBST([CPUKIT_ROOT]) |
---|
68 | |
---|
69 | AC_ARG_ENABLE([project-root],[ |
---|
70 | AS_HELP_STRING(--enable-project-root,directory containing lib/librtemsbsp.a)], |
---|
71 | [case ${enable_project_root} in |
---|
72 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
73 | project_rootdir=${enable_project_root} |
---|
74 | PROJECT_ROOT=${enable_project_root} |
---|
75 | ;; |
---|
76 | *) # relative directory |
---|
77 | project_rootdir=${rtems_updir}${enable_project_root} |
---|
78 | PROJECT_ROOT='$(top_builddir)'/${rtems_updir}${enable_project_root} |
---|
79 | ;; |
---|
80 | esac],[ |
---|
81 | project_rootdir= |
---|
82 | PROJECT_ROOT= |
---|
83 | ]) |
---|
84 | AC_SUBST([PROJECT_ROOT]) |
---|
85 | ])dnl |
---|