Thanks Mark and Ralph.
This line is all that is needed:
ethercatmc_SYS_LIBS +=
Vendor
/Torsten
From: Mark Rivers <rivers at cars.uchicago.edu>
Date: Tuesday, 13 June 2023 at 15:03
To: Torsten Bögershausen <Torsten.Bogershausen at ess.eu>, Ralph Lange <ralph.lange at gmx.de>
Cc: EPICS Core Talk <core-talk at aps.anl.gov>
Subject: Re: STATIC_BUILD=NO howto ?
-
Btw. I should have mentioned before: You only need to add the *_DIR line if the library is not in one of the system paths. Libraries in system paths
are always found - adding them to *_LIBS is enough.
Actually if the library is in the system path then it needs to be added to SYS_LIBS, not _LIBS.
This is an example of a Makefile that allows the vendor library to either be in a system location or in a user-defined location. The latter might be used when
the developer does not have permission to install the vendor library into a system location, or wants to test a newer version than the one in the system location:
CONFIG_SITE contains these lines:
#################################
# Set this if the Measurement Computing uldaq library is installed on Linux.
# If this is not YES then this module will not be built on Linux.
# If libuldaq on Linux is not installed in a system directory (e.g. /usr/local)
# then uncomment and edit these lines to define the location of the include and lib directories.
#ULDAQ_DIR=/home/epics/local/lib
#ULDAQ_INCLUDE=/home/epics/local/include
#################################
The Makefile contains these lines:
#################################
ifdef ULDAQ_INCLUDE
USR_INCLUDES_Linux += -I$(ULDAQ_INCLUDE)
ifeq ($(HAVE_ULDAQ), YES)
LIBRARY_IOC_Linux+= measComp
measCompApp_LIBS_Linux += uldaq
measCompApp_SYS_LIBS_Linux += uldaq
measCompApp_SYS_LIBS_Linux += usb-1.0
#################################
So if ULDAQ_DIR is defined then it adds uldaq to LIBS. If ULDAQ_DIR is not defined then it adds uldaq to SYS_LIBS.
It handles Linux and Windows separately because the vendor provides a pre-built library for Windows which I include in the EPICS module, but they provide source
code on Linux which needs to be built locally. That can be installed into a system directory or not depending on developer privileges.
From: Core-talk <core-talk-bounces at aps.anl.gov> on behalf of Ralph Lange via Core-talk <core-talk at aps.anl.gov>
Sent: Tuesday, June 13, 2023 7:25 AM
To: Torsten Bögershausen <Torsten.Bogershausen at ess.eu>
Cc: EPICS Core Talk <core-talk at aps.anl.gov>
Subject: Re: STATIC_BUILD=NO howto ?
In that Makefile, the PROD is "ethercatmc", not "ethercatmcsupport".
ethercatmc_LIBS += Vendor
Vendor_DIR = /usr/local/lib
should construct the linker line as you expect.
Btw. I should have mentioned before: You only need to add the *_DIR line if the library is not in one of the system paths. Libraries in system paths are always found - adding them to *_LIBS is enough.