1 | # AC_DISABLE_OPTION_CHECKING is not available before 2.62 |
---|
2 | AC_PREREQ(2.62) |
---|
3 | |
---|
4 | dnl |
---|
5 | dnl RTEMS_TOP($1) |
---|
6 | dnl |
---|
7 | dnl $1 .. relative path from this configure.ac to the toplevel configure.ac |
---|
8 | dnl |
---|
9 | AC_DEFUN([RTEMS_TOP], |
---|
10 | [dnl |
---|
11 | AC_REQUIRE([RTEMS_VERSIONING]) |
---|
12 | AC_REQUIRE([AM_SET_LEADING_DOT]) |
---|
13 | AC_REQUIRE([AC_DISABLE_OPTION_CHECKING]) |
---|
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=${rtems_updir}${enable_rtems_root} |
---|
37 | RTEMS_ROOT='$(top_builddir)'/${rtems_updir}${enable_rtems_root} |
---|
38 | ;; |
---|
39 | esac],[ |
---|
40 | rtems_rootdir=${rtems_updir} |
---|
41 | RTEMS_ROOT='$(top_builddir)'/${rtems_updir} |
---|
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_ARG_ENABLE([cpukit-root],[ |
---|
51 | AS_HELP_STRING(--enable-cpukit-root,directory containing lib/librtemscpu.a)], |
---|
52 | [case ${enable_cpukit_root} in |
---|
53 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
54 | cpukit_rootdir=${enable_cpukit_root} |
---|
55 | CPUKIT_ROOT=${enable_cpukit_root} |
---|
56 | ;; |
---|
57 | *) # relative directory |
---|
58 | cpukit_rootdir=${rtems_updir}${enable_cpukit_root} |
---|
59 | CPUKIT_ROOT='$(top_builddir)'/${rtems_updir}${enable_cpukit_root} |
---|
60 | ;; |
---|
61 | esac],[ |
---|
62 | cpukit_rootdir= |
---|
63 | CPUKIT_ROOT= |
---|
64 | ]) |
---|
65 | AC_SUBST([CPUKIT_ROOT]) |
---|
66 | |
---|
67 | AC_ARG_ENABLE([project-root],[ |
---|
68 | AS_HELP_STRING(--enable-project-root,directory containing lib/librtemsbsp.a)], |
---|
69 | [case ${enable_project_root} in |
---|
70 | [[\\/$]]* | ?:[[\\/]]* ) # absolute directory |
---|
71 | project_rootdir=${enable_project_root} |
---|
72 | PROJECT_ROOT=${enable_project_root} |
---|
73 | ;; |
---|
74 | *) # relative directory |
---|
75 | project_rootdir=${rtems_updir}${enable_project_root} |
---|
76 | PROJECT_ROOT='$(top_builddir)'/${rtems_updir}${enable_project_root} |
---|
77 | ;; |
---|
78 | esac],[ |
---|
79 | project_rootdir= |
---|
80 | PROJECT_ROOT= |
---|
81 | ]) |
---|
82 | AC_SUBST([PROJECT_ROOT]) |
---|
83 | ])dnl |
---|