source: rtems/aclocal/canonicalize-tools.m4 @ d273d78a

4.104.114.84.95
Last change on this file since d273d78a was 78ffe89, checked in by Joel Sherrill <joel.sherrill@…>, on 10/11/99 at 15:50:20

Patch from Ralf Corsepius <corsepiu@…>

Removed all go32 configuration tests.

This patch also comments out some special treatment for Cygwin from
*.m4 macros. According to reports from David Fiddes. these should
not be necessary anymore.

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