-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconfigure.ac
170 lines (134 loc) · 5.09 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
m4_define([cinnamon_bluetooth_version], 3.8.11)
AC_INIT([cinnamon-bluetooth], 3.8.11, [http://github.com/linuxmint/cinnamon-bluetooth])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar check-news])
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
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT
# .so version for libcinnamon-control-center
LIBCINNAMONCONTROLCENTER_CURRENT=1
LIBCINNAMONCONTROLCENTER_REVISION=0
LIBCINNAMONCONTROLCENTER_AGE=0
AC_SUBST(LIBCINNAMONCONTROLCENTER_CURRENT)
AC_SUBST(LIBCINNAMONCONTROLCENTER_REVISION)h
AC_SUBST(LIBCINNAMONCONTROLCENTER_AGE)
# Internationalization support
IT_PROG_INTLTOOL([0.40.1])
GETTEXT_PACKAGE=cinnamon-bluetooth
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
AC_PATH_XTRA
x_libs="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--enable-documentation],
[build documentation]),,
enable_documentation=yes)
if test x$enable_documentation = xyes; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test x$XSLTPROC = x; then
AC_MSG_ERROR([xsltproc is required to build documentation])
fi
fi
AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)
dnl ==============================================
dnl Check that we meet the dependencies
dnl ==============================================
GLIB_REQUIRED_VERSION=2.31.0
GTK_REQUIRED_VERSION=3.4.2
COMMON_MODULES="gtk+-3.0 >= $GTK_REQUIRED_VERSION
glib-2.0 >= $GLIB_REQUIRED_VERSION
libcinnamon-control-center"
# Check for cinnamon-bluetooth
PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.4.1,
[have_bluetooth=yes], have_bluetooth=no)
AM_CONDITIONAL(BUILD_BLUETOOTH, [test x$have_bluetooth = xyes])
dnl ==============================================
dnl End: Check that we meet the dependencies
dnl ==============================================
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
if test x"$GLIB_GENMARSHAL" = xno; then
AC_MSG_ERROR([glib-genmarshal executable not found in your path - should be installed with glib])
fi
AC_SUBST(GLIB_GENMARSHAL)
dnl =======================================
dnl Panels
dnl =======================================
PANELS_DIR="${libdir}/cinnamon-control-center-1/panels"
AC_SUBST(PANELS_DIR)
PANEL_CFLAGS="-I\$(top_srcdir)/ -DG_LOG_DOMAIN=\"\\\"\$(cappletname)-cc-panel\\\"\""
AC_SUBST(PANEL_CFLAGS)
PANEL_LDFLAGS="-export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'"
AC_SUBST(PANEL_LDFLAGS)
dnl =======================================
dnl Finish
dnl =======================================
# Turn on the additional warnings last
AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings],
[Maximum compiler warnings]),
set_more_warnings="$enableval",[
if test -d $srcdir/.git; then
set_more_warnings=yes
else
set_more_warnings=no
fi])
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_OUTPUT([
Makefile
panels/Makefile
panels/bluetooth/Makefile
panels/bluetooth/cinnamon-bluetooth-properties.desktop.in
po/Makefile.in
files/Makefile
])