From: Katy Feng Date: Tue, 22 Aug 2023 22:51:19 +0000 (-0700) Subject: Fix build problems with grpc X-Git-Tag: stable-12.3.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14dfd9c00b5321bafc012f678ef1cd2129e03a73;p=thirdparty%2Fopen-vm-tools.git Fix build problems with grpc Updating Makefiles to put -l specifiers into LIBADD and not LDFLAGS. Use the grpc++ pkgconfig (.pc file) if it exists to retrieve flags and libraries for linking. Pull request: https://github.com/vmware/open-vm-tools/pull/664 --- diff --git a/open-vm-tools/AUTHORS b/open-vm-tools/AUTHORS index ac5fd878e..156f5cc2e 100644 --- a/open-vm-tools/AUTHORS +++ b/open-vm-tools/AUTHORS @@ -88,3 +88,6 @@ Bernd Zeimetz Fix building containerinfo plugin on i386 Dirk Mueller Detect the proto files for containerd grpc client on SUSE like systems - https://github.com/vmware/open-vm-tools/pull/626 + +Jan Engelhardt Fix build problems with grpc (at least) 1.54 + - https://github.com/vmware/open-vm-tools/pull/664 diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index d45fabfa8..b39422b4b 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -720,7 +720,7 @@ AC_DEFUN([AC_VMW_CONTAINERINFO_MSG],[ [1.3.2], [grpc++/grpc++.h], [], - [], + [PKG_CHECK_MODULES([grpcxx], [grpc++ >= 1.3.2])], [AC_VMW_CONTAINERINFO_MSG(["grpc++ >= 1.3.2"])]) # diff --git a/open-vm-tools/libDeployPkg/Makefile.am b/open-vm-tools/libDeployPkg/Makefile.am index 8a3343ca6..570087f18 100644 --- a/open-vm-tools/libDeployPkg/Makefile.am +++ b/open-vm-tools/libDeployPkg/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2014-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2014-2023 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 @@ -36,10 +36,9 @@ libDeployPkg_la_SOURCES += processPosix.c libDeployPkg_la_SOURCES += linuxDeploymentUtilities.c libDeployPkg_la_SOURCES += linuxDeploymentUtilities.h -libDeployPkg_la_LDFLAGS = # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libDeployPkg_la_LDFLAGS += -Wl,-lc +libDeployPkg_la_LIBADD += -lc libDeployPkg_includedir = $(includedir)/libDeployPkg diff --git a/open-vm-tools/libappmonitor/Makefile.am b/open-vm-tools/libappmonitor/Makefile.am index 2681eb793..ba587b153 100644 --- a/open-vm-tools/libappmonitor/Makefile.am +++ b/open-vm-tools/libappmonitor/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2018 VMware, Inc. All rights reserved. +### Copyright (C) 2018, 2023 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 @@ -48,12 +48,10 @@ libappmonitor_la_SOURCES += $(libappmonitor_rpcchanneldir)/vsockChannel.c libappmonitor_la_SOURCES += $(libappmonitor_rpcchanneldir)/simpleSocket.c endif -libappmonitor_la_LDFLAGS = -libappmonitor_la_LDFLAGS += -Wl,-ldl -libappmonitor_la_LDFLAGS += -Wl,-lrt +libappmonitor_la_LIBADD += -ldl -lrt # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libappmonitor_la_LDFLAGS += -Wl,-lc +libappmonitor_la_LIBADD += -lc libappmonitor_includedir = $(includedir)/libappmonitor diff --git a/open-vm-tools/libguestStoreClient/Makefile.am b/open-vm-tools/libguestStoreClient/Makefile.am index adf69309a..58c5420b7 100644 --- a/open-vm-tools/libguestStoreClient/Makefile.am +++ b/open-vm-tools/libguestStoreClient/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2020 VMware, Inc. All rights reserved. +### Copyright (c) 2020, 2023 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 @@ -33,4 +33,4 @@ libguestStoreClient_la_LDFLAGS = libguestStoreClient_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libguestStoreClient_la_LDFLAGS += -Wl,-lc +libguestStoreClient_la_LIBADD += -lc diff --git a/open-vm-tools/libguestlib/Makefile.am b/open-vm-tools/libguestlib/Makefile.am index d2cfb80a5..1902b0f08 100644 --- a/open-vm-tools/libguestlib/Makefile.am +++ b/open-vm-tools/libguestlib/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2007-2018,2020 VMware, Inc. All rights reserved. +### Copyright (C) 2007-2018,2020,2023 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 @@ -50,12 +50,10 @@ libguestlib_la_SOURCES += $(libguestlib_rpcchanneldir)/vsockChannel.c libguestlib_la_SOURCES += $(libguestlib_rpcchanneldir)/simpleSocket.c endif -libguestlib_la_LDFLAGS = -libguestlib_la_LDFLAGS += -Wl,-ldl -libguestlib_la_LDFLAGS += -Wl,-lrt +libguestlib_la_LIBADD += -ldl -lrt # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libguestlib_la_LDFLAGS += -Wl,-lc +libguestlib_la_LIBADD += -lc libguestlib_includedir = $(includedir)/vmGuestLib diff --git a/open-vm-tools/libhgfs/Makefile.am b/open-vm-tools/libhgfs/Makefile.am index 760914525..cb1098cfb 100644 --- a/open-vm-tools/libhgfs/Makefile.am +++ b/open-vm-tools/libhgfs/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2010-2016 VMware, Inc. All rights reserved. +### Copyright (C) 2010-2016,2023 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 @@ -41,5 +41,5 @@ libhgfs_la_LDFLAGS = libhgfs_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libhgfs_la_LDFLAGS += -Wl,-lc +libhgfs_la_LIBADD += -lc diff --git a/open-vm-tools/libvmtools/Makefile.am b/open-vm-tools/libvmtools/Makefile.am index 6da973622..3e0ea0f32 100644 --- a/open-vm-tools/libvmtools/Makefile.am +++ b/open-vm-tools/libvmtools/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2008-2021 VMware, Inc. All rights reserved. +### Copyright (c) 2008-2021,2023 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 @@ -89,5 +89,5 @@ libvmtools_la_LDFLAGS = libvmtools_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvmtools_la_LDFLAGS += -Wl,-lc +libvmtools_la_LIBADD += -lc diff --git a/open-vm-tools/services/plugins/containerInfo/Makefile.am b/open-vm-tools/services/plugins/containerInfo/Makefile.am index 488e35aaa..04a338487 100644 --- a/open-vm-tools/services/plugins/containerInfo/Makefile.am +++ b/open-vm-tools/services/plugins/containerInfo/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2021-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2021-2023 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 @@ -36,7 +36,7 @@ libcontainerInfo_la_SOURCES += containerInfoInt.h libcontainerInfo_la_SOURCES += containerInfo.c libcontainerInfo_la_SOURCES += containerInfo_docker.c -libcontainerInfo_la_LDFLAGS += -lcurl +libcontainerInfo_la_LIBADD += -lcurl libcontainerInfo_la_CPPFLAGS += @CURL_CPPFLAGS@ libcontainerInfo_la_LIBADD += ../../../lib/jsmn/libJsmn.la @@ -60,9 +60,9 @@ libcontainerInfo_la_SOURCES += containers.grpc.pb.h libcontainerInfo_la_SOURCES += containers.grpc.pb.cc libcontainerInfo_la_SOURCES += containerInfo_grpc.cc -libcontainerInfo_la_CPPFLAGS += @GRPC_CPPFLAGS@ -libcontainerInfo_la_LDFLAGS += -lprotobuf -libcontainerInfo_la_LDFLAGS += -lgrpc++ +libcontainerInfo_la_CPPFLAGS += ${grpcxx_CFLAGS} +libcontainerInfo_la_LIBADD += -lprotobuf +libcontainerInfo_la_LIBADD += ${grpcxx_LIBS} tasks.grpc.pb.cc containers.grpc.pb.cc: %.grpc.pb.cc : %.proto %.pb.cc $(PROTOC) -I. -I$(GOGO_PROTOPATH) \ diff --git a/open-vm-tools/vgauth/lib/Makefile.am b/open-vm-tools/vgauth/lib/Makefile.am index bce97aacb..a039dcd1d 100644 --- a/open-vm-tools/vgauth/lib/Makefile.am +++ b/open-vm-tools/vgauth/lib/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2014-2016 VMware, Inc. All rights reserved. +### Copyright (C) 2014-2016,2023 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 @@ -59,7 +59,7 @@ libvgauth_la_LDFLAGS = libvgauth_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvgauth_la_LDFLAGS += -Wl,-lc +libvgauth_la_LIBADD += -lc # Message catalogs. install-data-hook: