1 | dnl |
---|
2 | dnl $Id$ |
---|
3 | dnl |
---|
4 | dnl Set target tools |
---|
5 | dnl |
---|
6 | |
---|
7 | AC_DEFUN(RTEMS_HOST_AR, |
---|
8 | [AC_CHECK_TOOL(AR,ar,no)]) |
---|
9 | |
---|
10 | AC_DEFUN(RTEMS_HOST_RANLIB, |
---|
11 | [AC_CHECK_TOOL(RANLIB,ranlib,:)]) |
---|
12 | |
---|
13 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
14 | [ |
---|
15 | $1=`$CC --print-prog-name=$2` |
---|
16 | ]) |
---|
17 | |
---|
18 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
19 | [ |
---|
20 | AC_MSG_CHECKING([target's $2]) |
---|
21 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
22 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
23 | |
---|
24 | if test -n "$ac_cv_path_$1"; then |
---|
25 | dnl retrieve the value from the cache |
---|
26 | $1=$ac_cv_path_$1 |
---|
27 | else |
---|
28 | dnl the cache was not set |
---|
29 | if test -z "[$]$1" ; then |
---|
30 | if test "$ac_cv_prog_gcc" = "yes"; then |
---|
31 | # We are using gcc, ask it about its tool |
---|
32 | # NOTE: Necessary if gcc was configured to use the target's |
---|
33 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
34 | RTEMS_GCC_PRINT($1,$2) |
---|
35 | fi |
---|
36 | else |
---|
37 | # The user set an environment variable. |
---|
38 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
39 | # will override the environment variable, which isn't what the user |
---|
40 | # intends |
---|
41 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
42 | case "[$]$1" in |
---|
43 | /*) # valid |
---|
44 | AC_MSG_RESULT("yes") |
---|
45 | ;; |
---|
46 | *) # invalid for AC_PATH_PROG |
---|
47 | AC_MSG_RESULT("no") |
---|
48 | AC_MSG_ERROR([***] |
---|
49 | [Environment variable $1 should either] |
---|
50 | [be unset (preferred) or contain an absolute path]) |
---|
51 | ;; |
---|
52 | esac |
---|
53 | fi |
---|
54 | |
---|
55 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
56 | fi |
---|
57 | ]) |
---|
58 | |
---|
59 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
60 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
61 | |
---|
62 | dnl FIXME: What shall be done if these tools are not available? |
---|
63 | RTEMS_HOST_AR(AR,ar,no) |
---|
64 | RTEMS_PATH_TOOL(AS,as,no) |
---|
65 | RTEMS_PATH_TOOL(LD,ld,no) |
---|
66 | RTEMS_PATH_TOOL(NM,nm,no) |
---|
67 | |
---|
68 | dnl special treatment of ranlib |
---|
69 | RTEMS_HOST_RANLIB |
---|
70 | |
---|
71 | dnl NOTE: These may not be available if not using gnutools |
---|
72 | AC_CHECK_TOOL(OBJCOPY,objcopy,no) |
---|
73 | AC_CHECK_TOOL(SIZE,size,no) |
---|
74 | AC_CHECK_TOOL(STRIP,strip,:) |
---|
75 | ]) |
---|