Skip to content

Commit

Permalink
Modbus: Added to unix build
Browse files Browse the repository at this point in the history
git-svn-id: https://valelab.ucsf.edu/svn/micromanager2/trunk@16429 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd
  • Loading branch information
nico committed Jul 8, 2017
1 parent 18eb395 commit b8d30ab
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DeviceAdapters/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ endif
if BUILD_ITC
ITC = ITC18
endif
if BUILD_MODBUS
MODBUS = Modbus
endif
if BUILD_OPENCV
OPENCVGRABBER = OpenCVgrabber
endif
Expand Down Expand Up @@ -69,6 +72,7 @@ SUBDIRS = \
$(ITC) \
$(NIDAQ) \
$(OPENCVGRABBER) \
$(MODBUS) \
$(PVCAM) \
$(QCAM) \
$(SCION) \
Expand Down
23 changes: 23 additions & 0 deletions DeviceAdapters/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ AS_IF([test "x$want_hidapi" != xno],
AM_CONDITIONAL([BUILD_HID], [test "x$use_hidapi" = xyes])


# Check for libmodbus
MM_ARG_WITH_OPTIONAL_LIB([libmodbus], [modbus], [MODBUS])
AS_IF([test "x$want_modbus" != xno],
[
MM_LIB_MODBUS([$MODBUS_PREFIX],
[
use_modbus=yes
],
[
use_modbus=no
AS_IF([test "x$want_modbus" = xyes],
[MM_MSG_OPTIONAL_LIB_FAILURE([libmodbus], [modbus])])
])
],
[use_modbus=no])

AM_CONDITIONAL([BUILD_MODBUS], [test "x$use_modbus" = xyes])


# Only build PVCAM if header files present.
AC_MSG_CHECKING(for Pvcam)
for dir in /usr/include/pvcam /Library/Frameworks/PVCAM.framework/Headers
Expand Down Expand Up @@ -441,6 +460,7 @@ m4_define([device_adapter_dirs], [m4_strip([
Marzhauser-LStep
MarzhauserLStepOld
MicroPoint
MODBUS
Motic_mac
Neos
NewportCONEX
Expand Down Expand Up @@ -526,6 +546,9 @@ echo "m4_text_wrap([$use_freeimageplus],
echo "m4_text_wrap([$use_hidapi],
[ ],
[ Build with HIDAPI: ])"
echo "m4_text_wrap([$use_modbus],
[ ],
[ Build with Modbus: ])"
echo "m4_text_wrap([$use_libdc1394],
[ ],
[ Build with libdc1394: ])"
Expand Down
12 changes: 12 additions & 0 deletions m4/mm_libs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ AC_DEFUN([MM_LIB_GPHOTO2], [
[$2], [$3])
])

# Check for Modbus library
#
# MM_LIB_MODBUS([MODBUS prefix], [action-if-found], [action-if-not-found])
#
# Defines precious variables MODBUS_CPPFLAGS, MODBUS_CFLAGS, MODBUS_LDFLAGS,
# MODBUS_LIS.
AC_DEFUN([MM_LIB_MODBUS], [
MM_LIB_WITH_PKG_CONFIG([MODBUS], [libmodbus], [libmodbus >= 3.1.4], [],
[$1], [-lmodbus], [modbus/modbus.h], [modbus_connect],
[$2], [$3])
])


# Check for HIDAPI library
#
Expand Down

0 comments on commit b8d30ab

Please sign in to comment.