]> 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>
Fri, 5 Jan 2018 22:47:15 +0000 (14:47 -0800)
committerOliver Kurth <okurth@vmware.com>
Fri, 5 Jan 2018 22:47:15 +0000 (14:47 -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 6ba126eedd170fa2fde21ae29170864ca0c33e9d..9754bb27e7238068115482cf76bad59818624887 100644 (file)
@@ -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