Merge pull request #2763 from InuSasha/fixes/glibc-drop-obsolete

glibc: drop obsolete code
This commit is contained in:
MilhouseVH 2018-07-16 00:38:51 +01:00 committed by GitHub
commit 5483e21be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 637 additions and 160 deletions

View File

@ -33,6 +33,8 @@ pre_configure_target() {
# When cross-compiling, configure can't set linux version
# forcing it
sed -i -e 's/ac_cv_linux_vers=unknown/ac_cv_linux_vers=2/' ../configure
CFLAGS+=" -I$SYSROOT_PREFIX/usr/include/tirpc"
LDFLAGS+=" -ltirpc"
}
pre_build_target() {

View File

@ -1,19 +1,20 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="glibc"
@ -47,8 +48,6 @@ PKG_CONFIGURE_OPTS_TARGET="BASH_SHELL=/bin/sh \
--enable-kernel=3.0.0 \
--without-cvs \
--without-gd \
--enable-obsolete-rpc \
--enable-obsolete-nsl \
--disable-build-nscd \
--disable-nscd \
--enable-lock-elision \
@ -89,7 +88,6 @@ pre_configure_target() {
# set some CFLAGS we need
export CFLAGS="$CFLAGS -g -fno-stack-protector"
export CFLAGS="$CFLAGS -Wno-error=stringop-truncation -Wno-error=overflow -Wno-error=format-overflow="
export BUILD_CC=$HOST_CC
export OBJDUMP_FOR_HOST=objdump

View File

@ -1,45 +1,46 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="libdnet"
PKG_VERSION="1.12"
PKG_SHA256="83b33039787cf99990e977cef7f18a5d5e7aaffc4505548a83d31bd3515eb026"
PKG_VERSION="8029bf9"
PKG_SHA256="1e41cbe5e4884108b08fa92964305354f1662b7e889f62736b3749845d7a8c56"
PKG_ARCH="any"
PKG_LICENSE="BSD"
PKG_SITE="http://code.google.com/p/libdnet/"
PKG_URL="http://libdnet.googlecode.com/files/$PKG_NAME-$PKG_VERSION.tgz"
PKG_SITE="https://github.com/sgeto/libdnet"
PKG_URL="https://github.com/sgeto/libdnet/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="network"
PKG_SHORTDESC="A simplified, portable interface to several low-level networking routines"
PKG_LONGDESC="A simplified, portable interface to several low-level networking routines"
PKG_TOOLCHAIN="autotools"
PKG_BUILD_FLAGS="+pic"
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_strlcat=no \
ac_cv_func_strlcpy=no \
--enable-static \
--disable-shared \
--without-python"
--disable-python"
pre_configure_target() {
sed "s|@prefix@|$SYSROOT_PREFIX/usr|g" -i $PKG_BUILD/dnet-config.in
export CFLAGS+=" -I$PKG_BUILD/include"
}
post_makeinstall_target() {
mkdir -p $TOOLCHAIN/bin
cp dnet-config $TOOLCHAIN/bin/
cp $SYSROOT_PREFIX/usr/bin/dnet-config \
$TOOLCHAIN/bin/dnet-config
}

View File

@ -1,68 +0,0 @@
diff -Naur libdnet-1.12/acconfig.h libdnet-1.12-patch/acconfig.h
--- libdnet-1.12/acconfig.h 2018-02-01 15:55:19.346009246 -0500
+++ libdnet-1.12-patch/acconfig.h 2018-02-01 15:59:14.826008240 -0500
@@ -20,11 +20,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/include/config.h.in libdnet-1.12-patch/include/config.h.in
--- libdnet-1.12/include/config.h.in 2018-02-01 15:51:57.346010109 -0500
+++ libdnet-1.12-patch/include/config.h.in 2018-02-01 15:59:47.316008101 -0500
@@ -282,11 +282,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/trunk/acconfig.h libdnet-1.12-patch/trunk/acconfig.h
--- libdnet-1.12/trunk/acconfig.h 2018-02-01 15:51:57.356010109 -0500
+++ libdnet-1.12-patch/trunk/acconfig.h 2018-02-01 16:00:08.526008010 -0500
@@ -20,11 +20,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/trunk/include/config.h.in libdnet-1.12-patch/trunk/include/config.h.in
--- libdnet-1.12/trunk/include/config.h.in 2018-02-01 15:51:57.356010109 -0500
+++ libdnet-1.12-patch/trunk/include/config.h.in 2018-02-01 16:00:34.786007898 -0500
@@ -282,11 +282,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP

View File

@ -27,6 +27,7 @@ PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="network"
PKG_SHORTDESC="libtirpc: Transport Independent RPC Library"
PKG_LONGDESC="Libtirpc is a port of Suns Transport-Independent RPC library to Linux. It's being developed by the Bull GNU/Linux NFSv4 project."
PKG_BUILD_FLAGS="+pic"
PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared \
--disable-silent-rules \

View File

@ -1,19 +1,20 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="openssh"
@ -23,14 +24,15 @@ PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_SITE="http://www.openssh.com/"
PKG_URL="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain zlib openssl"
PKG_DEPENDS_TARGET="toolchain openssl zlib"
PKG_SECTION="network"
PKG_SHORTDESC="openssh: An open re-implementation of the SSH package"
PKG_LONGDESC="This is a Linux port of OpenBSD's excellent OpenSSH. OpenSSH is based on the last free version of Tatu Ylonen's SSH with all patent-encumbered algorithms removed, all known security bugs fixed, new features reintroduced, and many other clean-ups. SSH (Secure Shell) is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels. It is intended as a replacement for rlogin, rsh, rcp, and rdist."
PKG_TOOLCHAIN="autotools"
PKG_BUILD_FLAGS="+lto"
PKG_CONFIGURE_OPTS_TARGET="--sysconfdir=/etc/ssh \
PKG_CONFIGURE_OPTS_TARGET="ac_cv_header_rpc_types_h=no \
--sysconfdir=/etc/ssh \
--libexecdir=/usr/lib/openssh \
--disable-strip \
--disable-lastlog \

View File

@ -1,19 +1,20 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="rpcbind"
@ -28,7 +29,8 @@ PKG_SECTION="network"
PKG_SHORTDESC="rpcbind: a server that converts RPC program numbers into universal addresses."
PKG_LONGDESC="The rpcbind utility is a server that converts RPC program numbers into universal addresses."
PKG_CONFIGURE_OPTS_TARGET="--disable-warmstarts \
PKG_CONFIGURE_OPTS_TARGET="ac_cv_header_rpcsvc_mount_h=no \
--disable-warmstarts \
--disable-libwrap \
--with-statedir=/tmp \
--with-rpcuser=root"

View File

@ -50,7 +50,7 @@ CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS=""
CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""
CONFIG_EXTRA_LDLIBS="-ltirpc -lpthread"
# CONFIG_USE_PORTABLE_CODE is not set
#

View File

@ -50,7 +50,7 @@ CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS=""
CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""
CONFIG_EXTRA_LDLIBS="-ltirpc -lpthread"
# CONFIG_USE_PORTABLE_CODE is not set
#

View File

@ -1,19 +1,20 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="busybox"
@ -24,8 +25,8 @@ PKG_LICENSE="GPL"
PKG_SITE="http://www.busybox.net"
PKG_URL="http://busybox.net/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_HOST=""
PKG_DEPENDS_TARGET="toolchain busybox:host hdparm dosfstools e2fsprogs zip unzip pciutils usbutils parted procps-ng gptfdisk"
PKG_DEPENDS_INIT="toolchain"
PKG_DEPENDS_TARGET="toolchain busybox:host hdparm dosfstools e2fsprogs zip unzip pciutils usbutils parted procps-ng gptfdisk libtirpc"
PKG_DEPENDS_INIT="toolchain libtirpc"
PKG_SECTION="system"
PKG_SHORTDESC="BusyBox: The Swiss Army Knife of Embedded Linux"
PKG_LONGDESC="BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system."
@ -105,6 +106,7 @@ configure_target() {
# optimize for size
CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"`
CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-Os|"`
CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/tirpc"
LDFLAGS="$LDFLAGS -fwhole-program"
@ -122,6 +124,7 @@ configure_init() {
# optimize for size
CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"`
CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-Os|"`
CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/tirpc"
LDFLAGS="$LDFLAGS -fwhole-program"

View File

@ -1,32 +1,32 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-present Team LibreELEC
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2011 Anthony Nash (nash.ant@gmail.com)
#
# OpenELEC is free software: you can redistribute it and/or modify
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="open-vm-tools"
PKG_VERSION="stable-10.1.5"
PKG_SHA256="53c281119a6ef43022853f858f91aa6985baed2e668c85fdfa0eb39c9c2c24a9"
PKG_VERSION="stable-10.2.5"
PKG_SHA256="c0f182c0c422fca8f8b3e5c21802f724256dfe5907383db28ec7e4d5b6d52b0f"
PKG_ARCH="x86_64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/vmware/open-vm-tools"
PKG_URL="https://github.com/vmware/open-vm-tools/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain glib:host glib libdnet fuse"
PKG_DEPENDS_TARGET="toolchain fuse glib:host glib libdnet libtirpc"
PKG_SECTION="virtualization"
PKG_SHORTDESC="open-vm-tools: open source implementation of VMware Tools"
PKG_LONGDESC="open-vm-tools: open source implementation of VMware Tools"
PKG_TOOLCHAIN="autotools"
@ -53,7 +53,7 @@ post_unpack() {
}
pre_configure_target() {
export LIBS="-ldnet"
export LIBS="-ldnet -ltirpc"
}
post_makeinstall_target() {

View File

@ -1,44 +0,0 @@
From 4c20c27ee1b3d0c88ee5d6e41b88a5c94432dbcc Mon Sep 17 00:00:00 2001
From: Oliver Kurth <okurth@vmware.com>
Date: Thu, 20 Apr 2017 18:04:18 -0700
Subject: [PATCH] Include sysmacros.h directly as mandated by glibc-2.25.
glibc-2.25 generates a deprecation warning for using the 'major'
macro without including sysmacros.h.
https://sourceware.org/glibc/wiki/Release/2.25
This breaks Fedora builds of open-vm-tools because Fedora 26 is
switching to glibc-2.25.
---
lib/wiper/wiperPosix.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/wiper/wiperPosix.c b/lib/wiper/wiperPosix.c
index d389eee..b41bd72 100644
--- a/lib/wiper/wiperPosix.c
+++ b/lib/wiper/wiperPosix.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2004-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -30,6 +30,9 @@
#include <stdio.h>
#include <sys/stat.h>
#if defined(__linux__) || defined(sun)
+# if defined(__linux__)
+# include <sys/sysmacros.h>
+# endif
# include <sys/vfs.h>
#elif defined(__FreeBSD__) || defined(__APPLE__)
# include <sys/param.h>
@@ -44,7 +47,6 @@
#include "vmware.h"
#include "wiper.h"
-#include "util.h"
#include "str.h"
#include "strutil.h"
#include "fileIO.h"

View File

@ -0,0 +1,580 @@
From 375d4463c68be3a133e4377655b68cc090cd9511 Mon Sep 17 00:00:00 2001
From: Oliver Kurth <okurth@vmware.com>
Date: Thu, 17 May 2018 16:58:49 -0700
Subject: [PATCH] open-vm-tools: build with tirpc
Newer distros (Fedora, OpenSuSE Tumblweed) no longer ship rpcgen with glibc,
so we need to build with libtirpc (see
https://bugzilla.redhat.com/show_bug.cgi?id=1531540 and
https://bugzilla.suse.com/show_bug.cgi?id=1089181). With this change,
configure will check for the presence of libtirpc and if found, sets
flags to build with it. configure will also exit with an error if
rpcgen is not found.
---
open-vm-tools/configure.ac | 80 +++++++++++++++++++---
open-vm-tools/lib/dynxdr/Makefile.am | 10 ++-
open-vm-tools/lib/dynxdr/dynxdr.c | 16 +++--
open-vm-tools/lib/guestRpc/Makefile.am | 8 ++-
open-vm-tools/lib/netUtil/Makefile.am | 8 ++-
open-vm-tools/lib/nicInfo/Makefile.am | 14 ++--
open-vm-tools/lib/rpcChannel/Makefile.am | 7 +-
open-vm-tools/lib/slashProc/Makefile.am | 5 +-
open-vm-tools/lib/slashProc/net.c | 1 -
open-vm-tools/libguestlib/Makefile.am | 4 +-
open-vm-tools/services/plugins/dndcp/Makefile.am | 2 +
.../services/plugins/guestInfo/Makefile.am | 7 +-
.../services/plugins/resolutionKMS/resolutionKMS.c | 7 +-
.../services/plugins/resolutionSet/resolutionSet.c | 3 +-
open-vm-tools/services/plugins/vix/Makefile.am | 4 +-
open-vm-tools/services/plugins/vix/vixTools.c | 1 -
.../services/plugins/vmbackup/Makefile.am | 4 +-
.../services/plugins/vmbackup/stateMachine.c | 1 -
open-vm-tools/toolbox/Makefile.am | 4 +-
19 files changed, 138 insertions(+), 48 deletions(-)
diff --git a/configure.ac b/configure.ac
index b283ebe88..bc6e87a70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -586,6 +586,11 @@ AC_ARG_WITH([xml2],
[enable_vgauth=no],
[with_xml2=yes])
+AC_ARG_WITH([tirpc],
+ [AS_HELP_STRING([--without-tirpc],
+ [compiles with/without libtirpc.])],
+ [],
+ [with_tirpc=auto])
# Make sure we are building with openssl 1.0.1 and above so that
# we use only TLSv1_2.
@@ -1066,10 +1071,74 @@ if test "$enable_caf" = "yes"; then
fi
+if test "$with_tirpc" != "no"; then
+ AC_VMW_CHECK_LIB([libtirpc],
+ [TIRPC],
+ [libtirpc],
+ [],
+ [],
+ [],
+ [],
+ [have_tirpc="yes"],
+ [have_tirpc="no"])
+fi
+
+if test "$with_tirpc" != "yes"; then
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
+
+ int main()
+ {
+ struct xdr_ops xdr;
+#if defined(__GLIBC__)
+ xdr.x_putint32(NULL, NULL);
+#endif
+ return 0;
+ }
+ ]])], [need_tirpc="no"], [need_tirpc="yes"])
+ AC_MSG_NOTICE([tirpc is needed: $need_tirpc])
+fi
+
+if test "$with_tirpc" = "no"; then
+ if test "$need_tirpc" = "yes"; then
+ AC_MSG_ERROR([libtirpc is required but it is disabled.])
+ fi
+ use_tirpc="no"
+elif test "$with_tirpc" = "auto"; then
+ if test "$need_tirpc" = "yes" -a "$have_tirpc" = "no"; then
+ AC_MSG_ERROR([cannot find libtirpc but it is required.])
+ fi
+ use_tirpc=$need_tirpc
+elif test "$with_tirpc" = "yes"; then
+ if test "$have_tirpc" = "no"; then
+ AC_MSG_ERROR([cannot build with libtirpc because it cannot be found.])
+ fi
+ use_tirpc="yes"
+fi
+
+XDR_LIBS=
+XDR_CPPFLAGS=
+if test "$use_tirpc" = "yes"; then
+ AC_MSG_NOTICE([building with libtirpc])
+ XDR_LIBS="$TIRPC_LIBS"
+ XDR_CPPFLAGS="-DUSE_TIRPC $TIRPC_CPPFLAGS"
+else
+ AC_MSG_NOTICE([building without libtirpc])
+ # In Solaris, the XDR-related functions are not in libc like in Linux and
+ # FreeBSD, so binaries need to be linked to some extra libraries.
+ if test "$os" = "solaris"; then
+ XDR_LIBS="-lnsl -lrpcsvc"
+ fi
+fi
+
AC_PATH_PROG(
[RPCGEN],
[rpcgen],
- [ AC_MSG_ERROR([rpcgen not found. Please install the libc devel package.]) ])
+ [not_found])
+if test "$RPCGEN" == "not_found"; then
+ AC_MSG_ERROR([rpcgen not found.])
+fi
###
### Headers
@@ -1389,7 +1458,6 @@ AM_CONDITIONAL(HAVE_XSM, test "$have_xsm" = "yes")
AM_CONDITIONAL(HAVE_XCOMPOSITE, test "$have_xcomposite" = "yes")
AM_CONDITIONAL(ENABLE_TESTS, test "$have_cunit" = "yes")
AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes")
-AM_CONDITIONAL(HAVE_DNET, test "$have_dnet" = "yes")
AM_CONDITIONAL(HAVE_DOXYGEN, test "$have_doxygen" = "yes")
AM_CONDITIONAL(HAVE_FUSE, test "$have_fuse" = "yes")
AM_CONDITIONAL(HAVE_GNU_LD, test "$with_gnu_ld" = "yes")
@@ -1447,13 +1515,6 @@ VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS"
PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS"
PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version"
-# In Solaris, the XDR-related functions are not in libc like in Linux and
-# FreeBSD, so binaries need to be linked to some extra libraries.
-XDR_LIBS=
-if test "$os" = "solaris"; then
- XDR_LIBS="-lnsl -lrpcsvc"
-fi
-
# Installation directories for core services plugins.
TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests
COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common
@@ -1493,6 +1554,7 @@ AC_SUBST([VMTOOLS_CPPFLAGS])
AC_SUBST([VMTOOLS_LIBS])
AC_SUBST([RPCGENFLAGS])
AC_SUBST([XDR_LIBS])
+AC_SUBST([XDR_CPPFLAGS])
AC_SUBST([TEST_PLUGIN_INSTALLDIR])
AC_SUBST([COMMON_PLUGIN_INSTALLDIR])
AC_SUBST([VMSVC_PLUGIN_INSTALLDIR])
diff --git a/lib/dynxdr/Makefile.am b/lib/dynxdr/Makefile.am
index 841c17dbc..058606fec 100644
--- a/lib/dynxdr/Makefile.am
+++ b/lib/dynxdr/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -17,7 +17,13 @@
noinst_LTLIBRARIES = libDynxdr.la
-libDynxdr_la_SOURCES =
+libDynxdr_la_SOURCES =
libDynxdr_la_SOURCES += dynxdr.c
libDynxdr_la_SOURCES += xdrutil.c
+libDynxdr_la_CPPFLAGS =
+libDynxdr_la_CPPFLAGS += @XDR_CPPFLAGS@
+
+libDynxdr_la_LIBADD =
+libDynxdr_la_LIBADD += @XDR_LIBS@
+
diff --git a/lib/dynxdr/dynxdr.c b/lib/dynxdr/dynxdr.c
index 95fdc7e2f..bd42c7513 100644
--- a/lib/dynxdr/dynxdr.c
+++ b/lib/dynxdr/dynxdr.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -55,7 +55,7 @@ typedef struct DynXdrData {
* Mac OS X, FreeBSD and Solaris don't take a const parameter to the
* "x_getpostn" function.
*/
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) || defined(USE_TIRPC)
# define DYNXDR_GETPOS_CONST
#else
# define DYNXDR_GETPOS_CONST const
@@ -172,7 +172,11 @@ DynXdrSetPos(XDR *xdrs, // IN
}
-#if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL)))
+#if !defined(USE_TIRPC) && \
+ defined(__GLIBC__) || \
+ (defined(sun) && \
+ (defined(_LP64) || \
+ defined(_KERNEL)))
/*
*-----------------------------------------------------------------------------
*
@@ -322,11 +326,11 @@ DynXdr_Create(XDR *in) // IN
DynXdrSetPos, /* x_setpostn */
DynXdrInline, /* x_inline */
NULL, /* x_destroy */
-#if defined(__GLIBC__)
+#if defined(__APPLE__) || defined(USE_TIRPC)
+ NULL, /* x_control */
+#elif defined(__GLIBC__)
NULL, /* x_getint32 */
DynXdrPutInt32, /* x_putint32 */
-#elif defined(__APPLE__)
- NULL, /* x_control */
#elif defined(sun) && (defined(_LP64) || defined(_KERNEL))
NULL, /* x_control */
NULL, /* x_getint32 */
diff --git a/lib/guestRpc/Makefile.am b/lib/guestRpc/Makefile.am
index 1605a27c2..f06972bef 100644
--- a/lib/guestRpc/Makefile.am
+++ b/lib/guestRpc/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -43,3 +43,9 @@ nicinfo.h: nicinfo.x
nicinfo_xdr.c: nicinfo.x nicinfo.h
@RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@
+libGuestRpc_la_CPPFLAGS =
+libGuestRpc_la_CPPFLAGS += @XDR_CPPFLAGS@
+
+libGuestRpc_la_LIBADD =
+libGuestRpc_la_LIBADD += @XDR_LIBS@
+
diff --git a/lib/netUtil/Makefile.am b/lib/netUtil/Makefile.am
index eddc4ae08..aa93f77e6 100644
--- a/lib/netUtil/Makefile.am
+++ b/lib/netUtil/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2007-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -20,3 +20,9 @@ noinst_LTLIBRARIES = libNetUtil.la
libNetUtil_la_SOURCES =
libNetUtil_la_SOURCES += netUtilLinux.c
+libNetUtil_la_CPPFLAGS =
+libNetUtil_la_CPPFLAGS += @XDR_CPPFLAGS@
+
+libNetUtil_la_LIBADD =
+libNetUtil_la_LIBADD += @XDR_LIBS@
+
diff --git a/lib/nicInfo/Makefile.am b/lib/nicInfo/Makefile.am
index de09172bf..b7085a795 100644
--- a/lib/nicInfo/Makefile.am
+++ b/lib/nicInfo/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2014-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2014-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -25,13 +25,13 @@ libNicInfo_la_SOURCES += nicInfoPosix.c
libNicInfo_la_CPPFLAGS =
libNicInfo_la_CPPFLAGS += @GLIB2_CPPFLAGS@
-
-AM_CFLAGS = $(DNET_CPPFLAGS)
+libNicInfo_la_CPPFLAGS += @XDR_CPPFLAGS@
+libNicInfo_la_CPPFLAGS += $(DNET_CPPFLAGS)
if USE_SLASH_PROC
-AM_CFLAGS += -DUSE_SLASH_PROC
+libNicInfo_la_CPPFLAGS += -DUSE_SLASH_PROC
endif
+
libNicInfo_la_LIBADD =
-if HAVE_DNET
- libNicInfo_la_LIBADD += @DNET_LIBS@
-endif
+libNicInfo_la_LIBADD += @DNET_LIBS@
+libNicInfo_la_LIBADD += @XDR_LIBS@
diff --git a/lib/rpcChannel/Makefile.am b/lib/rpcChannel/Makefile.am
index 4577b6552..283a2da60 100644
--- a/lib/rpcChannel/Makefile.am
+++ b/lib/rpcChannel/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2009-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -27,3 +27,8 @@ endif
libRpcChannel_la_CPPFLAGS =
libRpcChannel_la_CPPFLAGS += @VMTOOLS_CPPFLAGS@
+libRpcChannel_la_CPPFLAGS += @XDR_CPPFLAGS@
+
+libRpcChannel_la_LIBADD =
+libRpcChannel_la_LIBADD += @XDR_LIBS@
+
diff --git a/lib/slashProc/Makefile.am b/lib/slashProc/Makefile.am
index b3afe9e5e..181127e1a 100644
--- a/lib/slashProc/Makefile.am
+++ b/lib/slashProc/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2007-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -22,6 +22,5 @@ libSlashProc_la_SOURCES += net.c
libSlashProc_la_CPPFLAGS =
libSlashProc_la_CPPFLAGS += @GLIB2_CPPFLAGS@
-
-AM_CFLAGS = $(DNET_CPPFLAGS)
+libSlashProc_la_CPPFLAGS += @DNET_CPPFLAGS@
diff --git a/lib/slashProc/net.c b/lib/slashProc/net.c
index 1d2a88800..952fb90e1 100644
--- a/lib/slashProc/net.c
+++ b/lib/slashProc/net.c
@@ -36,7 +36,6 @@
#include "panic.h"
#include "slashProc.h"
#include "slashProcNetInt.h"
-#include "netutil.h"
/*
diff --git a/libguestlib/Makefile.am b/libguestlib/Makefile.am
index b49af696f..5181409f3 100644
--- a/libguestlib/Makefile.am
+++ b/libguestlib/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2007-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -22,6 +22,7 @@ AM_CFLAGS += -I$(top_srcdir)/include
libguestlib_la_LIBADD =
libguestlib_la_LIBADD += @VMTOOLS_LIBS@
+libguestlib_la_LIBADD += @XDR_LIBS@
libguestlib_la_SOURCES =
libguestlib_la_SOURCES += guestlibV3_xdr.c
@@ -56,6 +57,7 @@ CFLAGS += -Wno-unused
libguestlib_la_CPPFLAGS =
libguestlib_la_CPPFLAGS += -DVMTOOLS_USE_GLIB
libguestlib_la_CPPFLAGS += @GLIB2_CPPFLAGS@
+libguestlib_la_CPPFLAGS += @XDR_CPPFLAGS@
EXTRA_DIST = vmguestlib.pc.in
diff --git a/services/plugins/dndcp/Makefile.am b/services/plugins/dndcp/Makefile.am
index d1543054c..be088e54b 100644
--- a/services/plugins/dndcp/Makefile.am
+++ b/services/plugins/dndcp/Makefile.am
@@ -28,6 +28,7 @@ libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/dndGuest
libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/stringxx
libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/xutils
libdndcp_la_CPPFLAGS += -I$(top_srcdir)/include
+libdndcp_la_CPPFLAGS += @XDR_CPPFLAGS@
# Passing C++ related flags to CPPFLAGS generates error.
# So, we need to pass these to C++ compilation only.
@@ -45,6 +46,7 @@ libdndcp_la_LIBADD += @GTKMM_LIBS@
libdndcp_la_LIBADD += @VMTOOLS_LIBS@
libdndcp_la_LIBADD += @HGFS_LIBS@
libdndcp_la_LIBADD += $(top_builddir)/lib/hgfsUri/hgfsUriPosix.lo
+libdndcp_la_LIBADD += @XDR_LIBS@
libdndcp_la_SOURCES =
diff --git a/services/plugins/guestInfo/Makefile.am b/services/plugins/guestInfo/Makefile.am
index 319e719f2..09ae4ddfe 100644
--- a/services/plugins/guestInfo/Makefile.am
+++ b/services/plugins/guestInfo/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
+### Copyright (C) 2009-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -22,6 +22,7 @@ plugin_LTLIBRARIES = libguestInfo.la
libguestInfo_la_CPPFLAGS =
libguestInfo_la_CPPFLAGS += @PLUGIN_CPPFLAGS@
+libguestInfo_la_CPPFLAGS += @XDR_CPPFLAGS@
libguestInfo_la_LDFLAGS =
libguestInfo_la_LDFLAGS += @PLUGIN_LDFLAGS@
@@ -30,9 +31,7 @@ libguestInfo_la_LIBADD =
libguestInfo_la_LIBADD += @VMTOOLS_LIBS@
libguestInfo_la_LIBADD += @XDR_LIBS@
-if HAVE_DNET
- libguestInfo_la_LIBADD += @DNET_LIBS@
-endif
+libguestInfo_la_LIBADD += @DNET_LIBS@
libguestInfo_la_SOURCES =
libguestInfo_la_SOURCES += guestInfoServer.c
diff --git a/services/plugins/resolutionKMS/resolutionKMS.c b/services/plugins/resolutionKMS/resolutionKMS.c
index 222927131..4dc9084ff 100644
--- a/services/plugins/resolutionKMS/resolutionKMS.c
+++ b/services/plugins/resolutionKMS/resolutionKMS.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -29,16 +29,13 @@
#include <sys/stat.h>
#include <fcntl.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vmware.h"
-#include "debug.h"
-#include "rpcout.h"
-#include "str.h"
#include "strutil.h"
-#include "xdrutil.h"
#include "vmware/guestrpc/tclodefs.h"
#include "vmware/tools/plugin.h"
#include "vmware/tools/utils.h"
diff --git a/services/plugins/resolutionSet/resolutionSet.c b/services/plugins/resolutionSet/resolutionSet.c
index b9da3fdfd..4cc9bd164 100644
--- a/services/plugins/resolutionSet/resolutionSet.c
+++ b/services/plugins/resolutionSet/resolutionSet.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -34,7 +34,6 @@
#include "resolutionInt.h"
-#include "xdrutil.h"
#include "vmware/guestrpc/tclodefs.h"
#include "vmware/tools/plugin.h"
#include "vmware/tools/utils.h"
diff --git a/services/plugins/vix/Makefile.am b/services/plugins/vix/Makefile.am
index f7d541e52..5c4d7f52e 100644
--- a/services/plugins/vix/Makefile.am
+++ b/services/plugins/vix/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2009-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -21,6 +21,7 @@ plugin_LTLIBRARIES = libvix.la
libvix_la_CPPFLAGS =
libvix_la_CPPFLAGS += @PLUGIN_CPPFLAGS@
libvix_la_CPPFLAGS += -I$(top_srcdir)/vgauth/public
+libvix_la_CPPFLAGS += @XDR_CPPFLAGS@
libvix_la_LDFLAGS =
libvix_la_LDFLAGS += @PLUGIN_LDFLAGS@
@@ -35,6 +36,7 @@ libvix_la_LIBADD += $(top_builddir)/lib/impersonate/libImpersonate.la
if ENABLE_VGAUTH
libvix_la_LIBADD += $(top_builddir)/vgauth/lib/libvgauth.la
endif
+libvix_la_LIBADD += @XDR_LIBS@
libvix_la_SOURCES =
libvix_la_SOURCES += foundryToolsDaemon.c
diff --git a/services/plugins/vix/vixTools.c b/services/plugins/vix/vixTools.c
index 98df172d8..d16bcc6e0 100644
--- a/services/plugins/vix/vixTools.c
+++ b/services/plugins/vix/vixTools.c
@@ -91,7 +91,6 @@
#include "str.h"
#include "file.h"
#include "err.h"
-#include "guestInfo.h" // MAX_VALUE_LEN
#include "hostinfo.h"
#include "guest_os.h"
#include "guest_msg_def.h"
diff --git a/services/plugins/vmbackup/Makefile.am b/services/plugins/vmbackup/Makefile.am
index 88082b92c..7beeb375a 100644
--- a/services/plugins/vmbackup/Makefile.am
+++ b/services/plugins/vmbackup/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
+### Copyright (C) 2009-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -20,6 +20,7 @@ plugin_LTLIBRARIES = libvmbackup.la
libvmbackup_la_CPPFLAGS =
libvmbackup_la_CPPFLAGS += @PLUGIN_CPPFLAGS@
+libvmbackup_la_CPPFLAGS += @XDR_CPPFLAGS@
libvmbackup_la_LDFLAGS =
libvmbackup_la_LDFLAGS += @PLUGIN_LDFLAGS@
@@ -27,6 +28,7 @@ libvmbackup_la_LDFLAGS += @PLUGIN_LDFLAGS@
libvmbackup_la_LIBADD =
libvmbackup_la_LIBADD += @GOBJECT_LIBS@
libvmbackup_la_LIBADD += @VMTOOLS_LIBS@
+libvmbackup_la_LIBADD += @XDR_LIBS@
libvmbackup_la_SOURCES =
libvmbackup_la_SOURCES += nullProvider.c
diff --git a/services/plugins/vmbackup/stateMachine.c b/services/plugins/vmbackup/stateMachine.c
index af226eb71..89a907ca5 100644
--- a/services/plugins/vmbackup/stateMachine.c
+++ b/services/plugins/vmbackup/stateMachine.c
@@ -35,7 +35,6 @@
#include "vmBackupInt.h"
-#include "dynxdr.h"
#include <glib-object.h>
#include <gmodule.h>
#include "guestApp.h"
diff --git a/toolbox/Makefile.am b/toolbox/Makefile.am
index 66d36ac69..75f81b2a3 100644
--- a/toolbox/Makefile.am
+++ b/toolbox/Makefile.am
@@ -1,5 +1,5 @@
################################################################################
-### Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2007-2018 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
@@ -20,9 +20,11 @@ bin_PROGRAMS = vmware-toolbox-cmd
vmware_toolbox_cmd_LDADD =
vmware_toolbox_cmd_LDADD += ../libguestlib/libguestlib.la
vmware_toolbox_cmd_LDADD += @VMTOOLS_LIBS@
+vmware_toolbox_cmd_LDADD += @XDR_LIBS@
vmware_toolbox_cmd_CPPFLAGS =
vmware_toolbox_cmd_CPPFLAGS += @VMTOOLS_CPPFLAGS@
+vmware_toolbox_cmd_CPPFLAGS += @XDR_CPPFLAGS@
vmware_toolbox_cmd_SOURCES =
vmware_toolbox_cmd_SOURCES += toolbox-cmd.c