-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
79 lines (68 loc) · 2.39 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
m4_define([gente_version], 0.1)
AC_INIT([gente], [gente_version], [])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_HEADER_STDC
GLIB_REQUIRED_VERSION=2.37.7
GTK_REQUIRED_VERSION=3.9.12
GDKPIXBUF_REQUIRED_VERSION=2.23.0
ACCOUNTSSERVICE_REQUIRED_VERSION=0.6.30
COMMON_MODULES="gtk+-3.0 >= $GTK_REQUIRED_VERSION
glib-2.0 >= $GLIB_REQUIRED_VERSION
gthread-2.0
gio-2.0
gio-unix-2.0"
PKG_CHECK_MODULES(GENTE, $COMMON_MODULES
gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION
accountsservice >= $ACCOUNTSSERVICE_REQUIRED_VERSION)
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="\
-Wall -Wclobbered -Wempty-body -Wignored-qualifiers \
-Wmissing-field-initializers -Wmissing-parameter-type \
-Wold-style-declaration -Woverride-init -Wtype-limits \
-Wuninitialized \
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wpointer-arith \
-Wcast-align -Wsign-compare \
$CFLAGS"
# Only add this when optimizing is enabled (default)
AC_MSG_CHECKING([whether optimization is enabled])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if __OPTIMIZE__ == 0
#error No optimization
#endif
]], [[]])],
[has_optimization=yes],
[has_optimization=no])
if test $has_optimization = yes; then
CFLAGS="$CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
fi
AC_MSG_RESULT($has_optimization)
for option in -Wno-strict-aliasing -Wno-sign-compare; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[has_option=yes],
[has_option=no])
if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT