source: rtems/aclocal/canonicalize-tools.m4 @ 2e0fd427

4.104.114.84.95
Last change on this file since 2e0fd427 was 2e0fd427, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/00 at 15:44:04

2000-11-02 Ralf Corsepius <corsepiu@…>

  • aclocal/*: Replace with contents of macros/*.m4
  • macros/: Remove.
  • aclocal/ar-s.m4 aclocal/tool-prefix.m4: Remove.
  • Makefile.am: Reflect changes to aclocal/ and macros/.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1dnl
2dnl $Id$
3dnl
4dnl Set target tools
5dnl
6
7AC_DEFUN(RTEMS_HOST_AR,
8[AC_CHECK_TOOL(AR,ar,no)])
9
10AC_DEFUN(RTEMS_HOST_RANLIB,
11[AC_CHECK_TOOL(RANLIB,ranlib,:)])
12
13AC_DEFUN(RTEMS_GCC_PRINT,
14[
15    $1=`$CC --print-prog-name=$2`
16])
17
18AC_DEFUN(RTEMS_PATH_TOOL,
19[
20AC_MSG_CHECKING([target's $2])
21AC_CACHE_VAL(ac_cv_path_$1,:)
22AC_MSG_RESULT([$ac_cv_path_$1])
23
24if test -n "$ac_cv_path_$1"; then
25  dnl retrieve the value from the cache
26  $1=$ac_cv_path_$1
27else
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)
56fi
57])
58
59AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
60[AC_REQUIRE([RTEMS_PROG_CC])dnl
61
62dnl 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
68dnl special treatment of ranlib
69  RTEMS_HOST_RANLIB
70
71dnl 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])
Note: See TracBrowser for help on using the repository browser.