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