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