forked from GNOME/gnote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
237 lines (195 loc) · 7.01 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
AC_INIT(gnote, 3.15.0)
AC_PREREQ(2.59)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE
YELP_HELP_INIT
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(m4)
m4_pattern_allow([^BOOST_])
GNOTE_VERSION="$PACKAGE_VERSION"
AC_SUBST(GNOTE_VERSION)
LIBGNOTE_RELEASE=${PACKAGE_VERSION%.*}
AC_SUBST(LIBGNOTE_RELEASE)
AC_DEFINE_UNQUOTED([LIBGNOTE_RELEASE], ["$LIBGNOTE_RELEASE"], [libgnote release.])
LIBGNOTE_VERSION_INFO=0:0:0
AC_SUBST(LIBGNOTE_VERSION_INFO)
AC_DEFINE_UNQUOTED([LIBGNOTE_VERSION_INFO], ["$LIBGNOTE_VERSION_INFO"], [libgnote release.])
dnl all the library version.
dnl if one is harcoded elsewhere, it is a bug
GTK_VERSION=3.10
LIBGLIBMM_VERSION=2.32
LIBGTKMM_VERSION=3.10
GTKSPELL_VERSION=3.0.0
BOOST_VERSION=1.34
LIBSECRET_VERSION=0.8
AC_PROG_CXX
AC_GNU_SOURCE
AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging],[
case "${enableval}" in
yes) debug=true ;
DEBUG_CFLAGS="-DDEBUG -g" ;
OPTIMIZE_CFLAGS="" ;;
no) debug=false ;
DEBUG_CFLAGS="-DNDEBUG" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac
],[ debug=false
DEBUG_CFLAGS="-DNDEBUG"
])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
CPPFLAGS="$CPPFLAGS $DEBUG_CFLAGS -Wall -Wcast-align -Wcast-qual -Wformat-security -Wpointer-arith -Wreturn-type"
CFLAGS="$CFLAGS $DEBUG_CFLAGS $OPTIMIZE_CFLAGS"
CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS $OPTIMIZE_CFLAGS"
dnl CFLAGS=""
LDFLAGS="$LDFLAGS"
dnl AC_PROG_INSTALL
LT_INIT([disable-static])
AC_LANG_CPLUSPLUS
AC_LANG_COMPILER_REQUIRE
AC_ARG_WITH(cxx11_support, [ --with-cxx11-support Compile with C++11 support, if available.],[cxx11_required="${withval}"],[cxx11_required="optional"])
case "$cxx11_required" in
yes) AX_CXX_COMPILE_STDCXX_11([], [mandatory]) ;;
optional) AX_CXX_COMPILE_STDCXX_11([], [optional]) ;;
esac
AC_CHECK_PROG(HAVE_DESKTOP_FILE_VALIDATE, [desktop-file-validate], [yes], [no])
if test $HAVE_DESKTOP_FILE_VALIDATE == "no"; then
AC_MSG_ERROR([desktop-file-validate not found])
fi
PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4 >= $LIBGLIBMM_VERSION])
PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= $GTK_VERSION])
PKG_CHECK_MODULES(X, [x11])
PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-3.0 >= $LIBGTKMM_VERSION])
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
PKG_CHECK_MODULES(LIBXSLT, [libxslt])
PKG_CHECK_MODULES(UUID, [uuid])
PKG_CHECK_MODULES(GTKSPELL, gtkspell3-3.0 >= $GTKSPELL_VERSION,
[FIXED_GTKSPELL="yes";AC_DEFINE([FIXED_GTKSPELL], [1], [Set if the GtkSpell library is recent enough.])
], FIXED_GTKSPELL="no")
AC_SUBST(GTKSPELL_CFLAGS)
AC_SUBST(GTKSPELL_LIBS)
AM_CONDITIONAL(FIXED_GTKSPELL, test "$FIXED_GTKSPELL" = "yes")
PKG_CHECK_MODULES(LIBSECRET, [libsecret-1 >= $LIBSECRET_VERSION])
BOOST_REQUIRE([$BOOST_VERSION])
BOOST_BIND
BOOST_FORMAT
BOOST_TEST([s])
if test $HAVE_CXX11 == 1; then
cxx11_support="yes";
else
cxx11_support="no";
BOOST_CONVERSION
BOOST_FOREACH
AC_CHECK_HEADER(tr1/memory,,[
CXXFLAGS="$CXXFLAGS -I/usr/include/boost/tr1";
AC_MSG_NOTICE([using boost tr1 implementation.])
])
fi
AC_LANG_PUSH(C++)
if test "$GCC" = "yes"; then
GNOTE_BUILD_CONFIG="$GNOTE_BUILD_CONFIG gcc-options="
for option in -Wall -Wextra -Wsign-compare -Wpointer-arith \
-Wchar-subscripts -Wwrite-strings \
-Wunused -Wpointer-arith -Wshadow -fshow-column ; do
SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $option"
GNOTE_BUILD_CONFIG="$GNOTE_BUILD_CONFIG$option "
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
if test $has_option = no; then
CXXFLAGS="$SAVE_CXXFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CXXFLAGS
done
unset option
fi
AC_LANG_POP
AC_ARG_WITH(dbus_service_dir, [ --with-dbus-service-dir=DIR Where to install Gnote's DBus service file.])
AM_CONDITIONAL(WITH_DBUS_SERVICE_DIR, test "x$with_dbus_service_dir" != "x")
if test "x$with_dbus_service_dir" != "x"; then
DBUS_SERVICE_DIR=$with_dbus_service_dir
else
DBUS_SERVICE_DIR=${datadir}/dbus-1/services
fi
AC_SUBST(DBUS_SERVICE_DIR)
AC_ARG_WITH(x11_support, [ --with-x11-support Compile with X11 support.],
[with_x11_support=yes;AC_DEFINE(HAVE_X11_SUPPORT, [1], [Define to 1 to include X11 support.])],
[with_x11_support=no])
AM_CONDITIONAL(HAVE_X11_SUPPORT, test "x$with_x11_support" != "x")
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=gnote
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
[The domain to use with gettext])
AM_GLIB_GNU_GETTEXT
GLIB_GSETTINGS
GNOTE_LOCALEDIR=[${datadir}/locale]
AC_SUBST(GNOTE_LOCALEDIR)
AC_DEFINE_UNQUOTED([GNOTE_BUILD_CONFIG], ["$GNOTE_BUILD_CONFIG"], [The string used to hardcode the build config.])
AC_CONFIG_FILES([
Makefile
data/Makefile
data/gnote.desktop.in
data/icons/Makefile
data/appdata/Makefile
libtomboy/Makefile
src/Makefile
src/addins/Makefile
src/addins/addins.mk
src/addins/backlinks/Makefile
src/addins/backlinks/backlinks.desktop.in
src/addins/bugzilla/Makefile
src/addins/bugzilla/bugzilla.desktop.in
src/addins/exporttogtg/Makefile
src/addins/exporttogtg/exporttogtg.desktop.in
src/addins/exporttohtml/Makefile
src/addins/exporttohtml/exporttohtml.desktop.in
src/addins/filesystemsyncservice/Makefile
src/addins/filesystemsyncservice/filesystemsyncservice.desktop.in
src/addins/fixedwidth/Makefile
src/addins/fixedwidth/fixedwidth.desktop.in
src/addins/inserttimestamp/Makefile
src/addins/inserttimestamp/inserttimestamp.desktop.in
src/addins/notedirectorywatcher/Makefile
src/addins/notedirectorywatcher/notedirectorywatcher.desktop.in
src/addins/noteoftheday/Makefile
src/addins/noteoftheday/noteoftheday.desktop.in
src/addins/printnotes/Makefile
src/addins/printnotes/printnotes.desktop.in
src/addins/readonly/Makefile
src/addins/readonly/readonly.desktop.in
src/addins/replacetitle/Makefile
src/addins/replacetitle/replacetitle.desktop.in
src/addins/specialnotes/Makefile
src/addins/specialnotes/specialnotes.desktop.in
src/addins/statistics/Makefile
src/addins/statistics/statistics.desktop.in
src/addins/stickynoteimport/Makefile
src/addins/stickynoteimport/stickynoteimport.desktop.in
src/addins/tableofcontents/Makefile
src/addins/tableofcontents/tableofcontents.desktop.in
src/addins/todo/Makefile
src/addins/todo/todo.desktop.in
src/addins/tomboyimport/Makefile
src/addins/tomboyimport/tomboyimport.desktop.in
src/addins/underline/Makefile
src/addins/underline/underline.desktop.in
src/addins/webdavsyncservice/Makefile
src/addins/webdavsyncservice/webdavsyncservice.desktop.in
src/dbus/Makefile
po/Makefile.in
po/Makefile
help/Makefile
])
AC_OUTPUT
echo "
Options:
C++11 support: ${cxx11_support}
Spellchecking support: ${FIXED_GTKSPELL}
X11 support: ${with_x11_support}
"