Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the sigrok project. |
| 3 | ## |
Bert Vermeulen | c73d2ea | 2012-02-13 14:31:51 +0100 | [diff] [blame] | 4 | ## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com> |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 5 | ## |
| 6 | ## This program is free software: you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by |
| 8 | ## the Free Software Foundation, either version 3 of the License, or |
| 9 | ## (at your option) any later version. |
| 10 | ## |
| 11 | ## This program is distributed in the hope that it will be useful, |
| 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ## GNU General Public License for more details. |
| 15 | ## |
| 16 | ## You should have received a copy of the GNU General Public License |
| 17 | ## along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | ## |
| 19 | |
Uwe Hermann | ef7228b | 2012-01-28 21:26:56 +0100 | [diff] [blame] | 20 | # We require at least autoconf 2.63 (AC_INIT format changed there). |
| 21 | AC_PREREQ([2.63]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 22 | |
Uwe Hermann | 3af71f0 | 2012-01-04 00:05:43 +0100 | [diff] [blame] | 23 | # libsigrok package version number (NOT the same as shared lib version!). |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 24 | m4_define([sr_package_version_major], [0]) |
Uwe Hermann | 6329840 | 2012-06-01 00:16:42 +0200 | [diff] [blame] | 25 | m4_define([sr_package_version_minor], [2]) |
| 26 | m4_define([sr_package_version_micro], [0]) |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 27 | m4_define([sr_package_version], [sr_package_version_major.sr_package_version_minor.sr_package_version_micro]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 28 | |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 29 | AC_INIT([libsigrok], [sr_package_version], [sigrok-devel@lists.sourceforge.net], |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 30 | [libsigrok], [http://www.sigrok.org]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 31 | AC_CONFIG_HEADER([config.h]) |
Uwe Hermann | d8521c9 | 2012-01-03 21:55:48 +0100 | [diff] [blame] | 32 | AC_CONFIG_MACRO_DIR([autostuff]) |
| 33 | AC_CONFIG_AUX_DIR([autostuff]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 34 | |
Uwe Hermann | ef7228b | 2012-01-28 21:26:56 +0100 | [diff] [blame] | 35 | # We require at least automake 1.11 (needed for 'silent rules'). |
| 36 | AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign std-options]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 37 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
Pekka Nikander | 432e5e9 | 2012-05-11 19:23:21 +0300 | [diff] [blame] | 38 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 39 | |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 40 | AH_TOP([#ifndef SR_CONFIG_H |
| 41 | #define SR_CONFIG_H /* To stop multiple inclusions. */]) |
| 42 | AH_BOTTOM([#endif /* SR_CONFIG_H */]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 43 | |
Uwe Hermann | 1a081ca | 2012-02-01 23:40:35 +0100 | [diff] [blame] | 44 | # Enable more compiler warnings via -Wall and -Wextra. Add -fvisibility=hidden |
| 45 | # and enforce use of SR_API to explicitly mark all public API functions. |
| 46 | CFLAGS="-g -Wall -Wextra -fvisibility=hidden" |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 47 | |
| 48 | # Checks for programs. |
| 49 | AC_PROG_CXX |
| 50 | AC_PROG_CC |
| 51 | AC_PROG_CPP |
| 52 | AC_PROG_INSTALL |
| 53 | AC_PROG_LN_S |
| 54 | |
| 55 | # Initialize libtool. |
| 56 | LT_INIT |
| 57 | |
| 58 | # Initialize pkg-config. |
| 59 | # We require at least 0.22, as "Requires.private" behaviour changed there. |
| 60 | PKG_PROG_PKG_CONFIG([0.22]) |
| 61 | |
Uwe Hermann | 3af71f0 | 2012-01-04 00:05:43 +0100 | [diff] [blame] | 62 | # Library version for libsigrok (NOT the same as the package version). |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 63 | # Carefully read the libtool docs before updating these numbers! |
| 64 | # The algorithm for determining which number to change (and how) is nontrivial! |
| 65 | # http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info |
Uwe Hermann | 6329840 | 2012-06-01 00:16:42 +0200 | [diff] [blame] | 66 | SR_LIB_VERSION_CURRENT=1 |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 67 | SR_LIB_VERSION_REVISION=0 |
| 68 | SR_LIB_VERSION_AGE=0 |
| 69 | SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE" |
| 70 | SR_LIB_LDFLAGS="-version-info $SR_LIB_VERSION" |
| 71 | AC_SUBST(SR_LIB_VERSION_CURRENT) |
| 72 | AC_SUBST(SR_LIB_VERSION_REVISION) |
| 73 | AC_SUBST(SR_LIB_VERSION_AGE) |
| 74 | AC_SUBST(SR_LIB_VERSION) |
| 75 | AC_SUBST(SR_LIB_LDFLAGS) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 76 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 77 | # Logic analyzer hardware support '--enable' options. |
| 78 | |
Bert Vermeulen | 6ac0db1 | 2012-09-02 11:58:29 +0200 | [diff] [blame^] | 79 | # Disabled by default |
| 80 | AC_ARG_ENABLE(agilent-dmm, AC_HELP_STRING([--enable-agilent-dmm], |
| 81 | [enable Agilent DMM driver support [default=no]]), |
| 82 | [HW_AGILENT_DMM="$enableval"], |
| 83 | [HW_AGILENT_DMM=xno]) |
| 84 | AM_CONDITIONAL(HW_AGILENT_DMM, test x$HW_AGILENT_DMM = xyes) |
| 85 | if test "x$HW_AGILENT_DMM" = "xyes"; then |
| 86 | AC_DEFINE(HAVE_HW_AGILENT_DMM, 1, [Agilent DMM driver support]) |
| 87 | fi |
| 88 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 89 | # Disabled by default, unfinished. |
| 90 | AC_ARG_ENABLE(alsa, AC_HELP_STRING([--enable-alsa], |
| 91 | [enable ALSA driver support [default=no]]), |
| 92 | [LA_ALSA="$enableval"], |
| 93 | [LA_ALSA=no]) |
| 94 | AM_CONDITIONAL(LA_ALSA, test x$LA_ALSA = xyes) |
| 95 | if test "x$LA_ALSA" = "xyes"; then |
| 96 | AC_DEFINE(HAVE_LA_ALSA, 1, [ALSA driver support]) |
| 97 | fi |
| 98 | |
| 99 | AC_ARG_ENABLE(asix-sigma, AC_HELP_STRING([--enable-asix-sigma], |
Uwe Hermann | 6352d03 | 2012-05-02 19:02:03 +0200 | [diff] [blame] | 100 | [enable ASIX SIGMA/SIGMA2 support [default=yes]]), |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 101 | [LA_ASIX_SIGMA="$enableval"], |
| 102 | [LA_ASIX_SIGMA=yes]) |
| 103 | AM_CONDITIONAL(LA_ASIX_SIGMA, test x$LA_ASIX_SIGMA = xyes) |
| 104 | if test "x$LA_ASIX_SIGMA" = "xyes"; then |
Uwe Hermann | 6352d03 | 2012-05-02 19:02:03 +0200 | [diff] [blame] | 105 | AC_DEFINE(HAVE_LA_ASIX_SIGMA, 1, [ASIX SIGMA/SIGMA2 support]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 106 | fi |
| 107 | |
| 108 | AC_ARG_ENABLE(chronovu-la8, AC_HELP_STRING([--enable-chronovu-la8], |
| 109 | [enable ChronoVu LA8 support [default=yes]]), |
| 110 | [LA_CHRONOVU_LA8="$enableval"], |
| 111 | [LA_CHRONOVU_LA8=yes]) |
| 112 | AM_CONDITIONAL(LA_CHRONOVU_LA8, test x$LA_CHRONOVU_LA8 = xyes) |
| 113 | if test "x$LA_CHRONOVU_LA8" = "xyes"; then |
| 114 | AC_DEFINE(HAVE_LA_CHRONOVU_LA8, 1, [ChronoVu LA8 support]) |
| 115 | fi |
| 116 | |
Joel Holdsworth | f302a08 | 2012-02-11 12:08:49 +0000 | [diff] [blame] | 117 | AC_ARG_ENABLE(fx2lafw, AC_HELP_STRING([--enable-fx2lafw], |
Bert Vermeulen | 5d4fb4f | 2012-07-01 15:29:57 +0200 | [diff] [blame] | 118 | [enable fx2lafw support (for FX2 LAs). [default=yes]]), |
Joel Holdsworth | f302a08 | 2012-02-11 12:08:49 +0000 | [diff] [blame] | 119 | [LA_FX2LAFW="$enableval"], |
Joel Holdsworth | d56ee26 | 2012-04-18 19:10:15 +0100 | [diff] [blame] | 120 | [LA_FX2LAFW=yes]) |
Joel Holdsworth | f302a08 | 2012-02-11 12:08:49 +0000 | [diff] [blame] | 121 | AM_CONDITIONAL(LA_FX2LAFW, test x$LA_FX2LAFW = xyes) |
| 122 | if test "x$LA_FX2LAFW" = "xyes"; then |
| 123 | AC_DEFINE(HAVE_LA_FX2LAFW, 1, [fx2lafw support]) |
| 124 | fi |
| 125 | |
Bert Vermeulen | ca3d84c | 2012-07-01 22:37:15 +0200 | [diff] [blame] | 126 | # Disabled by default for now |
| 127 | AC_ARG_ENABLE(genericdmm, AC_HELP_STRING([--enable-genericdmm], |
| 128 | [enable genericdmm support (for most DMMs). [default=no]]), |
| 129 | [HW_GENERICDMM="$enableval"], |
| 130 | [HW_GENERICDMM=no]) |
| 131 | AM_CONDITIONAL(HW_GENERICDMM, test x$HW_GENERICDMM = xyes) |
| 132 | if test "x$HW_GENERICDMM" = "xyes"; then |
| 133 | AC_DEFINE(HAVE_HW_GENERICDMM, 1, [Generic DMM support]) |
| 134 | fi |
| 135 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 136 | AC_ARG_ENABLE(demo, AC_HELP_STRING([--enable-demo], |
| 137 | [enable demo driver support [default=yes]]), |
| 138 | [LA_DEMO="$enableval"], |
| 139 | [LA_DEMO=yes]) |
| 140 | AM_CONDITIONAL(LA_DEMO, test x$LA_DEMO = xyes) |
| 141 | if test "x$LA_DEMO" = "xyes"; then |
| 142 | AC_DEFINE(HAVE_LA_DEMO, 1, [Demo driver support]) |
| 143 | fi |
| 144 | |
| 145 | # Disabled by default, unfinished. |
| 146 | AC_ARG_ENABLE(link-mso19, AC_HELP_STRING([--enable-link-mso19], |
| 147 | [enable Link Instruments MSO-19 support [default=no]]), |
| 148 | [LA_LINK_MSO19="$enableval"], |
| 149 | [LA_LINK_MSO19=no]) |
| 150 | AM_CONDITIONAL(LA_LINK_MSO19, test x$LA_LINK_MSO19 = xyes) |
| 151 | if test "x$LA_LINK_MSO19" = "xyes"; then |
| 152 | AC_DEFINE(HAVE_LA_LINK_MSO19, 1, [Link Instruments MSO-19 support]) |
| 153 | fi |
| 154 | |
| 155 | AC_ARG_ENABLE(ols, AC_HELP_STRING([--enable-ols], |
| 156 | [enable OpenBench Logic Sniffer (OLS) support [default=yes]]), |
| 157 | [LA_OLS="$enableval"], |
| 158 | [LA_OLS=yes]) |
| 159 | AM_CONDITIONAL(LA_OLS, test x$LA_OLS = xyes) |
| 160 | if test "x$LA_OLS" = "xyes"; then |
| 161 | AC_DEFINE(HAVE_LA_OLS, 1, [OpenBench Logic Sniffer (OLS) support]) |
| 162 | fi |
| 163 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 164 | AC_ARG_ENABLE(zeroplus-logic-cube, |
| 165 | AC_HELP_STRING([--enable-zeroplus-logic-cube], |
Uwe Hermann | 8fdecce | 2012-05-30 22:55:03 +0200 | [diff] [blame] | 166 | [enable ZEROPLUS Logic Cube support [default=yes]]), |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 167 | [LA_ZEROPLUS_LOGIC_CUBE="$enableval"], |
| 168 | [LA_ZEROPLUS_LOGIC_CUBE=yes]) |
| 169 | AM_CONDITIONAL(LA_ZEROPLUS_LOGIC_CUBE, test x$LA_ZEROPLUS_LOGIC_CUBE = xyes) |
| 170 | if test "x$LA_ZEROPLUS_LOGIC_CUBE" = "xyes"; then |
Uwe Hermann | 8fdecce | 2012-05-30 22:55:03 +0200 | [diff] [blame] | 171 | AC_DEFINE(HAVE_LA_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 172 | fi |
| 173 | |
Bert Vermeulen | 3b53320 | 2012-04-23 01:05:58 +0200 | [diff] [blame] | 174 | AC_ARG_ENABLE(hantek-dso, |
| 175 | AC_HELP_STRING([--enable-hantek-dso], |
| 176 | [enable Hantek DSO support [default=yes]]), |
| 177 | [HW_HANTEK_DSO="$enableval"], |
| 178 | [HW_HANTEK_DSO=yes]) |
| 179 | AM_CONDITIONAL(HW_HANTEK_DSO, test x$HW_HANTEK_DSO = xyes) |
| 180 | if test "x$HW_HANTEK_DSO" = "xyes"; then |
| 181 | AC_DEFINE(HAVE_HW_HANTEK_DSO, 1, [Hantek DSO support]) |
| 182 | fi |
| 183 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 184 | # Checks for libraries. |
| 185 | |
| 186 | # This variable collects the pkg-config names of all detected libs. |
| 187 | # It is then used to construct the "Requires.private:" field in the |
| 188 | # libsigrok.pc file. |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 189 | SR_PKGLIBS="" |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 190 | |
| 191 | # libglib-2.0 is always needed. |
| 192 | # Note: glib-2.0 is part of the libsigrok API (hard pkg-config requirement). |
Bert Vermeulen | e21e846 | 2012-06-23 01:17:36 +0200 | [diff] [blame] | 193 | AM_PATH_GLIB_2_0([2.28.0], |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 194 | [CFLAGS="$CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"]) |
| 195 | |
| 196 | # libgthread-2.0 is always needed (e.g. for the demo hardware driver). |
| 197 | PKG_CHECK_MODULES([gthread], [gthread-2.0 >= 2.22.0], |
| 198 | [CFLAGS="$CFLAGS $gthread_CFLAGS"; LIBS="$LIBS $gthread_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 199 | SR_PKGLIBS="$SR_PKGLIBS gthread-2.0"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 200 | |
| 201 | # libusb is only needed for some hardware drivers. |
Joel Holdsworth | 824b1a8 | 2012-04-18 19:17:25 +0100 | [diff] [blame] | 202 | if test "x$LA_ASIX_SIGMA" != xno \ |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 203 | -o "x$LA_CHRONOVU_LA8" != xno \ |
Bert Vermeulen | ef2345b | 2012-07-29 15:21:08 +0200 | [diff] [blame] | 204 | -o "x$LA_FX2LAFW" != xno \ |
| 205 | -o "x$HW_HANTEK_DSO" != xno \ |
| 206 | -o "x$LA_ZEROPLUS_LOGIC_CUBE" != xno; then |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 207 | case "$build" in |
| 208 | *freebsd*) |
| 209 | # FreeBSD comes with an "integrated" libusb-1.0-style USB API. |
| 210 | AC_DEFINE_UNQUOTED(HAVE_LIBUSB_1_0, [1], |
| 211 | [Specifies whether we have a libusb.h header.]) |
| 212 | ;; |
| 213 | *) |
| 214 | PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.5], |
| 215 | [CFLAGS="$CFLAGS $libusb_CFLAGS"; |
| 216 | LIBS="$LIBS $libusb_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 217 | SR_PKGLIBS="$SR_PKGLIBS libusb-1.0"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 218 | AC_CHECK_LIB(usb-1.0, libusb_init) |
| 219 | ;; |
| 220 | esac |
| 221 | fi |
| 222 | |
| 223 | # libzip is always needed. |
| 224 | PKG_CHECK_MODULES([libzip], [libzip >= 0.8], |
| 225 | [CFLAGS="$CFLAGS $libzip_CFLAGS"; LIBS="$LIBS $libzip_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 226 | SR_PKGLIBS="$SR_PKGLIBS libzip"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 227 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 228 | # libftdi is only needed for some hardware drivers. |
| 229 | if test "x$LA_ASIX_SIGMA" != xno \ |
| 230 | -o "x$LA_CHRONOVU_LA8" != xno; then |
| 231 | PKG_CHECK_MODULES([libftdi], [libftdi >= 0.16], |
| 232 | [CFLAGS="$CFLAGS $libftdi_CFLAGS"; |
| 233 | LIBS="$LIBS $libftdi_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 234 | SR_PKGLIBS="$SR_PKGLIBS libftdi"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 235 | fi |
| 236 | |
| 237 | # libudev is only needed for some hardware drivers. |
| 238 | if test "x$LA_LINK_MSO19" != xno; then |
| 239 | PKG_CHECK_MODULES([libudev], [libudev >= 151], |
| 240 | [CFLAGS="$CFLAGS $libudev_CFLAGS"; LIBS="$LIBS $libudev_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 241 | SR_PKGLIBS="$SR_PKGLIBS libudev"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 242 | fi |
| 243 | |
| 244 | # ALSA is only needed for some hardware drivers. |
| 245 | if test "x$LA_ALSA" != xno; then |
| 246 | PKG_CHECK_MODULES([alsa], [alsa >= 1.0], |
| 247 | [CFLAGS="$CFLAGS $alsa_CFLAGS"; LIBS="$LIBS $alsa_LIBS"; |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 248 | SR_PKGLIBS="$SR_PKGLIBS alsa"]) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 249 | fi |
| 250 | |
Bert Vermeulen | 28b9dd1 | 2012-07-11 12:36:13 +0200 | [diff] [blame] | 251 | # EZUSB FX2 firmware helpers only needed for some hardware drivers |
| 252 | AM_CONDITIONAL(NEED_EZUSB, \ |
| 253 | test "x$LA_FX2LAFW" != xno \ |
| 254 | -o "x$HW_HANTEK_DSO" != xno \ |
| 255 | ) |
| 256 | |
| 257 | # Serial port helpers only needed for some hardware drivers |
| 258 | AM_CONDITIONAL(NEED_SERIAL, \ |
| 259 | test "x$LA_OLS" != xno \ |
Bert Vermeulen | 6ac0db1 | 2012-09-02 11:58:29 +0200 | [diff] [blame^] | 260 | -o "x$HW_AGILENT_DMM" != xno \ |
Bert Vermeulen | 28b9dd1 | 2012-07-11 12:36:13 +0200 | [diff] [blame] | 261 | -o "x$HW_GENERICDMM" != xno \ |
| 262 | ) |
| 263 | |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 264 | AC_SUBST(SR_PKGLIBS) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 265 | |
| 266 | # Checks for header files. |
| 267 | # These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h. |
| 268 | AC_CHECK_HEADERS([fcntl.h sys/time.h termios.h]) |
| 269 | |
| 270 | # Checks for typedefs, structures, and compiler characteristics. |
| 271 | AC_C_INLINE |
| 272 | AC_TYPE_INT8_T |
| 273 | AC_TYPE_INT16_T |
| 274 | AC_TYPE_INT32_T |
| 275 | AC_TYPE_INT64_T |
| 276 | AC_TYPE_UINT8_T |
| 277 | AC_TYPE_UINT16_T |
| 278 | AC_TYPE_UINT32_T |
| 279 | AC_TYPE_UINT64_T |
| 280 | AC_TYPE_SIZE_T |
| 281 | |
| 282 | # Checks for library functions. |
| 283 | AC_CHECK_FUNCS([gettimeofday memset strchr strcspn strdup strerror strncasecmp strstr strtol strtoul strtoull]) |
| 284 | |
Uwe Hermann | fb6f197 | 2012-05-30 00:00:33 +0200 | [diff] [blame] | 285 | AC_SUBST(FIRMWARE_DIR, "$datadir/sigrok-firmware") |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 286 | AC_SUBST(MAKEFLAGS, '--no-print-directory') |
| 287 | AC_SUBST(AM_LIBTOOLFLAGS, '--silent') |
| 288 | |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 289 | SR_PACKAGE_VERSION_MAJOR=sr_package_version_major |
| 290 | SR_PACKAGE_VERSION_MINOR=sr_package_version_minor |
| 291 | SR_PACKAGE_VERSION_MICRO=sr_package_version_micro |
| 292 | SR_PACKAGE_VERSION=sr_package_version |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 293 | |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 294 | AC_SUBST(SR_PACKAGE_VERSION_MAJOR) |
| 295 | AC_SUBST(SR_PACKAGE_VERSION_MINOR) |
| 296 | AC_SUBST(SR_PACKAGE_VERSION_MICRO) |
| 297 | AC_SUBST(SR_PACKAGE_VERSION) |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 298 | |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 299 | AC_CONFIG_FILES([Makefile |
Bert Vermeulen | 45c59c8 | 2012-07-05 00:55:07 +0200 | [diff] [blame] | 300 | version.h |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 301 | hardware/Makefile |
Bert Vermeulen | 6ac0db1 | 2012-09-02 11:58:29 +0200 | [diff] [blame^] | 302 | hardware/agilent-dmm/Makefile |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 303 | hardware/alsa/Makefile |
| 304 | hardware/asix-sigma/Makefile |
| 305 | hardware/chronovu-la8/Makefile |
| 306 | hardware/common/Makefile |
| 307 | hardware/demo/Makefile |
Joel Holdsworth | f302a08 | 2012-02-11 12:08:49 +0000 | [diff] [blame] | 308 | hardware/fx2lafw/Makefile |
Bert Vermeulen | ca3d84c | 2012-07-01 22:37:15 +0200 | [diff] [blame] | 309 | hardware/genericdmm/Makefile |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 310 | hardware/link-mso19/Makefile |
| 311 | hardware/openbench-logic-sniffer/Makefile |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 312 | hardware/zeroplus-logic-cube/Makefile |
Bert Vermeulen | 3b53320 | 2012-04-23 01:05:58 +0200 | [diff] [blame] | 313 | hardware/hantek-dso/Makefile |
Uwe Hermann | db8ae7b | 2011-12-30 10:50:00 +0100 | [diff] [blame] | 314 | input/Makefile |
| 315 | output/Makefile |
| 316 | output/text/Makefile |
| 317 | libsigrok.pc |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 318 | contrib/Makefile |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 319 | ]) |
| 320 | |
| 321 | AC_OUTPUT |
| 322 | |
| 323 | echo |
Uwe Hermann | 45aed07 | 2012-01-04 00:49:21 +0100 | [diff] [blame] | 324 | echo "libsigrok configuration summary:" |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 325 | echo |
Uwe Hermann | 6dddd90 | 2012-03-31 11:28:24 +0200 | [diff] [blame] | 326 | echo " - Package version (major.minor.micro): $SR_PACKAGE_VERSION" |
| 327 | echo " - Library version (current:revision:age): $SR_LIB_VERSION" |
Uwe Hermann | 45aed07 | 2012-01-04 00:49:21 +0100 | [diff] [blame] | 328 | echo " - Prefix: $prefix" |
| 329 | echo |
| 330 | echo "Detected libraries:" |
| 331 | echo |
| 332 | |
| 333 | # Note: This only works for libs with pkg-config integration. |
HÃ¥vard Espeland | e210c6c | 2012-04-22 14:31:40 +0200 | [diff] [blame] | 334 | for lib in "glib-2.0" "gthread-2.0" "libusb-1.0" "libzip" "libftdi" "libudev" "alsa"; do |
Uwe Hermann | 45aed07 | 2012-01-04 00:49:21 +0100 | [diff] [blame] | 335 | if `$PKG_CONFIG --exists $lib`; then |
| 336 | ver=`$PKG_CONFIG --modversion $lib` |
| 337 | answer="yes ($ver)" |
| 338 | else |
| 339 | answer="no" |
| 340 | fi |
| 341 | echo " - $lib: $answer" |
| 342 | done |
| 343 | |
| 344 | echo |
| 345 | echo "Enabled hardware drivers:" |
| 346 | echo |
Bert Vermeulen | 6ac0db1 | 2012-09-02 11:58:29 +0200 | [diff] [blame^] | 347 | echo " - Agilent DMM..................... $HW_AGILENT_DMM" |
Uwe Hermann | 6352d03 | 2012-05-02 19:02:03 +0200 | [diff] [blame] | 348 | echo " - ASIX SIGMA/SIGMA2............... $LA_ASIX_SIGMA" |
Uwe Hermann | 45aed07 | 2012-01-04 00:49:21 +0100 | [diff] [blame] | 349 | echo " - ChronoVu LA8.................... $LA_CHRONOVU_LA8" |
| 350 | echo " - Demo driver..................... $LA_DEMO" |
Uwe Hermann | b575052 | 2012-03-21 19:45:46 +0100 | [diff] [blame] | 351 | echo " - fx2lafw (for FX2 LAs)........... $LA_FX2LAFW" |
Bert Vermeulen | ca3d84c | 2012-07-01 22:37:15 +0200 | [diff] [blame] | 352 | echo " - Generic DMM..................... $HW_GENERICDMM" |
Uwe Hermann | 45aed07 | 2012-01-04 00:49:21 +0100 | [diff] [blame] | 353 | echo " - Link MSO-19..................... $LA_LINK_MSO19" |
| 354 | echo " - Openbench Logic Sniffer......... $LA_OLS" |
Uwe Hermann | 8fdecce | 2012-05-30 22:55:03 +0200 | [diff] [blame] | 355 | echo " - ZEROPLUS Logic Cube............. $LA_ZEROPLUS_LOGIC_CUBE" |
Bert Vermeulen | 3b53320 | 2012-04-23 01:05:58 +0200 | [diff] [blame] | 356 | echo " - Hantek DSO...................... $HW_HANTEK_DSO" |
Uwe Hermann | 826938d | 2011-12-30 10:42:39 +0100 | [diff] [blame] | 357 | echo |
| 358 | |