forked from baedert/corebird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
190 lines (146 loc) · 4.89 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
AC_INIT([corebird],[1.4],[[email protected]])
AC_PREREQ([2.65])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_STDC
AC_PROG_INSTALL
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
VALA_MIN_VERSION=0.28.0
AM_PROG_VALAC([$VALA_MIN_VERSION],
[],
[AC_MSG_ERROR([valac >= $VALA_MIN_VERSION is required])])
GLIB_GSETTINGS
# --enable-debug
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debugging]),, enable_debug=no)
AM_CONDITIONAL([ENABLE_DEBUG], [ test "$enable_debug" = "yes"])
# --disable-video
AC_ARG_ENABLE(video, AS_HELP_STRING([--disable-video], [Disable video support]),
disable_video=yes, disable_video=no)
AM_CONDITIONAL([DISABLE_VIDEO], [ test "$disable_video" = "yes"])
# --disable-gst-check
AC_ARG_ENABLE(gst_check, AS_HELP_STRING([--disable-gst-check], [Disable check for needed gstreamer elements]),, disable_gst_check=no)
AM_CONDITIONAL([DISABLE_GST_CHECK], [ test "$disable_gst_check" = "yes"])
# --disable-spellcheck
AC_ARG_ENABLE(spellcheck, AS_HELP_STRING([--disable-spellcheck], [Disable spellchecking supoprt]),
disable_spellcheck=yes, disable_spellcheck=no)
AM_CONDITIONAL([DISABLE_SPELLCHECK], [ test "$disable_spellcheck" = "yes"])
pkg_modules="gtk+-3.0 >= 3.18
glib-2.0 >= 2.44
rest-0.7 >= 0.7.93
libsoup-2.4
json-glib-1.0
sqlite3"
if test "$disable_video" = "no"; then
pkg_modules="$pkg_modules gstreamer-video-1.0 >= 1.6"
fi
if test "$disable_spellcheck" = "no"; then
pkg_modules="$pkg_modules gspell-1 >= 1.0"
fi
PKG_CHECK_MODULES(CB, [$pkg_modules])
CB_VALA_FLAGS=" \
--pkg gtk+-3.0 \
--pkg json-glib-1.0 \
--pkg rest-0.7 \
--pkg sqlite3 \
--pkg libsoup-2.4 \
--pkg glib-2.0 \
--target-glib=2.44"
AC_SUBST(CB_CFLAGS)
AC_SUBST(CB_LIBS)
AC_SUBST(CB_VALA_FLAGS)
# Check for valac >= 0.34, which binds gtk_popover_popup
# as well as if that function exists in gtk+
AM_PROG_VALAC([0.34.0], [
AC_CHECK_LIB([gtk-3], [gtk_popover_popup],
[CB_VALA_FLAGS="$CB_VALA_FLAGS -D GTK322"],
)
])
# Check for librest 0.8.1, which contains a bug fix for
# rest_proxy_call_upload we need
PKG_CHECK_MODULES([REST081], ["rest-0.7 >= 0.8.1"],
[CB_VALA_FLAGS="$CB_VALA_FLAGS -D REST081"],
[]
)
AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[the glib-compile-resources program])
AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
if test -z "$GLIB_COMPILE_RESOURCES"; then
AC_MSG_ERROR([glib-compile-resources not found])
fi
AC_ARG_VAR([XMLLINT],[the xmllint program])
AC_PATH_PROG([XMLLINT],[xmllint],[])
if test -z "$XMLLINT"; then
AC_MSG_ERROR([xmllint not found])
fi
if test "${CC}" = "clang"; then
CB_CFLAGS="$CB_CFLAGS -Wno-incompatible-pointer-types -Wno-incompatible-pointer-types-discards-qualifiers"
fi
if test "$disable_video" = "no"; then
CB_VALA_FLAGS="$CB_VALA_FLAGS \
-D VIDEO \
--pkg gstreamer-video-1.0"
CB_CFLAGS="$CB_CFLAGS -D VIDEO"
fi
if test "$enable_debug" = "yes"; then
CB_VALA_FLAGS="$CB_VALA_FLAGS -D DEBUG"
CB_CFLAGS="$CB_CFLAGS -D DEBUG -D G_DISABLE_CAST_CHECKS"
fi
if test "$disable_spellcheck" = "no"; then
CB_VALA_FLAGS="$CB_VALA_FLAGS -D SPELLCHECK --pkg gspell-1"
CB_CFLAGS="$CB_CFLAGS -D SPELLCHECK"
fi
if test "$disable_gst_check" = "no"; then
# Check for gtksink
GST_ELEMENT_CHECK([gtksink], [1.0], [], [])
fi
# Gettext stuff
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext Package])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.7])
AC_SUBST([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
data/hicolor/Makefile
data/hicolor/256x256/Makefile
data/hicolor/256x256/apps/Makefile
data/hicolor/128x128/Makefile
data/hicolor/128x128/apps/Makefile
data/hicolor/96x96/Makefile
data/hicolor/96x96/apps/Makefile
data/hicolor/64x64/Makefile
data/hicolor/64x64/apps/Makefile
data/hicolor/48x48/Makefile
data/hicolor/48x48/apps/Makefile
data/hicolor/32x32/Makefile
data/hicolor/32x32/apps/Makefile
data/hicolor/24x24/Makefile
data/hicolor/24x24/apps/Makefile
data/hicolor/16x16/Makefile
data/hicolor/16x16/apps/Makefile
po/Makefile.in
tests/Makefile
])
AC_OUTPUT
VALAC_VERSION=$($VALAC --version)
echo "
Corebird $VERSION
Prefix: ${prefix}
Vala Compiler: ${VALAC} ${CB_VALA_FLAGS}
valac version: ${VALAC_VERSION}
C Compiler: ${CC} ${CFLAGS}
Debugging: $enable_debug
Video disabled: $disable_video
Gst check disabled: $disable_gst_check
Spellchecking disabled: $disable_spellcheck
"