]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix build problems with grpc
authorKaty Feng <fkaty@vmware.com>
Tue, 22 Aug 2023 22:51:19 +0000 (15:51 -0700)
committerKaty Feng <fkaty@vmware.com>
Tue, 22 Aug 2023 22:51:19 +0000 (15:51 -0700)
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

open-vm-tools/AUTHORS
open-vm-tools/configure.ac
open-vm-tools/libDeployPkg/Makefile.am
open-vm-tools/libappmonitor/Makefile.am
open-vm-tools/libguestStoreClient/Makefile.am
open-vm-tools/libguestlib/Makefile.am
open-vm-tools/libhgfs/Makefile.am
open-vm-tools/libvmtools/Makefile.am
open-vm-tools/services/plugins/containerInfo/Makefile.am
open-vm-tools/vgauth/lib/Makefile.am

index ac5fd878e72c75656efa5b7f85cd1dc5b8260551..156f5cc2eb378afee29004b0e587e2cc789367e3 100644 (file)
@@ -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
index d45fabfa8c85f43fd58b95d3d56d0b61934439f6..b39422b4b510e46bc9a67a5a9f2967a9f5e42f4a 100644 (file)
@@ -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"])])
 
 #
index 8a3343ca64173317de0921576e45e02ba1abcb55..570087f188968d31ae15c822a19e29c99991ad2d 100644 (file)
@@ -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
 
index 2681eb793d27d4dd1ad1c0c9e91d26fe6a13d399..ba587b1538a262d8fb01530f25e1066efa360c16 100644 (file)
@@ -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
 
index adf69309a46938cd1f857ca7b47703c285878e29..58c5420b76d2663b24ca00a07f98ecabd878f22a 100644 (file)
@@ -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
index d2cfb80a5588c9c4566cccf448c14065095a8086..1902b0f08406e519b46cd14031680cdeac6faa7b 100644 (file)
@@ -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
 
index 760914525dab33e00a9b4cb66b17d530dbf538df..cb1098cfbcd18fe90060e9e924f857034b951847 100644 (file)
@@ -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
 
index 6da9736227e6d14422d4433119a843adfc4dac5b..3e0ea0f32f5b9b32704338f0640325747689824c 100644 (file)
@@ -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
 
index 488e35aaa8edbce158e6f5b7d2feb5628648766f..04a338487ddacd4dbeee2b9b13945ea12ef6b15b 100644 (file)
@@ -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) \
index bce97aacbdee7cc1302445cbbedcb9fd852ae133..a039dcd1d875891357449c1327fb9f1548545d92 100644 (file)
@@ -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: