]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
open-vm-tools: fix finding C++ compiler for cross-compiling
authorOliver Kurth <okurth@vmware.com>
Tue, 30 Jan 2018 00:52:18 +0000 (16:52 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 30 Jan 2018 00:52:18 +0000 (16:52 -0800)
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.

open-vm-tools/AUTHORS
open-vm-tools/configure.ac

index 4f94efee169df448c9d72f3a4d6487aa83c28487..de6a1eba3b3e12822b0eb7a2ae7bfb100f4457d0 100644 (file)
@@ -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
+
index a71d737baff34a637da17011c1f25cd2b7443ade..aca6c380c8e4603804f34d23e6c5b41882f4a862 100644 (file)
@@ -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