Skip to content

Commit 6307599

Browse files
committed
Add support for non-system usb library on Linux
1 parent 7b54f98 commit 6307599

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

configure/CONFIG_SITE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ HAVE_ULDAQ=YES
4141
#ULDAQ_DIR=/home/epics/local/lib
4242
#ULDAQ_INCLUDE=/home/epics/local/include
4343

44+
# If libusb on Linux is not installed in a system directory (e.g. /usr/local)
45+
# then uncomment and edit these lines to define the location of the include
46+
# and lib directories.
47+
#USB_DIR=/home/epics/local/lib
48+
#USB_INCLUDE=/home/epics/local/include
49+
4450
# These allow developers to override the CONFIG_SITE variable
4551
# settings without having to modify the configure/CONFIG_SITE
4652
# file itself.

measCompApp/src/Makefile

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ USR_CXXFLAGS_Linux += -Wno-write-strings
1212
ifdef ULDAQ_INCLUDE
1313
USR_INCLUDES_Linux += -I$(ULDAQ_INCLUDE)
1414
endif
15+
ifdef USB_INCLUDE
16+
USR_INCLUDES_Linux += -I$(USB_INCLUDE)
17+
endif
1518

1619
ifdef ULDAQ_DIR
1720
uldaq_DIR = $(ULDAQ_DIR)
1821
endif
22+
ifdef USB_DIR
23+
usb-1.0_DIR = $(USB_DIR)
24+
endif
1925

2026
DBD += measCompApp.dbd
2127
DBD += measCompSupport.dbd
@@ -72,7 +78,11 @@ ifdef ULDAQ_DIR
7278
else
7379
measCompApp_SYS_LIBS_Linux += uldaq
7480
endif
75-
measCompApp_SYS_LIBS_Linux += usb-1.0
81+
ifdef USB_DIR
82+
measCompApp_LIBS_Linux += usb-1.0
83+
else
84+
measCompApp_SYS_LIBS_Linux += usb-1.0
85+
endif
7686

7787
# Finally link to the EPICS Base libraries
7888
measCompApp_LIBS += $(EPICS_BASE_IOC_LIBS)
@@ -113,7 +123,11 @@ ifdef ULDAQ_DIR
113123
else
114124
test_measCompDiscover_SYS_LIBS_Linux += uldaq
115125
endif
116-
test_measCompDiscover_SYS_LIBS_Linux += usb-1.0
126+
ifdef USB_DIR
127+
test_measCompDiscover_LIBS_Linux += usb-1.0
128+
else
129+
test_measCompDiscover_SYS_LIBS_Linux += usb-1.0
130+
endif
117131
test_measCompDiscover_LIBS += $(EPICS_BASE_IOC_LIBS)
118132

119133
# These are test programs which were used when finding Ubuntu18 had problems with scans > 1000 points/s
@@ -123,15 +137,23 @@ test_measCompDiscover_LIBS += $(EPICS_BASE_IOC_LIBS)
123137
#else
124138
# test_AInScan_Linux_SYS_LIBS += uldaq
125139
#endif
126-
#test_AInScan_Linux_SYS_LIBS += usb-1.0
140+
#ifdef USB_DIR
141+
# test_AInScan_Linux_LIBS += usb-1.0
142+
#else
143+
# test_AInScan_Linux_SYS_LIBS += usb-1.0
144+
#endif
127145

128146
#PROD_IOC_Linux += test_USB_CTR
129147
#ifdef ULDAQ_DIR
130148
# test_USB_CTR_LIBS_Linux += uldaq
131149
#else
132150
# test_USB_CTR_SYS_LIBS_Linux += uldaq
133151
#endif
134-
#test_USB_CTR_SYS_LIBS_Linux += usb-1.0
152+
#ifdef USB_DIR
153+
# test_USB_CTR_LIBS_Linux += usb-1.0
154+
#else
155+
# test_USB_CTR_SYS_LIBS_Linux += usb-1.0
156+
#endif
135157
#PROD_IOC_WIN32 += test_USB_CTR
136158
#test_USB_CTR_LIBS_WIN32 += cbw64
137159

@@ -142,7 +164,11 @@ test_measCompDiscover_LIBS += $(EPICS_BASE_IOC_LIBS)
142164
#else
143165
# DaqInScan_SYS_LIBS_Linux += uldaq
144166
#endif
145-
#DaqInScan_SYS_LIBS_Linux += usb-1.0
167+
#ifdef USB_DIR
168+
# DaqInScan_LIBS_Linux += usb-1.0
169+
#else
170+
# DaqInScan_SYS_LIBS_Linux += usb-1.0
171+
#endif
146172

147173
# This test program shows temperature glitches on Linux with USB-2408 and data rate <= 20 Hz.
148174
#PROD_IOC_Linux += 2408_TIn
@@ -152,15 +178,23 @@ test_measCompDiscover_LIBS += $(EPICS_BASE_IOC_LIBS)
152178
#else
153179
# 2408_TIn_SYS_LIBS_Linux += uldaq
154180
#endif
155-
#2408_TIn_SYS_LIBS_Linux += usb-1.0
181+
#ifdef USB_DIR
182+
# 2408_TIn_LIBS_Linux += usb-1.0
183+
#else
184+
# 2408_TIn_SYS_LIBS_Linux += usb-1.0
185+
#endif
156186

157187
#PROD_IOC_Linux += test_USB_CTR_fdiv
158188
#ifdef ULDAQ_DIR
159189
# test_USB_CTR_fdiv_LIBS_Linux += uldaq
160190
#else
161191
# test_USB_CTR_fdiv_SYS_LIBS_Linux += uldaq
162192
#endif
163-
#test_USB_CTR_fdiv_SYS_LIBS_Linux += usb-1.0
193+
#ifdef USB_DIR
194+
# test_USB_CTR_fdiv_LIBS_Linux += usb-1.0
195+
#else
196+
# test_USB_CTR_fdiv_SYS_LIBS_Linux += usb-1.0
197+
#endif
164198
#PROD_IOC_WIN32 += test_USB_CTR_fdiv
165199
#test_USB_CTR_fdiv_LIBS_WIN32 += cbw64
166200

@@ -173,7 +207,12 @@ ifdef ULDAQ_DIR
173207
else
174208
testDualEthDevice_SYS_LIBS_Linux += uldaq
175209
endif
176-
testDualEthDevice_SYS_LIBS_Linux += usb-1.0 pthread
210+
ifdef USB_DIR
211+
testDualEthDevice_LIBS_Linux += usb-1.0
212+
else
213+
testDualEthDevice_SYS_LIBS_Linux += usb-1.0
214+
endif
215+
testDualEthDevice_SYS_LIBS_Linux += pthread
177216
#=============================
178217

179218
include $(TOP)/configure/RULES

0 commit comments

Comments
 (0)