1 | dnl $Id$ |
---|
2 | |
---|
3 | # PROJECT_ROOT .. Directory to put the temporary installed files into |
---|
4 | |
---|
5 | # FIXME: to be revisited - featureladden, bloated |
---|
6 | AC_DEFUN([RTEMS_ENV_RTEMSCPU], |
---|
7 | [ |
---|
8 | AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) |
---|
9 | |
---|
10 | # RTEMS_TOPdir points to the top of RTEMS source tree |
---|
11 | # cpukit_topdir points to the top of the cpukit source tree |
---|
12 | cpukit_topdir="/${RTEMS_TOPdir}/" |
---|
13 | |
---|
14 | AS_IF([test -n "$enable_rtemsbsp"], |
---|
15 | [ # Per BSP |
---|
16 | AC_ARG_VAR([CPU_CFLAGS],[]) |
---|
17 | AC_ARG_VAR([CFLAGS_OPTIMIZE_V], |
---|
18 | [CFLAGS for building the optimized variant]) |
---|
19 | AC_ARG_VAR([CFLAGS_DEBUG_V], |
---|
20 | [CFLAGS for building the debugging variant]) |
---|
21 | |
---|
22 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
23 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP,[ |
---|
24 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$enable_rtemsbsp" |
---|
25 | ]) |
---|
26 | AS_IF([test -z "$rtems_cv_RTEMS_BSP"],[ |
---|
27 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
28 | ]) |
---|
29 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
30 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
31 | |
---|
32 | test x"${with_project_root}" = x && with_project_root="."; |
---|
33 | case x${with_project_root} in |
---|
34 | x[[\\/]]* | x?:[[\\/]]* ) # absolute dir |
---|
35 | PROJECT_ROOT="${with_project_root}" |
---|
36 | ;; |
---|
37 | x* ) # relative dir |
---|
38 | PROJECT_ROOT="\$(top_builddir)${cpukit_topdir}${with_project_root}" |
---|
39 | ;; |
---|
40 | esac |
---|
41 | |
---|
42 | PROJECT_ROOT="${PROJECT_ROOT}/$RTEMS_BSP" |
---|
43 | AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}/lib/include"]) |
---|
44 | AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}/lib"]) |
---|
45 | |
---|
46 | includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" |
---|
47 | libdir="\${exec_prefix}/${RTEMS_BSP}/lib" |
---|
48 | ],[ |
---|
49 | AS_IF([test x"$multilib" = x"yes"], |
---|
50 | [ |
---|
51 | AS_IF([test -n "$with_multisubdir"], |
---|
52 | [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`]) |
---|
53 | AC_SUBST(MULTIBUILDTOP) |
---|
54 | |
---|
55 | AS_IF([test -n "$with_multisubdir"], |
---|
56 | [MULTISUBDIR="/$with_multisubdir"]) |
---|
57 | AC_SUBST(MULTISUBDIR) |
---|
58 | |
---|
59 | PROJECT_ROOT="\$(top_builddir)${cpukit_topdir}../\$(MULTIBUILDTOP)" |
---|
60 | |
---|
61 | AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"]) |
---|
62 | AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"]) |
---|
63 | |
---|
64 | includedir="\${exec_prefix}/include" |
---|
65 | libdir="${libdir}\$(MULTISUBDIR)" |
---|
66 | ],[ |
---|
67 | PROJECT_ROOT="\$(top_builddir)${cpukit_topdir}" |
---|
68 | |
---|
69 | AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"]) |
---|
70 | AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"]) |
---|
71 | |
---|
72 | includedir="\${exec_prefix}/include" |
---|
73 | libdir="${libdir}\$(MULTISUBDIR)" |
---|
74 | ]) |
---|
75 | ]) |
---|
76 | |
---|
77 | AC_SUBST([project_libdir],["\$(libdir)"]) |
---|
78 | AC_SUBST([project_includedir],["\$(includedir)"]) |
---|
79 | |
---|
80 | AC_SUBST(PROJECT_ROOT) |
---|
81 | |
---|
82 | AM_CONDITIONAL([MULTILIB],[test x"$multilib" = x"yes"]) |
---|
83 | ]) |
---|