< prev index next >

common/autoconf/toolchain.m4

Print this page




 423     fi
 424     # Collapse compiler output into a single line
 425     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
 426     COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
 427         $SED -e 's/^.* version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
 428   else
 429       AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.])
 430   fi
 431   # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker)
 432   $1_VERSION_NUMBER="$COMPILER_VERSION_NUMBER"
 433   # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker)
 434   $1_VERSION_STRING="$COMPILER_VERSION_STRING"
 435 
 436   AC_MSG_NOTICE([Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER @<:@$COMPILER_VERSION_STRING@:>@])
 437 ])
 438 
 439 # Try to locate the given C or C++ compiler in the path, or otherwise.
 440 #
 441 # $1 = compiler to test (CC or CXX)
 442 # $2 = human readable name of compiler (C or C++)
 443 # $3 = list of compiler names to search for
 444 AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
 445 [
 446   COMPILER_NAME=$2
 447   SEARCH_LIST="$3"
 448 
 449   if test "x[$]$1" != x; then
 450     # User has supplied compiler name already, always let that override.
 451     AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1])
 452     if test "x`basename [$]$1`" = "x[$]$1"; then
 453       # A command without a complete path is provided, search $PATH.
 454 
 455       AC_PATH_PROGS(POTENTIAL_$1, [$]$1)
 456       if test "x$POTENTIAL_$1" != x; then
 457         $1=$POTENTIAL_$1
 458       else
 459         AC_MSG_ERROR([User supplied compiler $1=[$]$1 could not be found])
 460       fi
 461     else
 462       # Otherwise it might already be a complete path
 463       if test ! -x "[$]$1"; then


 465       fi
 466     fi
 467   else
 468     # No user supplied value. Locate compiler ourselves.
 469 
 470     # If we are cross compiling, assume cross compilation tools follows the
 471     # cross compilation standard where they are prefixed with the autoconf
 472     # standard name for the target. For example the binary
 473     # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10.
 474     # If we are not cross compiling, then the default compiler name will be
 475     # used.
 476 
 477     $1=
 478     # If TOOLCHAIN_PATH is set, check for all compiler names in there first
 479     # before checking the rest of the PATH.
 480     # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION
 481     # step, this should not be necessary.
 482     if test -n "$TOOLCHAIN_PATH"; then
 483       PATH_save="$PATH"
 484       PATH="$TOOLCHAIN_PATH"
 485       AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST)
 486       $1=$TOOLCHAIN_PATH_$1
 487       PATH="$PATH_save"
 488     fi
 489 
 490     # AC_PATH_PROGS can't be run multiple times with the same variable,
 491     # so create a new name for this run.
 492     if test "x[$]$1" = x; then
 493       AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST)
 494       $1=$POTENTIAL_$1
 495     fi
 496 
 497     if test "x[$]$1" = x; then
 498       HELP_MSG_MISSING_DEPENDENCY([devkit])
 499       AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
 500     fi
 501   fi
 502 
 503   # Now we have a compiler binary in $1. Make sure it's okay.
 504   BASIC_FIXUP_EXECUTABLE($1)
 505   TEST_COMPILER="[$]$1"
 506 
 507   AC_MSG_CHECKING([resolved symbolic links for $1])
 508   SYMLINK_ORIGINAL="$TEST_COMPILER"
 509   BASIC_REMOVE_SYMBOLIC_LINKS(SYMLINK_ORIGINAL)
 510   if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then
 511     AC_MSG_RESULT([no symlink])
 512   else
 513     AC_MSG_RESULT([$SYMLINK_ORIGINAL])




 423     fi
 424     # Collapse compiler output into a single line
 425     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
 426     COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
 427         $SED -e 's/^.* version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
 428   else
 429       AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.])
 430   fi
 431   # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker)
 432   $1_VERSION_NUMBER="$COMPILER_VERSION_NUMBER"
 433   # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker)
 434   $1_VERSION_STRING="$COMPILER_VERSION_STRING"
 435 
 436   AC_MSG_NOTICE([Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER @<:@$COMPILER_VERSION_STRING@:>@])
 437 ])
 438 
 439 # Try to locate the given C or C++ compiler in the path, or otherwise.
 440 #
 441 # $1 = compiler to test (CC or CXX)
 442 # $2 = human readable name of compiler (C or C++)
 443 # $3 = compiler name to search for
 444 AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
 445 [
 446   COMPILER_NAME=$2
 447   SEARCH_LIST="$3"
 448 
 449   if test "x[$]$1" != x; then
 450     # User has supplied compiler name already, always let that override.
 451     AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1])
 452     if test "x`basename [$]$1`" = "x[$]$1"; then
 453       # A command without a complete path is provided, search $PATH.
 454 
 455       AC_PATH_PROGS(POTENTIAL_$1, [$]$1)
 456       if test "x$POTENTIAL_$1" != x; then
 457         $1=$POTENTIAL_$1
 458       else
 459         AC_MSG_ERROR([User supplied compiler $1=[$]$1 could not be found])
 460       fi
 461     else
 462       # Otherwise it might already be a complete path
 463       if test ! -x "[$]$1"; then


 465       fi
 466     fi
 467   else
 468     # No user supplied value. Locate compiler ourselves.
 469 
 470     # If we are cross compiling, assume cross compilation tools follows the
 471     # cross compilation standard where they are prefixed with the autoconf
 472     # standard name for the target. For example the binary
 473     # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10.
 474     # If we are not cross compiling, then the default compiler name will be
 475     # used.
 476 
 477     $1=
 478     # If TOOLCHAIN_PATH is set, check for all compiler names in there first
 479     # before checking the rest of the PATH.
 480     # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION
 481     # step, this should not be necessary.
 482     if test -n "$TOOLCHAIN_PATH"; then
 483       PATH_save="$PATH"
 484       PATH="$TOOLCHAIN_PATH"
 485       AC_PATH_TOOL(TOOLCHAIN_PATH_$1, $SEARCH_LIST)
 486       $1=$TOOLCHAIN_PATH_$1
 487       PATH="$PATH_save"
 488     fi
 489 
 490     # AC_PATH_TOOL can't be run multiple times with the same variable,
 491     # so create a new name for this run.
 492     if test "x[$]$1" = x; then
 493       AC_PATH_TOOL(POTENTIAL_$1, $SEARCH_LIST)
 494       $1=$POTENTIAL_$1
 495     fi
 496 
 497     if test "x[$]$1" = x; then
 498       HELP_MSG_MISSING_DEPENDENCY([devkit])
 499       AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
 500     fi
 501   fi
 502 
 503   # Now we have a compiler binary in $1. Make sure it's okay.
 504   BASIC_FIXUP_EXECUTABLE($1)
 505   TEST_COMPILER="[$]$1"
 506 
 507   AC_MSG_CHECKING([resolved symbolic links for $1])
 508   SYMLINK_ORIGINAL="$TEST_COMPILER"
 509   BASIC_REMOVE_SYMBOLIC_LINKS(SYMLINK_ORIGINAL)
 510   if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then
 511     AC_MSG_RESULT([no symlink])
 512   else
 513     AC_MSG_RESULT([$SYMLINK_ORIGINAL])


< prev index next >