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

4.104.114.84.95
Last change on this file since bd5e4f3b was 2efdd08, checked in by Joel Sherrill <joel.sherrill@…>, on 05/20/98 at 17:06:57

Patch from Ralf Corseipus to fix latent configure problems suddenly triggered:

The breakdown:

  • CC_FOR_TARGET and CXX_FOR_TARGET were not correctly re-read from autoconf's configuration cache (config.cache)
  • If <target>-[gcc|g++] was not found while running configure, the config macros tried to use other (wrong) compilers (e.g. cc).

Changes:

  • New RTEMS_PROG_CC macro (aclocal/prog-cc.m4).
  • New RTEMS_PROG_CXX macro (aclocal/prog-cxx.m4)
  • Moved a shell script fragment from configure.in to a new m4-autoconf macro (New file: aclocal/tool-prefix.m4)
  • Minor changes to configure.in

I tested it with linux/posix (native gcc/primary libc) and
sh-rtems/gensh1 on a linux host and didn't notice any bugs
related to the problems mentioned above. There seem to be
more bugs with the posix bsp, but I consider them minor as
the build run completed successfully. It is just too late
for me to attempt to fix them now.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1dnl $Id$
2dnl
3dnl Set target tools
4dnl
5dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
6dnl
7
8AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
9[AC_REQUIRE([RTEMS_PROG_CC])dnl
10if test "$rtems_cv_prog_gcc" = "yes" ; then
11  dnl We are using gcc, now ask it about its tools
12  dnl Necessary if gcc was configured to use the target's native tools
13  dnl or uses prefixes for gnutools (e.g. gas instead of as)
14  AR_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ar`
15  AS_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=as`
16  LD_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ld`
17  NM_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=nm`
18  RANLIB_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ranlib`
19fi
20
21dnl check whether the tools exist
22dnl FIXME: What shall be done if they don't exist?
23
24dnl FIXME: This may fail if the compiler has not been recognized as gcc
25dnl       and uses tools with different names
26AC_PATH_PROG(AR_FOR_TARGET,"$program_prefix"ar,no)
27AC_PATH_PROG(AS_FOR_TARGET,"$program_prefix"as,no)
28AC_PATH_PROG(NM_FOR_TARGET,"$program_prefix"nm,no)
29AC_PATH_PROG(LD_FOR_TARGET,"$program_prefix"ld,no)
30
31dnl NOTE: This is doubtful, but should not disturb all current rtems'
32dnl       targets (remark: solaris fakes ranlib!!)
33AC_PATH_PROG(RANLIB_FOR_TARGET,"$program_prefix"ranlib,no)
34
35dnl NOTE: These may not be available, if not using gnutools
36AC_PATH_PROG(OBJCOPY_FOR_TARGET,"$program_prefix"objcopy,no)
37AC_PATH_PROG(SIZE_FOR_TARGET,"$program_prefix"size,no)
38])
Note: See TracBrowser for help on using the repository browser.