]> sigrok.org Git - libsigrok.git/commitdiff
configure.ac: Fix the order of some entries.
authorUwe Hermann <redacted>
Tue, 9 Apr 2013 10:32:30 +0000 (12:32 +0200)
committerUwe Hermann <redacted>
Tue, 9 Apr 2013 15:49:13 +0000 (17:49 +0200)
In order for lib autodetection and disabling of drivers (which require
libs that cannot be found) to work, the order of AC_ARG_ENABLEs,
AM_CONDITIONALs, and AC_DEFINEs needs to be changed.

All drivers start out enabled or disabled (depending on whether
the --disable-drivers option was supplied or not). Then, any driver can
be enabled or disabled explicitly via --enable-<drivername> or the
resp. --disable-<drivername> option. Finally, pkg-config checks for all
libraries are performed, and all drivers which require a library that
cannot be found are disabled explicitly (regardless of any
--enable-<drivername> option that might have been supplied).

configure.ac

index 3db681c3b31ff0da2ebf5058b81867308104f9bb..aff5f4cda3aaa25d92fb565ae6158df3ea232c68 100644 (file)
@@ -88,191 +88,107 @@ AC_ARG_ENABLE(agilent-dmm, AC_HELP_STRING([--enable-agilent-dmm],
        [enable Agilent DMM support [default=yes]]),
        [HW_AGILENT_DMM="$enableval"],
        [HW_AGILENT_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_AGILENT_DMM, test x$HW_AGILENT_DMM = xyes)
-if test "x$HW_AGILENT_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_AGILENT_DMM, 1, [Agilent DMM support])
-fi
 
 AC_ARG_ENABLE(alsa, AC_HELP_STRING([--enable-alsa],
        [enable ALSA driver support [default=yes]]),
        [HW_ALSA="$enableval"],
        [HW_ALSA=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_ALSA, test x$HW_ALSA = xyes)
-if test "x$HW_ALSA" = "xyes"; then
-       AC_DEFINE(HAVE_HW_ALSA, 1, [ALSA driver support])
-fi
 
 AC_ARG_ENABLE(asix-sigma, AC_HELP_STRING([--enable-asix-sigma],
        [enable ASIX SIGMA/SIGMA2 support [default=yes]]),
        [LA_ASIX_SIGMA="$enableval"],
        [LA_ASIX_SIGMA=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_ASIX_SIGMA, test x$LA_ASIX_SIGMA = xyes)
-if test "x$LA_ASIX_SIGMA" = "xyes"; then
-       AC_DEFINE(HAVE_LA_ASIX_SIGMA, 1, [ASIX SIGMA/SIGMA2 support])
-fi
 
 AC_ARG_ENABLE(brymen-dmm, AC_HELP_STRING([--enable-brymen-dmm],
        [enable Brymen DMM support [default=yes]]),
        [HW_BRYMEN_DMM="$enableval"],
        [HW_BRYMEN_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_BRYMEN_DMM, test x$HW_BRYMEN_DMM = xyes)
-if test "x$HW_BRYMEN_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_BRYMEN_DMM, 1, [brymen-dmm support])
-fi
 
 AC_ARG_ENABLE(chronovu-la8, AC_HELP_STRING([--enable-chronovu-la8],
        [enable ChronoVu LA8 support [default=yes]]),
        [LA_CHRONOVU_LA8="$enableval"],
        [LA_CHRONOVU_LA8=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_CHRONOVU_LA8, test x$LA_CHRONOVU_LA8 = xyes)
-if test "x$LA_CHRONOVU_LA8" = "xyes"; then
-       AC_DEFINE(HAVE_LA_CHRONOVU_LA8, 1, [ChronoVu LA8 support])
-fi
 
 AC_ARG_ENABLE(colead-slm, AC_HELP_STRING([--enable-colead-slm],
        [enable Colead SLM support [default=yes]]),
        [HW_COLEAD_SLM="$enableval"],
        [HW_COLEAD_SLM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_COLEAD_SLM, test x$HW_COLEAD_SLM = xyes)
-if test "x$HW_COLEAD_SLM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_COLEAD_SLM, 1, [Colead SLM support])
-fi
 
 AC_ARG_ENABLE(demo, AC_HELP_STRING([--enable-demo],
        [enable demo driver support [default=yes]]),
        [LA_DEMO="$enableval"],
        [LA_DEMO=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_DEMO, test x$LA_DEMO = xyes)
-if test "x$LA_DEMO" = "xyes"; then
-       AC_DEFINE(HAVE_LA_DEMO, 1, [Demo driver support])
-fi
 
 AC_ARG_ENABLE(fluke-dmm, AC_HELP_STRING([--enable-fluke-dmm],
        [enable Fluke DMM support [default=yes]]),
        [HW_FLUKE_DMM="$enableval"],
        [HW_FLUKE_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_FLUKE_DMM, test x$HW_FLUKE_DMM = xyes)
-if test "x$HW_FLUKE_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_FLUKE_DMM, 1, [Fluke DMM support])
-fi
 
 AC_ARG_ENABLE(fx2lafw, AC_HELP_STRING([--enable-fx2lafw],
        [enable fx2lafw support (for FX2 LAs). [default=yes]]),
        [LA_FX2LAFW="$enableval"],
        [LA_FX2LAFW=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_FX2LAFW, test x$LA_FX2LAFW = xyes)
-if test "x$LA_FX2LAFW" = "xyes"; then
-       AC_DEFINE(HAVE_LA_FX2LAFW, 1, [fx2lafw support])
-fi
 
 AC_ARG_ENABLE(hantek-dso, AC_HELP_STRING([--enable-hantek-dso],
        [enable Hantek DSO support [default=yes]]),
        [HW_HANTEK_DSO="$enableval"],
        [HW_HANTEK_DSO=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_HANTEK_DSO, test x$HW_HANTEK_DSO = xyes)
-if test "x$HW_HANTEK_DSO" = "xyes"; then
-       AC_DEFINE(HAVE_HW_HANTEK_DSO, 1, [Hantek DSO support])
-fi
 
 AC_ARG_ENABLE(lascar-el-usb, AC_HELP_STRING([--enable-lascar-el-usb],
        [enable Lascar EL-USB support [default=yes]]),
        [HW_LASCAR_EL_USB="$enableval"],
        [HW_LASCAR_EL_USB=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_LASCAR_EL_USB, test x$HW_LASCAR_EL_USB = xyes)
-if test "x$HW_LASCAR_EL_USB" = "xyes"; then
-       AC_DEFINE(HAVE_HW_LASCAR_EL_USB, 1, [Lascar EL-USB support])
-fi
 
 AC_ARG_ENABLE(link-mso19, AC_HELP_STRING([--enable-link-mso19],
        [enable Link Instruments MSO-19 support [default=yes]]),
        [LA_LINK_MSO19="$enableval"],
        [LA_LINK_MSO19=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_LINK_MSO19, test x$LA_LINK_MSO19 = xyes)
-if test "x$LA_LINK_MSO19" = "xyes"; then
-       AC_DEFINE(HAVE_LA_LINK_MSO19, 1, [Link Instruments MSO-19 support])
-fi
 
 AC_ARG_ENABLE(mic-985xx, AC_HELP_STRING([--enable-mic-985xx],
        [enable MIC 985xx support [default=yes]]),
        [HW_MIC_985XX="$enableval"],
        [HW_MIC_985XX=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_MIC_985XX, test x$HW_MIC_985XX = xyes)
-if test "x$HW_MIC_985XX" = "xyes"; then
-       AC_DEFINE(HAVE_HW_MIC_985XX, 1, [MIC 985xx support])
-fi
 
 AC_ARG_ENABLE(nexus-osciprime, AC_HELP_STRING([--enable-nexus-osciprime],
        [enable Nexus Osciprime support [default=yes]]),
        [HW_NEXUS_OSCIPRIME="$enableval"],
        [HW_NEXUS_OSCIPRIME=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_NEXUS_OSCIPRIME, test x$HW_NEXUS_OSCIPRIME = xyes)
-if test "x$HW_NEXUS_OSCIPRIME" = "xyes"; then
-       AC_DEFINE(HAVE_HW_NEXUS_OSCIPRIME, 1, [Nexus Osciprime support])
-fi
 
 AC_ARG_ENABLE(ols, AC_HELP_STRING([--enable-ols],
        [enable OpenBench Logic Sniffer (OLS) support [default=yes]]),
        [LA_OLS="$enableval"],
        [LA_OLS=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_OLS, test x$LA_OLS = xyes)
-if test "x$LA_OLS" = "xyes"; then
-       AC_DEFINE(HAVE_LA_OLS, 1, [OpenBench Logic Sniffer (OLS) support])
-fi
 
 AC_ARG_ENABLE(rigol-ds1xx2, AC_HELP_STRING([--enable-rigol-ds1xx2],
        [enable Rigol DS1xx2 support [default=yes]]),
        [HW_RIGOL_DS1XX2="$enableval"],
        [HW_RIGOL_DS1XX2=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_RIGOL_DS1XX2, test x$HW_RIGOL_DS1XX2 = xyes)
-if test "x$HW_RIGOL_DS1XX2" = "xyes"; then
-       AC_DEFINE(HAVE_HW_RIGOL_DS1XX2, 1, [Rigol DS1xx2 support])
-fi
 
 AC_ARG_ENABLE(serial-dmm, AC_HELP_STRING([--enable-serial-dmm],
        [enable serial DMM support [default=yes]]),
        [HW_SERIAL_DMM="$enableval"],
        [HW_SERIAL_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_SERIAL_DMM, test x$HW_SERIAL_DMM = xyes)
-if test "x$HW_SERIAL_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_SERIAL_DMM, 1, [Serial DMM support])
-fi
 
 AC_ARG_ENABLE(tondaj-sl-814, AC_HELP_STRING([--enable-tondaj-sl-814],
        [enable Tondaj SL-814 support [default=yes]]),
        [HW_TONDAJ_SL_814="$enableval"],
        [HW_TONDAJ_SL_814=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_TONDAJ_SL_814, test x$HW_TONDAJ_SL_814 = xyes)
-if test "x$HW_TONDAJ_SL_814" = "xyes"; then
-       AC_DEFINE(HAVE_HW_TONDAJ_SL_814, 1, [Tondaj SL-814 support])
-fi
 
 AC_ARG_ENABLE(uni-t-dmm, AC_HELP_STRING([--enable-uni-t-dmm],
        [enable UNI-T DMM support [default=yes]]),
        [HW_UNI_T_DMM="$enableval"],
        [HW_UNI_T_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_UNI_T_DMM, test x$HW_UNI_T_DMM = xyes)
-if test "x$HW_UNI_T_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_UNI_T_DMM, 1, [UNI-T DMM support])
-fi
 
 AC_ARG_ENABLE(victor-dmm, AC_HELP_STRING([--enable-victor-dmm],
        [enable victor-dmm support [default=yes]]),
        [HW_VICTOR_DMM="$enableval"],
        [HW_VICTOR_DMM=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_VICTOR_DMM, test x$HW_VICTOR_DMM = xyes)
-if test "x$HW_VICTOR_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_VICTOR_DMM, 1, [victor-dmm support])
-fi
 
 AC_ARG_ENABLE(zeroplus-logic-cube,
        AC_HELP_STRING([--enable-zeroplus-logic-cube],
        [enable ZEROPLUS Logic Cube support [default=yes]]),
        [LA_ZEROPLUS_LOGIC_CUBE="$enableval"],
        [LA_ZEROPLUS_LOGIC_CUBE=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(LA_ZEROPLUS_LOGIC_CUBE, test x$LA_ZEROPLUS_LOGIC_CUBE = xyes)
-if test "x$LA_ZEROPLUS_LOGIC_CUBE" = "xyes"; then
-       AC_DEFINE(HAVE_LA_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support])
-fi
 
 # Checks for libraries.
 
@@ -363,6 +279,113 @@ AM_CONDITIONAL(NEED_SERIAL, \
 
 AC_SUBST(SR_PKGLIBS)
 
+# Now set AM_CONDITIONALs and AC_DEFINEs for the enabled/disabled drivers.
+
+AM_CONDITIONAL(HW_AGILENT_DMM, test x$HW_AGILENT_DMM = xyes)
+if test "x$HW_AGILENT_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_AGILENT_DMM, 1, [Agilent DMM support])
+fi
+
+AM_CONDITIONAL(HW_ALSA, test x$HW_ALSA = xyes)
+if test "x$HW_ALSA" = "xyes"; then
+       AC_DEFINE(HAVE_HW_ALSA, 1, [ALSA driver support])
+fi
+
+AM_CONDITIONAL(LA_ASIX_SIGMA, test x$LA_ASIX_SIGMA = xyes)
+if test "x$LA_ASIX_SIGMA" = "xyes"; then
+       AC_DEFINE(HAVE_LA_ASIX_SIGMA, 1, [ASIX SIGMA/SIGMA2 support])
+fi
+
+AM_CONDITIONAL(HW_BRYMEN_DMM, test x$HW_BRYMEN_DMM = xyes)
+if test "x$HW_BRYMEN_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_BRYMEN_DMM, 1, [brymen-dmm support])
+fi
+
+AM_CONDITIONAL(LA_CHRONOVU_LA8, test x$LA_CHRONOVU_LA8 = xyes)
+if test "x$LA_CHRONOVU_LA8" = "xyes"; then
+       AC_DEFINE(HAVE_LA_CHRONOVU_LA8, 1, [ChronoVu LA8 support])
+fi
+
+AM_CONDITIONAL(HW_COLEAD_SLM, test x$HW_COLEAD_SLM = xyes)
+if test "x$HW_COLEAD_SLM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_COLEAD_SLM, 1, [Colead SLM support])
+fi
+
+AM_CONDITIONAL(LA_DEMO, test x$LA_DEMO = xyes)
+if test "x$LA_DEMO" = "xyes"; then
+       AC_DEFINE(HAVE_LA_DEMO, 1, [Demo driver support])
+fi
+
+AM_CONDITIONAL(HW_FLUKE_DMM, test x$HW_FLUKE_DMM = xyes)
+if test "x$HW_FLUKE_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_FLUKE_DMM, 1, [Fluke DMM support])
+fi
+
+AM_CONDITIONAL(LA_FX2LAFW, test x$LA_FX2LAFW = xyes)
+if test "x$LA_FX2LAFW" = "xyes"; then
+       AC_DEFINE(HAVE_LA_FX2LAFW, 1, [fx2lafw support])
+fi
+
+AM_CONDITIONAL(HW_HANTEK_DSO, test x$HW_HANTEK_DSO = xyes)
+if test "x$HW_HANTEK_DSO" = "xyes"; then
+       AC_DEFINE(HAVE_HW_HANTEK_DSO, 1, [Hantek DSO support])
+fi
+
+AM_CONDITIONAL(HW_LASCAR_EL_USB, test x$HW_LASCAR_EL_USB = xyes)
+if test "x$HW_LASCAR_EL_USB" = "xyes"; then
+       AC_DEFINE(HAVE_HW_LASCAR_EL_USB, 1, [Lascar EL-USB support])
+fi
+
+AM_CONDITIONAL(LA_LINK_MSO19, test x$LA_LINK_MSO19 = xyes)
+if test "x$LA_LINK_MSO19" = "xyes"; then
+       AC_DEFINE(HAVE_LA_LINK_MSO19, 1, [Link Instruments MSO-19 support])
+fi
+
+AM_CONDITIONAL(HW_MIC_985XX, test x$HW_MIC_985XX = xyes)
+if test "x$HW_MIC_985XX" = "xyes"; then
+       AC_DEFINE(HAVE_HW_MIC_985XX, 1, [MIC 985xx support])
+fi
+
+AM_CONDITIONAL(HW_NEXUS_OSCIPRIME, test x$HW_NEXUS_OSCIPRIME = xyes)
+if test "x$HW_NEXUS_OSCIPRIME" = "xyes"; then
+       AC_DEFINE(HAVE_HW_NEXUS_OSCIPRIME, 1, [Nexus Osciprime support])
+fi
+
+AM_CONDITIONAL(LA_OLS, test x$LA_OLS = xyes)
+if test "x$LA_OLS" = "xyes"; then
+       AC_DEFINE(HAVE_LA_OLS, 1, [OpenBench Logic Sniffer (OLS) support])
+fi
+
+AM_CONDITIONAL(HW_RIGOL_DS1XX2, test x$HW_RIGOL_DS1XX2 = xyes)
+if test "x$HW_RIGOL_DS1XX2" = "xyes"; then
+       AC_DEFINE(HAVE_HW_RIGOL_DS1XX2, 1, [Rigol DS1xx2 support])
+fi
+
+AM_CONDITIONAL(HW_SERIAL_DMM, test x$HW_SERIAL_DMM = xyes)
+if test "x$HW_SERIAL_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_SERIAL_DMM, 1, [Serial DMM support])
+fi
+
+AM_CONDITIONAL(HW_TONDAJ_SL_814, test x$HW_TONDAJ_SL_814 = xyes)
+if test "x$HW_TONDAJ_SL_814" = "xyes"; then
+       AC_DEFINE(HAVE_HW_TONDAJ_SL_814, 1, [Tondaj SL-814 support])
+fi
+
+AM_CONDITIONAL(HW_UNI_T_DMM, test x$HW_UNI_T_DMM = xyes)
+if test "x$HW_UNI_T_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_UNI_T_DMM, 1, [UNI-T DMM support])
+fi
+
+AM_CONDITIONAL(HW_VICTOR_DMM, test x$HW_VICTOR_DMM = xyes)
+if test "x$HW_VICTOR_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_VICTOR_DMM, 1, [victor-dmm support])
+fi
+
+AM_CONDITIONAL(LA_ZEROPLUS_LOGIC_CUBE, test x$LA_ZEROPLUS_LOGIC_CUBE = xyes)
+if test "x$LA_ZEROPLUS_LOGIC_CUBE" = "xyes"; then
+       AC_DEFINE(HAVE_LA_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support])
+fi
+
 # Checks for header files.
 # These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
 AC_CHECK_HEADERS([fcntl.h sys/time.h termios.h])