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