]> sigrok.org Git - sigrok-gtk.git/blob - configure.ac
17f13e65ed6071d55090a09e27c3796081e37ada
[sigrok-gtk.git] / configure.ac
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
20 AC_INIT([sigrok-gtk], [0.1], [gareth@blacksphere.co.nz])
21 AC_CONFIG_SRCDIR([main.c])
22 AC_PREREQ(2.57)
23 AC_CONFIG_MACRO_DIR([autostuff])
24 AC_CONFIG_AUX_DIR([autostuff])
25 AM_INIT_AUTOMAKE([-Wall -Werror foreign std-options])
26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27
28 CFLAGS="-g -Wall -Wextra"
29
30 AC_PROG_CC
31 AM_PROG_AS
32 AC_STDC_HEADERS
33 AC_PROG_INSTALL
34
35 # Initialize libtool.
36 LT_INIT
37
38 # Initialize pkg-config.
39 # We require at least 0.22, as "Requires.private" behaviour changed there.
40 PKG_PROG_PKG_CONFIG([0.22])
41
42 AC_CHECK_TOOL([WINDRES], windres, [])
43 AM_CONDITIONAL([WINDOWS], test x$WINDRES != x)
44
45 PKG_CHECK_MODULES([gtk], [gtk+-2.0 gmodule-2.0],
46         [CFLAGS="$CFLAGS $gtk_CFLAGS";
47         LIBS="$LIBS $gtk_LIBS"])
48
49 PKG_CHECK_MODULES([libsigrok], [libsigrok],
50         [CFLAGS="$CFLAGS $libsigrok_CFLAGS";
51         LIBS="$LIBS $libsigrok_LIBS"])
52
53 AC_CONFIG_FILES([Makefile])
54
55 AC_OUTPUT
56
57 echo
58 echo "sigrok-gtk configuration summary:"
59 echo
60 echo "  - Package version: $VERSION"
61 echo "  - Prefix: $prefix"
62 echo
63 echo "Detected libraries:"
64 echo
65
66 # Note: This only works for libs with pkg-config integration.
67 for lib in "glib-2.0" "gmodule-2.0" "gtk+-2.0" "libsigrok"; do
68         if `$PKG_CONFIG --exists $lib`; then
69                 ver=`$PKG_CONFIG --modversion $lib`
70                 answer="yes ($ver)"
71         else
72                 answer="no"
73         fi
74         echo "  - $lib: $answer"
75 done
76
77 echo
78