From 5e8cf7e339e42bdcf9772fd64b155a3e01ea8356 Mon Sep 17 00:00:00 2001 From: "J. Lewis Muir" Date: Sun, 26 Jan 2025 21:07:13 -0600 Subject: [PATCH] Add Linux support for external tirpc library Add support on Linux for using a tirpc library that is not a system library. --- asyn/Makefile | 11 ++++++++--- configure/CONFIG_SITE | 10 ++++++++-- testGpibApp/src/Makefile | 9 +++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/asyn/Makefile b/asyn/Makefile index 3f803f489..231380434 100644 --- a/asyn/Makefile +++ b/asyn/Makefile @@ -31,10 +31,15 @@ asyn_SYS_LIBS_WIN32 = ws2_32 winmm asyn_SYS_LIBS_cygwin32 = $(CYGWIN_RPC_LIB) # Some linux systems moved RPC related symbols to libtirpc -# Define TIRPC in configure/CONFIG_SITE in this case +# Set TIRPC* variables in configure/CONFIG_SITE in this case ifeq ($(TIRPC),YES) - USR_INCLUDES_Linux += -I/usr/include/tirpc - asyn_SYS_LIBS_Linux += tirpc + USR_INCLUDES_Linux += -I$(TIRPC_INCLUDE) + ifeq ($(TIRPC_EXTERNAL),YES) + tirpc_DIR = $(TIRPC_LIB) + asyn_LIBS_Linux += tirpc + else + asyn_SYS_LIBS_Linux += tirpc + endif endif SRC_DIRS += $(ASYN)/asynDriver diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 538cd55ce..754af8756 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -55,8 +55,14 @@ DRV_FTDI_USE_LIBFTDI1=NO #EPICS_LIBCOM_ONLY=YES # Some linux systems moved RPC related symbols to libtirpc -# To enable linking against this library, uncomment the following line -# TIRPC=YES +# To enable linking against this library, set TIRPC=YES +TIRPC=NO +# If TIRPC_EXTERNAL=NO, libtirpc is a system library; otherwise, it is not +TIRPC_EXTERNAL=NO +# Path to the include files for libtirpc +TIRPC_INCLUDE=/usr/include/tirpc +# If TIRPC_EXTERNAL=YES, path to the library files for libtirpc +TIRPC_LIB= -include $(SUPPORT)/configure/CONFIG_SITE diff --git a/testGpibApp/src/Makefile b/testGpibApp/src/Makefile index 20957003d..665321223 100644 --- a/testGpibApp/src/Makefile +++ b/testGpibApp/src/Makefile @@ -43,8 +43,13 @@ testGpibVx_SRCS_vxWorks += testGpibVx_registerRecordDeviceDriver.cpp testGpib_LIBS += devTestGpib testGpib_LIBS += testSupport asyn ifeq ($(TIRPC),YES) - USR_INCLUDES += -I/usr/include/tirpc - testGpib_SYS_LIBS += tirpc + USR_INCLUDES += -I$(TIRPC_INCLUDE) + ifeq ($(TIRPC_EXTERNAL),YES) + tirpc_DIR = $(TIRPC_LIB) + testGpib_LIBS += tirpc + else + testGpib_SYS_LIBS += tirpc + endif endif SYS_PROD_LIBS_cygwin32 += $(CYGWIN_RPC_LIB) testGpib_LIBS += $(EPICS_BASE_IOC_LIBS)