OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [aclocal/] [canonicalize-tools.m4] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
dnl
2
dnl $Id: canonicalize-tools.m4,v 1.2 2001-09-27 11:59:11 chris Exp $
3
dnl
4
dnl Set target tools
5
dnl
6
dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
7
dnl             fixing cache/environment variable handling
8
dnl             adding checks for cygwin/egcs '\\'-bug
9
dnl             adding checks for ranlib/ar -s problem
10
dnl
11
dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
12
dnl
13
 
14
AC_DEFUN(RTEMS_GCC_PRINT,
15
[
16
    $1=`$CC_FOR_TARGET --print-prog-name=$2`
17
])
18
 
19
AC_DEFUN(RTEMS_PATH_TOOL,
20
[
21
AC_MSG_CHECKING([target's $2])
22
AC_CACHE_VAL(ac_cv_path_$1,:)
23
AC_MSG_RESULT([$ac_cv_path_$1])
24
 
25
if test -n "$ac_cv_path_$1"; then
26
  dnl retrieve the value from the cache
27
  $1=$ac_cv_path_$1
28
else
29
  dnl the cache was not set
30
  if test -z "[$]$1" ; then
31
    if test "$rtems_cv_prog_gcc" = "yes"; then
32
      # We are using gcc, ask it about its tool
33
      # NOTE: Necessary if gcc was configured to use the target's
34
      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
35
      RTEMS_GCC_PRINT($1,$2)
36
    fi
37
  else
38
    # The user set an environment variable.
39
    # Check whether it is an absolute path, otherwise AC_PATH_PROG
40
    # will override the environment variable, which isn't what the user
41
    # intends
42
    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
43
    case "[$]$1" in
44
    /*) # valid
45
      AC_MSG_RESULT("yes")
46
    ;;
47
    *)  # invalid for AC_PATH_PROG
48
      AC_MSG_RESULT("no")
49
      AC_MSG_ERROR([***]
50
        [Environment variable $1 should either]
51
        [be unset (preferred) or contain an absolute path])
52
    ;;
53
    esac
54
  fi
55
 
56
  AC_PATH_PROG($1,"$program_prefix"$2,$3)
57
fi
58
])
59
 
60
AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
61
[AC_REQUIRE([RTEMS_PROG_CC])dnl
62
 
63
dnl FIXME: What shall be done if these tools are not available?
64
  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
65
  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
66
  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
67
  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
68
 
69
dnl special treatment of ranlib
70
  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
71
  if test "$RANLIB_FOR_TARGET" = "no"; then
72
    # ranlib wasn't found; check if ar -s is available
73
    RTEMS_AR_FOR_TARGET_S
74
    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
75
      dnl override RANLIB_FOR_TARGET's cache
76
      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
77
      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
78
    else
79
      AC_MSG_ERROR([***]
80
        [Can't figure out how to build a library index]
81
        [Neither ranlib nor ar -s seem to be available] )
82
    fi
83
  fi
84
 
85
dnl NOTE: These may not be available if not using gnutools
86
  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
87
  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
88
  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
89
])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.