configure.ac: Improve USB/EZUSB/serial checks.

- If libusb-1.0 is not found, do not compile in ezusb.c and usb.c since
   they require libusb.h. The respective hardware drivers that use
   libusb-1.0, and usb.c and/or ezusb.c will be excluded from the build
   elsewhere in configure.ac. Rename NEED_EZUSB to NEED_USB.

 - Drop the NEED_SERIAL check and always compile in serial.c. This is a
   very small chunk of code, it does not depend on any external
   libraries that might be missing, and it compiles on all architectures.
   Thus there's no need to conditionally include or exclude it.
This commit is contained in:
Uwe Hermann 2013-04-08 15:40:57 +02:00
parent ae4c3d0431
commit 3fd1d0ee1c
2 changed files with 7 additions and 27 deletions

View File

@ -235,6 +235,9 @@ case "$build" in
;;
esac
# USB + FX2 firmware helper code is only compiled in if libusb-1.0 was found.
AM_CONDITIONAL(NEED_USB, test "x$have_libusb1_0" != xno)
# libftdi is only needed for some hardware drivers. Disable them if not found.
PKG_CHECK_MODULES([libftdi], [libftdi >= 0.16],
[CFLAGS="$CFLAGS $libftdi_CFLAGS";
@ -260,23 +263,6 @@ PKG_CHECK_MODULES([check], [check >= 0.9.4],
LIBS="$LIBS $check_LIBS"], [have_check="no"])
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
# EZUSB FX2 firmware helper code is only needed for some hardware drivers.
AM_CONDITIONAL(NEED_EZUSB, \
test "x$LA_FX2LAFW" != xno \
-o "x$HW_HANTEK_DSO" != xno \
)
# Serial port helper code is only needed for some hardware drivers.
AM_CONDITIONAL(NEED_SERIAL, \
test "x$HW_AGILENT_DMM" != xno \
-o "x$HW_COLEAD_SLM" != xno \
-o "x$HW_FLUKE_DMM" != xno \
-o "x$LA_LINK_MSO19" != xno \
-o "x$LA_OLS" != xno \
-o "x$HW_SERIAL_DMM" != xno \
-o "x$HW_TONDAJ_SL_814" != xno \
)
AC_SUBST(SR_PKGLIBS)
# Now set AM_CONDITIONALs and AC_DEFINEs for the enabled/disabled drivers.

View File

@ -22,19 +22,13 @@ SUBDIRS = dmm
# Local lib, this is NOT meant to be installed!
noinst_LTLIBRARIES = libsigrokhwcommon.la
libsigrokhwcommon_la_SOURCES = usb.c
libsigrokhwcommon_la_SOURCES = serial.c
if NEED_EZUSB
libsigrokhwcommon_la_SOURCES += ezusb.c
if NEED_USB
libsigrokhwcommon_la_SOURCES += ezusb.c usb.c
endif
if NEED_SERIAL
libsigrokhwcommon_la_SOURCES += serial.c
endif
libsigrokhwcommon_la_LIBADD =
libsigrokhwcommon_la_LIBADD += dmm/libsigrok_hw_common_dmm.la
libsigrokhwcommon_la_LIBADD = dmm/libsigrok_hw_common_dmm.la
libsigrokhwcommon_la_CFLAGS = \
-I$(top_srcdir)