source: rtems/aclocal/canonicalize-tools.m4 @ 8e57762

4.104.114.84.95
Last change on this file since 8e57762 was 70810dc, checked in by Joel Sherrill <joel.sherrill@…>, on 02/08/00 at 22:33:25

Patches rtems-rc-20000204-0.diff from Ralf Corsepius <corsepiu@…>
that contains:

  • Removes remaining (now illegal) references to $(SRC) from a couple of Makefile.ams
  • Removes duplicate AC_CONFIG_SUBDIRS macro from c/configure.in
  • Moves ENABLE_LIBCDIR into RTEMS_PROG_C[C|XX]_FOR_TARGET (hides LIBCDIR from most configure scripts, i.e. LIBCDIR becomes less visible)
  • Adds RTEMS_PROG_C[C|XX]_FOR_TARGET and RTEMS_CANONICALIZE_TOOLS to libbsp/*/configure.ins (A minor bug in previous implementations, which only has an impact when switching to GNU/Cygnus canonicalization)
  • Cleans up several bogus comments.
  • Removes MKLIB
  • Switches the version number to 4.5.0 (for testing version number handling)
  • Property mode set to 100644
File size: 2.5 KB
Line 
1dnl
2dnl $Id$
3dnl
4dnl Set target tools
5dnl
6dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
7dnl             fixing cache/environment variable handling
8dnl             adding checks for cygwin/egcs '\\'-bug
9dnl             adding checks for ranlib/ar -s problem
10dnl
11dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
12dnl
13
14AC_DEFUN(RTEMS_GCC_PRINT,
15[
16    $1=`$CC_FOR_TARGET --print-prog-name=$2`
17])
18
19AC_DEFUN(RTEMS_PATH_TOOL,
20[
21AC_MSG_CHECKING([target's $2])
22AC_CACHE_VAL(ac_cv_path_$1,:)
23AC_MSG_RESULT([$ac_cv_path_$1])
24
25if test -n "$ac_cv_path_$1"; then
26  dnl retrieve the value from the cache
27  $1=$ac_cv_path_$1
28else
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)
57fi
58])
59
60AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
61[AC_REQUIRE([RTEMS_PROG_CC])dnl
62
63dnl 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
69dnl 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
85dnl 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])
Note: See TracBrowser for help on using the repository browser.