]> sigrok.org Git - sigrok-gtk.git/blame - configure.ac
frontends: Check for sr/srd minimum versions.
[sigrok-gtk.git] / configure.ac
CommitLineData
3f63165c
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
dffa99f7
UH
20AC_PREREQ([2.61])
21
22AC_INIT([sigrok-gtk], [0.1], [gareth@blacksphere.co.nz],
23 [sigrok-gtk], [http://www.sigrok.org])
24
3f63165c 25AC_CONFIG_SRCDIR([main.c])
2e0801c6
UH
26AC_CONFIG_MACRO_DIR([autostuff])
27AC_CONFIG_AUX_DIR([autostuff])
dffa99f7 28
3f63165c
UH
29AM_INIT_AUTOMAKE([-Wall -Werror foreign std-options])
30m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31
dffa99f7
UH
32AH_TOP([#ifndef SIGROK_GTK_CONFIG_H
33#define SIGROK_GTK_CONFIG_H /* To stop multiple inclusions. */])
34AH_BOTTOM([#endif /* SIGROK_GTK_CONFIG_H */])
35
3f63165c
UH
36CFLAGS="-g -Wall -Wextra"
37
dffa99f7 38# Checks for programs.
3f63165c 39AC_PROG_CC
3f63165c
UH
40AC_PROG_INSTALL
41
42# Initialize libtool.
43LT_INIT
44
45# Initialize pkg-config.
46# We require at least 0.22, as "Requires.private" behaviour changed there.
47PKG_PROG_PKG_CONFIG([0.22])
48
49AC_CHECK_TOOL([WINDRES], windres, [])
50AM_CONDITIONAL([WINDOWS], test x$WINDRES != x)
51
dffa99f7
UH
52# Checks for libraries.
53
3f63165c
UH
54PKG_CHECK_MODULES([gtk], [gtk+-2.0 gmodule-2.0],
55 [CFLAGS="$CFLAGS $gtk_CFLAGS";
56 LIBS="$LIBS $gtk_LIBS"])
57
f57609f5 58PKG_CHECK_MODULES([libsigrok], [libsigrok >= 0.2],
3f63165c
UH
59 [CFLAGS="$CFLAGS $libsigrok_CFLAGS";
60 LIBS="$LIBS $libsigrok_LIBS"])
61
dffa99f7
UH
62# Checks for header files.
63# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
64# AC_CHECK_HEADERS([])
65
66# Checks for typedefs, structures, and compiler characteristics.
67AC_C_INLINE
68AC_TYPE_INT8_T
69AC_TYPE_INT16_T
70AC_TYPE_INT32_T
71AC_TYPE_INT64_T
72AC_TYPE_UINT8_T
73AC_TYPE_UINT16_T
74AC_TYPE_UINT32_T
75AC_TYPE_UINT64_T
76AC_TYPE_SIZE_T
77
78# Checks for library functions.
79AC_CHECK_FUNCS([memset strtoull])
80
3f63165c 81AC_CONFIG_FILES([Makefile])
f19f0cab 82
3f63165c
UH
83AC_OUTPUT
84
f19f0cab
UH
85echo
86echo "sigrok-gtk configuration summary:"
87echo
88echo " - Package version: $VERSION"
89echo " - Prefix: $prefix"
90echo
91echo "Detected libraries:"
92echo
93
94# Note: This only works for libs with pkg-config integration.
95for lib in "glib-2.0" "gmodule-2.0" "gtk+-2.0" "libsigrok"; do
96 if `$PKG_CONFIG --exists $lib`; then
97 ver=`$PKG_CONFIG --modversion $lib`
98 answer="yes ($ver)"
99 else
100 answer="no"
101 fi
102 echo " - $lib: $answer"
103done
104
105echo
106