]> sigrok.org Git - sigrok-cli.git/blame - configure.ac
Improve 'longname' PD strings, use in 'sigrok-cli -V'.
[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
b4dfa44d 20AC_PREREQ([2.61])
43e5747a
UH
21
22AC_INIT([sigrok-cli], [0.1], [sigrok-devel@lists.sourceforge.net],
23 [sigrok-cli], [http://www.sigrok.org])
24
25AC_CONFIG_SRCDIR([sigrok-cli.c])
26
27AC_CONFIG_HEADERS([config.h])
d04f8fdc
UH
28AC_CONFIG_MACRO_DIR([autostuff])
29AC_CONFIG_AUX_DIR([autostuff])
43e5747a
UH
30
31AM_INIT_AUTOMAKE([-Wall -Werror foreign std-options])
32m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
91425119 34AH_TOP([#ifndef SIGROK_CLI_CONFIG_H
43e5747a
UH
35#define SIGROK_CLI_CONFIG_H /* To stop multiple inclusions. */])
36AH_BOTTOM([#endif /* SIGROK_CLI_CONFIG_H */])
37
38CFLAGS="-g -Wall -Wextra"
39
40# Checks for programs.
41AC_PROG_CC
42AC_PROG_CPP
43AC_PROG_INSTALL
44AC_PROG_LN_S
45
46# Initialize libtool.
47LT_INIT
48
49# Initialize pkg-config.
50# We require at least 0.22, as "Requires.private" behaviour changed there.
51PKG_PROG_PKG_CONFIG([0.22])
52
53# Checks for libraries.
54
81f487d6
UH
55AM_PATH_GLIB_2_0([2.22.0],
56 [CFLAGS="$CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
57
43e5747a
UH
58PKG_CHECK_MODULES([libsigrok], [libsigrok],
59 [CFLAGS="$CFLAGS $libsigrok_CFLAGS";
60 LIBS="$LIBS $libsigrok_LIBS"])
61
62PKG_CHECK_MODULES([libsigrokdecode], [libsigrokdecode],
63 [CFLAGS="$CFLAGS $libsigrokdecode_CFLAGS";
64 LIBS="$LIBS $libsigrokdecode_LIBS"])
65
66# Checks for header files.
67# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
68AC_CHECK_HEADERS([sys/time.h termios.h])
69
70# Checks for typedefs, structures, and compiler characteristics.
71AC_C_INLINE
72AC_TYPE_INT8_T
73AC_TYPE_INT16_T
74AC_TYPE_INT32_T
75AC_TYPE_INT64_T
76AC_TYPE_UINT8_T
77AC_TYPE_UINT16_T
78AC_TYPE_UINT32_T
79AC_TYPE_UINT64_T
80AC_TYPE_SIZE_T
81
82# Checks for library functions.
83AC_CHECK_FUNCS([strcasecmp strchr strerror strstr strtol])
84
85AC_SUBST(MAKEFLAGS, '--no-print-directory')
86AC_SUBST(AM_LIBTOOLFLAGS, '--silent')
87
88AC_CONFIG_FILES([Makefile
89 doc/Makefile])
90
91AC_OUTPUT
92
81f487d6
UH
93echo
94echo "sigrok-cli configuration summary:"
95echo
96echo " - Package version: $VERSION"
97echo " - Prefix: $prefix"
98echo
99echo "Detected libraries:"
100echo
101
102# Note: This only works for libs with pkg-config integration.
103for lib in "glib-2.0" "libsigrok" "libsigrokdecode"; do
104 if `$PKG_CONFIG --exists $lib`; then
105 ver=`$PKG_CONFIG --modversion $lib`
106 answer="yes ($ver)"
107 else
108 answer="no"
109 fi
110 echo " - $lib: $answer"
111done
112
113echo
114