From: Oliver Kurth Date: Tue, 19 Jun 2018 18:07:45 +0000 (-0700) Subject: FreeBSD: clang compiler related changes to configure.ac X-Git-Tag: stable-10.3.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c0b2130e7ee103ece06eb674c5f5dfea66c26f1;p=thirdparty%2Fopen-vm-tools.git FreeBSD: clang compiler related changes to configure.ac On FreeBSD, the unwind.h header is available in the libunwind package (/usr/ports/devel/libunwind) which may or may not be installed on a system. The libunwind functions to determine the call-chain in a program are defined only if " __GNU_SOURCE" is defined to enable "all" GCC extensions. Avoid the unwind.h header if seen on FreeBSD. The "clang" compiler will issue warnings if the address of a member of a packed structure is taken. Since warnings are errors with -Wall, add --Wno-address-of-packed-member to CFLAGS when compiling with "clang". --- diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index 9dfda10d1..a04a3bebe 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1164,6 +1164,13 @@ AC_CHECK_HEADERS([sys/user.h], ]) AC_CHECK_HEADERS([sys/vfs.h]) AC_CHECK_HEADERS([syslimits.h]) + +# On Freebsd, the unwind.h header file is available in the libunwind +# package, but the necessary functions are only available if __GNU_SOURCE +# is defined to enable "all" GCC extensions. +if test "$os" = "freebsd"; then + ac_cv_header_unwind_h="no" +fi AC_CHECK_HEADERS([unwind.h]) AC_CHECK_HEADER( @@ -1213,6 +1220,12 @@ AC_C_VOLATILE CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Werror" +# Suppress warnings from clang when taking the address of packed struct +# member fields when compiling hgfsServer.c +if $CC --version | $GREP -i "clang" > /dev/null; then + CFLAGS="$CFLAGS -Wno-address-of-packed-member" +fi + # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. # Glib2 keep changing mutex APIs so we also need to disable 'deprecated'