< prev index next >

common/autoconf/toolchain.m4

Print this page
@  rev 2181 : 8031668: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links
|  Reviewed-by: erikj, ihse
~


 550     # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
 551     # We want to control ccache invocation ourselves, so ignore this cc and try
 552     # searching again.
 553 
 554     # Remove the path to the fake ccache cc from the PATH
 555     RETRY_COMPILER_SAVED_PATH="$PATH"
 556     COMPILER_DIRNAME=`$DIRNAME [$]$1`
 557     PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`"
 558 
 559     # Try again looking for our compiler
 560     AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3)
 561     BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1)
 562     PATH="$RETRY_COMPILER_SAVED_PATH"
 563 
 564     AC_MSG_CHECKING([for resolved symbolic links for $1])
 565     BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1)
 566     AC_MSG_RESULT([$PROPER_COMPILER_$1])
 567     $1="$PROPER_COMPILER_$1"
 568   else
 569     AC_MSG_RESULT([no, keeping $1])
 570     $1="$TEST_COMPILER"
 571   fi
 572 
 573   TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])
 574 ])
 575 
 576 # Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
 577 # preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the
 578 # archiver (AR). Verify that the compilers are correct according to the
 579 # toolchain type.
 580 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
 581 [
 582   #
 583   # Setup the compilers (CC and CXX)
 584   #
 585   TOOLCHAIN_FIND_COMPILER([CC], [C], $TOOLCHAIN_CC_BINARY)
 586   # Now that we have resolved CC ourself, let autoconf have its go at it
 587   AC_PROG_CC([$CC])
 588 
 589   TOOLCHAIN_FIND_COMPILER([CXX], [C++], $TOOLCHAIN_CXX_BINARY)
 590   # Now that we have resolved CXX ourself, let autoconf have its go at it




 550     # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
 551     # We want to control ccache invocation ourselves, so ignore this cc and try
 552     # searching again.
 553 
 554     # Remove the path to the fake ccache cc from the PATH
 555     RETRY_COMPILER_SAVED_PATH="$PATH"
 556     COMPILER_DIRNAME=`$DIRNAME [$]$1`
 557     PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`"
 558 
 559     # Try again looking for our compiler
 560     AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3)
 561     BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1)
 562     PATH="$RETRY_COMPILER_SAVED_PATH"
 563 
 564     AC_MSG_CHECKING([for resolved symbolic links for $1])
 565     BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1)
 566     AC_MSG_RESULT([$PROPER_COMPILER_$1])
 567     $1="$PROPER_COMPILER_$1"
 568   else
 569     AC_MSG_RESULT([no, keeping $1])

 570   fi
 571 
 572   TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])
 573 ])
 574 
 575 # Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
 576 # preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the
 577 # archiver (AR). Verify that the compilers are correct according to the
 578 # toolchain type.
 579 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
 580 [
 581   #
 582   # Setup the compilers (CC and CXX)
 583   #
 584   TOOLCHAIN_FIND_COMPILER([CC], [C], $TOOLCHAIN_CC_BINARY)
 585   # Now that we have resolved CC ourself, let autoconf have its go at it
 586   AC_PROG_CC([$CC])
 587 
 588   TOOLCHAIN_FIND_COMPILER([CXX], [C++], $TOOLCHAIN_CXX_BINARY)
 589   # Now that we have resolved CXX ourself, let autoconf have its go at it


< prev index next >