]> sigrok.org Git - sigrok-cli.git/blame - configure.ac
Enumerate output module options according to API change.
[sigrok-cli.git] / configure.ac
CommitLineData
43e5747a 1##
630293b4 2## This file is part of the sigrok-cli project.
43e5747a
UH
3##
4## Copyright (C) 2010 Bert Vermeulen <bert@biot.com>
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
2658103e
UH
20# We require at least autoconf 2.63 (AC_INIT format changed there).
21AC_PREREQ([2.63])
43e5747a 22
23215c5a 23AC_INIT([sigrok-cli], [0.5.0], [sigrok-devel@lists.sourceforge.net],
de0a066e 24 [sigrok-cli], [http://www.sigrok.org])
43e5747a 25
f0f2c3f3 26AC_CONFIG_SRCDIR([sigrok-cli.h])
43e5747a
UH
27
28AC_CONFIG_HEADERS([config.h])
d04f8fdc
UH
29AC_CONFIG_MACRO_DIR([autostuff])
30AC_CONFIG_AUX_DIR([autostuff])
43e5747a 31
2658103e 32# We require at least automake 1.11 (needed for 'silent rules').
82dad9a9 33AM_INIT_AUTOMAKE([1.11 -Wall -Werror std-options check-news])
43e5747a 34m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
04ef7076 35m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
43e5747a 36
91425119 37AH_TOP([#ifndef SIGROK_CLI_CONFIG_H
43e5747a
UH
38#define SIGROK_CLI_CONFIG_H /* To stop multiple inclusions. */])
39AH_BOTTOM([#endif /* SIGROK_CLI_CONFIG_H */])
40
12ea952e
UH
41# Enable more compiler warnings via -Wall and -Wextra.
42CFLAGS="$CFLAGS -Wall -Wextra"
43e5747a
UH
43
44# Checks for programs.
45AC_PROG_CC
46AC_PROG_CPP
47AC_PROG_INSTALL
48AC_PROG_LN_S
49
50# Initialize libtool.
51LT_INIT
52
53# Initialize pkg-config.
54# We require at least 0.22, as "Requires.private" behaviour changed there.
55PKG_PROG_PKG_CONFIG([0.22])
56
57# Checks for libraries.
de0a066e
BV
58AC_ARG_WITH([libsigrokdecode],
59 AS_HELP_STRING([--with-libsigrokdecode],
60 [compile with libsigrokdecode support]),
20d461e8 61 [WITH_SRD=$withval],[WITH_SRD=yes])
de0a066e 62AM_CONDITIONAL(WITH_SRD, test x$WITH_SRD = xyes)
43e5747a 63
366237a3 64AM_PATH_GLIB_2_0([2.28.0],
de0a066e 65 [CFLAGS="$CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
81f487d6 66
c5e1e956 67PKG_CHECK_MODULES([libsigrok], [libsigrok >= 0.3.0],
43e5747a
UH
68 [CFLAGS="$CFLAGS $libsigrok_CFLAGS";
69 LIBS="$LIBS $libsigrok_LIBS"])
70
de0a066e 71if test "x$WITH_SRD" = "xyes"; then
c5e1e956 72 PKG_CHECK_MODULES([libsigrokdecode], [libsigrokdecode >= 0.3.0],
de0a066e
BV
73 [CFLAGS="$CFLAGS $libsigrokdecode_CFLAGS";
74 LIBS="$LIBS $libsigrokdecode_LIBS";
75 AC_DEFINE(HAVE_SRD, [1], [libsigrokdecode is available.])]
76 )
77fi
43e5747a
UH
78
79# Checks for header files.
80# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
43e5747a
UH
81
82AC_SUBST(MAKEFLAGS, '--no-print-directory')
83AC_SUBST(AM_LIBTOOLFLAGS, '--silent')
84
6da249da 85AC_CONFIG_FILES([Makefile contrib/sigrok-cli_cross.nsi])
43e5747a
UH
86
87AC_OUTPUT
88
81f487d6
UH
89echo
90echo "sigrok-cli configuration summary:"
91echo
92echo " - Package version: $VERSION"
93echo " - Prefix: $prefix"
397969ae
UH
94echo " - Building on: $build"
95echo " - Building for: $host"
81f487d6
UH
96echo
97echo "Detected libraries:"
98echo
99
100# Note: This only works for libs with pkg-config integration.
c5e1e956 101for lib in "glib-2.0 >= 2.28.0" "libsigrok >= 0.3.0" "libsigrokdecode >= 0.3.0"; do
de0a066e
BV
102 if test "$lib" = "libsigrokdecode" -a "$WITH_SRD" != "yes" ; then
103 answer="no"
104 else
105 if `$PKG_CONFIG --exists $lib`; then
106 ver=`$PKG_CONFIG --modversion $lib`
107 answer="yes ($ver)"
108 else
109 answer="no"
110 fi
111 fi
5a10320a 112 echo " - (REQUIRED) $lib: $answer"
81f487d6
UH
113done
114
115echo
116