From: Uwe Hermann Date: Mon, 8 Apr 2013 13:40:57 +0000 (+0200) Subject: configure.ac: Improve USB/EZUSB/serial checks. X-Git-Tag: dsupstream~227 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3fd1d0ee1c6e8f9d1c6e30c16add1cc4253662bb;p=libsigrok.git 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. --- diff --git a/configure.ac b/configure.ac index aff5f4cd..8e48861b 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/hardware/common/Makefile.am b/hardware/common/Makefile.am index 30843064..874b9e1b 100644 --- a/hardware/common/Makefile.am +++ b/hardware/common/Makefile.am @@ -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)