source: rtems/aclocal/canonicalize-tools.m4 @ 8555ddb

4.104.114.84.95
Last change on this file since 8555ddb was 8555ddb, checked in by Joel Sherrill <joel.sherrill@…>, on 07/10/98 at 13:22:23

Patch from David Fiddes <D.J.Fiddes@…>. Comments below:

With a bit of help from Ralf I was able to trace the problem with sed. It
was a typo, sed should have had it's params surrounded by 's rather than "s
which bash picked up and discarded. The patch is enclosed.

Ralf and I aren't sure why configure didn't just stop at this point... The
rest of configure/build went OK because there are two sections where the

-for-/ hack is implemented and the other one is more important and worked
just fine.

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