]> sigrok.org Git - sigrok-cli.git/blame - configure.ac
document --protocol-decoder-annotation, and note PD stack is optional.
[sigrok-cli.git] / configure.ac
CommitLineData
43e5747a
UH
1##
2## This file is part of the sigrok project.
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
8c7940f1 23AC_INIT([sigrok-cli], [0.3.0], [sigrok-devel@lists.sourceforge.net],
43e5747a
UH
24 [sigrok-cli], [http://www.sigrok.org])
25
26AC_CONFIG_SRCDIR([sigrok-cli.c])
27
28AC_CONFIG_HEADERS([config.h])
d04f8fdc
UH
29AC_CONFIG_MACRO_DIR([autostuff])
30AC_CONFIG_AUX_DIR([autostuff])
43e5747a 31
2658103e
UH
32# We require at least automake 1.11 (needed for 'silent rules').
33AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign std-options])
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
41CFLAGS="-g -Wall -Wextra"
42
43# Checks for programs.
44AC_PROG_CC
45AC_PROG_CPP
46AC_PROG_INSTALL
47AC_PROG_LN_S
48
49# Initialize libtool.
50LT_INIT
51
52# Initialize pkg-config.
53# We require at least 0.22, as "Requires.private" behaviour changed there.
54PKG_PROG_PKG_CONFIG([0.22])
55
56# Checks for libraries.
57
81f487d6
UH
58AM_PATH_GLIB_2_0([2.22.0],
59 [CFLAGS="$CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
60
8c7940f1 61PKG_CHECK_MODULES([libsigrok], [libsigrok >= 0.1.0],
43e5747a
UH
62 [CFLAGS="$CFLAGS $libsigrok_CFLAGS";
63 LIBS="$LIBS $libsigrok_LIBS"])
64
8c7940f1 65PKG_CHECK_MODULES([libsigrokdecode], [libsigrokdecode >= 0.1.0],
43e5747a
UH
66 [CFLAGS="$CFLAGS $libsigrokdecode_CFLAGS";
67 LIBS="$LIBS $libsigrokdecode_LIBS"])
68
69# Checks for header files.
70# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
71AC_CHECK_HEADERS([sys/time.h termios.h])
72
73# Checks for typedefs, structures, and compiler characteristics.
74AC_C_INLINE
75AC_TYPE_INT8_T
76AC_TYPE_INT16_T
77AC_TYPE_INT32_T
78AC_TYPE_INT64_T
79AC_TYPE_UINT8_T
80AC_TYPE_UINT16_T
81AC_TYPE_UINT32_T
82AC_TYPE_UINT64_T
83AC_TYPE_SIZE_T
84
85# Checks for library functions.
86AC_CHECK_FUNCS([strcasecmp strchr strerror strstr strtol])
87
88AC_SUBST(MAKEFLAGS, '--no-print-directory')
89AC_SUBST(AM_LIBTOOLFLAGS, '--silent')
90
91AC_CONFIG_FILES([Makefile
2c45d102
UH
92 contrib/Makefile
93 contrib/sigrok-cli.nsi
43e5747a
UH
94 doc/Makefile])
95
96AC_OUTPUT
97
81f487d6
UH
98echo
99echo "sigrok-cli configuration summary:"
100echo
101echo " - Package version: $VERSION"
102echo " - Prefix: $prefix"
103echo
104echo "Detected libraries:"
105echo
106
107# Note: This only works for libs with pkg-config integration.
108for lib in "glib-2.0" "libsigrok" "libsigrokdecode"; do
109 if `$PKG_CONFIG --exists $lib`; then
110 ver=`$PKG_CONFIG --modversion $lib`
111 answer="yes ($ver)"
112 else
113 answer="no"
114 fi
115 echo " - $lib: $answer"
116done
117
118echo
119