From: Oliver Kurth Date: Tue, 30 Jan 2018 00:52:18 +0000 (-0800) Subject: open-vm-tools: fix finding C++ compiler for cross-compiling X-Git-Tag: 10.2.5~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d912c7d754df19c4580382c20e9e7701afd5eaa;p=thirdparty%2Fopen-vm-tools.git open-vm-tools: fix finding C++ compiler for cross-compiling Patch contributed by Andrew Stormont (andy-js) on github: https://github.com/vmware/open-vm-tools/pull/206 and https://github.com/vmware/open-vm-tools/issues/92. --- diff --git a/open-vm-tools/AUTHORS b/open-vm-tools/AUTHORS index 4f94efee1..de6a1eba3 100644 --- a/open-vm-tools/AUTHORS +++ b/open-vm-tools/AUTHORS @@ -13,3 +13,7 @@ Josh Paetzel Add support for 64-bit inodes in FreeBSD 12 Sebastian Parschauer Add support to properly report SLES12-SAP - https://github.com/vmware/open-vm-tools/pull/123 + +Andrew Stormont Fix finding C++ compiler for cross-compiling + - https://github.com/vmware/open-vm-tools/pull/206 + diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index a71d737ba..aca6c380c 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2007-2017 VMware, Inc. All rights reserved. +### Copyright (C) 2007-2018 VMware, Inc. All rights reserved. ### ### Configure script for building the VMware OSS Tools. ### @@ -962,7 +962,17 @@ AC_ARG_WITH([icu], [with_icu=yes]) if test "$have_x" = "yes" -o "$with_icu" = "yes"; then - AC_CHECK_TOOL([have_cxx], [$CXX], [no]) + # AC_CHECK_PROG fails to locate CXX if it's set to an absolute + # path and it includes arguments, which is often the case when + # cross compling. Try to handle this case directly. + case "$CXX" in + [/*]) + AS_IF(test -x ${CXX%% *}, [have_cxx=yes], [have_cxx=no]) + ;; + [*]) + AC_CHECK_PROG([have_cxx], [$CXX], [yes], [no]) + ;; + esac if test "$have_cxx" = "no"; then AC_MSG_ERROR([C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu).]) fi