~markjtully/gwibber/authorise

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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
m4_define([gwibber_major], [3])
m4_define([gwibber_minor], [5])
m4_define([gwibber_micro], [1])
m4_define([gwibber_version],
          [gwibber_major.gwibber_minor.gwibber_micro])

m4_define([gwibber_api_version], [0.2])

AC_INIT([gwibber],[gwibber_version],[https://launchpad.net/gwibber])
AC_COPYRIGHT([Copyright 2010 Canonical])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AC_PREREQ(2.65)

AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(gwibber, gwibber_version)

dnl Get version number into Autoconf
GWIBBER_MAJOR_VERSION=gwibber_major
GWIBBER_MINOR_VERSION=gwibber_minor
GWIBBER_MICRO_VERSION=gwibber_micro
GWIBBER_VERSION=gwibber_version
GWIBBER_API_VERSION=gwibber_api_version
AC_SUBST(GWIBBER_MAJOR_VERSION)
AC_SUBST(GWIBBER_MINOR_VERSION)
AC_SUBST(GWIBBER_MICRO_VERSION)
AC_SUBST(GWIBBER_VERSION)
AC_SUBST(GWIBBER_API_VERSION)


dnl Init the other things we depend on
AM_MAINTAINER_MODE
GWIBBER_PROG_VALAC([0.15.0])

AS_IF([test -z "$VALAC"], [AC_MSG_ERROR(["No valac compiler found."])])
AC_PROG_CC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_PROG_LIBTOOL

LT_INIT
AC_CONFIG_MACRO_DIR([m4])

# Check for python 2.6
AM_PATH_PYTHON([2.6])

###########################
# Internationalization
###########################

GETTEXT_PACKAGE="${PACKAGE}"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
localedir='$(prefix)/$(DATADIRNAME)/locale'
AC_SUBST(localedir)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
IT_PROG_INTLTOOL([0.40])


###########################
# Lib versioning 
###########################

LIBGWIBBER_CURRENT=2
LIBGWIBBER_REVISION=0
LIBGWIBBER_AGE=0

AC_SUBST(LIBGWIBBER_CURRENT)
AC_SUBST(LIBGWIBBER_REVISION)
AC_SUBST(LIBGWIBBER_AGE)

GLIB_GSETTINGS

# Setup a few consts
if test "x${prefix}" = "xNONE"; then
  PREFIX="${ac_default_prefix}"
else
  PREFIX="${prefix}"
fi

AC_DEFINE_UNQUOTED(LOCALE_DIR, "${PREFIX}/${DATADIRNAME}/locale",[Locale directory])
AC_DEFINE_UNQUOTED(PKGDATADIR, "${PREFIX}/${DATADIRNAME}/${PACKAGE}", [Package data directory])

######################################################
# intltool rule for generating translated .lens file
######################################################
INTLTOOL_LENS_RULE='%.lens: %.lens.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
AC_SUBST(INTLTOOL_LENS_RULE)

dnl Use strict compiler flags only on development releases
m4_define([maintainer_flags_default],
          [m4_if(m4_eval(gwibber_minor % 2), [1], [yes], [no])])
AC_ARG_ENABLE([maintainer-flags],
              [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>:],[Use string compiler flags @<:@default=no@:>@])],
              [],
              [enable_maintainer_flags=maintainer_flags_default])
MAINTAINER_CFLAGS=""
MAINTAINER_VALAFLAGS=""
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
      [
        MAINTAINER_CFLAGS="-g -Wall -Werror -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self -Wno-unused-but-set-variable -Wno-unused-variable -Wno-error"
        MAINTAINER_VALAFLAGS="-g --save-temps"
      ]
)
AC_SUBST(MAINTAINER_CFLAGS)
AC_SUBST(MAINTAINER_VALAFLAGS)



dnl disable deprecated APIs
DEPRECATED_CFLAGS=""
AC_ARG_ENABLE([deprecated],
	[AC_HELP_STRING([--disable-deprecated],
	[Add extra compiler flags disabling deprecated APIs])],
	[disable_deprecated=$enableval],
	[disable_deprecated='yes'])

if test "$disable_deprecated" = 'no'; then
        DEPRECATED_CFLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGSEAL_ENABLE -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
fi
AC_SUBST(DEPRECATED_CFLAGS)


dnl Check for module and library dependancies
GLIB_REQUIRED=2.26
GTK_REQUIRED=3.2
GDK_REQUIRED=3.2
DEE_REQUIRED=1.0.0
DBUSMENU_REQUIRED=0.4
INDICATE_REQUIRED=0.5
LIBNOTIFY_REQUIRED=0.7
UNITY_REQUIRED=5.0.0
PKG_CHECK_MODULES(BASE,
                  glib-2.0 >= $GLIB_REQUIRED
                  gobject-2.0 >= $GLIB_REQUIRED
                  gtk+-3.0 >= $GTK_REQUIRED
                  gdk-3.0 >= $GDK_REQUIRED
                  gio-2.0 
                  gio-unix-2.0 >= $GLIB_REQUIRED
                  gee-1.0
                  libnotify >= $LIBNOTIFY_REQUIRED
                  libsoup-2.4
                  pangocairo
                  dee-1.0 >= $DEE_REQUIRED
                  json-glib-1.0
                  gmodule-2.0
                  gsettings-desktop-schemas)
AC_SUBST(BASE_CFLAGS)
AC_SUBST(BASE_LIBS)

AC_ARG_ENABLE([spell],
  AS_HELP_STRING([--enable-spell],
    [enable gtkspell @<:@default=yes@:>@]),
  enable_spell=$enableval,
  enable_spell=yes)

if test "x$enable_spell" = "xyes"; then
        PKG_CHECK_MODULES(GTKSPELL,
                  gtkspell-3.0)
        AC_SUBST(GTKSPELL_CFLAGS)
        AC_SUBST(GTKSPELL_CFLAGS)
	GTKSPELL_PKG="--pkg gtkspell-3.0"
        AC_SUBST(GTKSPELL_PKG)
fi

AM_CONDITIONAL(HAVE_GTKSPELL, [test "x$enable_spell" = "xyes"])

###########################
# GObject Introspection
###########################

GOBJECT_INTROSPECTION_CHECK([0.6.7])

PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.10],
                                 introspection_ten=yes,
                                 introspection_ten=no)

AM_CONDITIONAL(INTROSPECTION_TEN, [test "x$introspection_ten" = "xyes"])

###########################
# DBus Service Info
###########################

if test "x$with_localinstall" = "xyes"; then
        DBUSSERVICEDIR="${datadir}/dbus-1/services/"
else
        DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
fi
AC_SUBST(DBUSSERVICEDIR)

dnl local install for distcheck and stand-alone running
with_localinstall="no"
AC_ARG_ENABLE(localinstall,
              AS_HELP_STRING([--enable-localinstall],
                             [Install all of the files locally instead of in system directories (for distcheck)]),
              with_localinstall=$enableval,
              with_localinstall=no)

AM_CONDITIONAL([HAVE_LOCALINSTALL], [test "x$with_localinstall" = "xyes"])

with_unity="yes"
AC_ARG_ENABLE(unity,
              AS_HELP_STRING([--enable-unity],
                             [Enable building of the Unity lens]),
              with_unity=$enableval,
              with_unity=yes)

AM_CONDITIONAL([HAVE_UNITY], [test "x$with_unity" = "xyes"])

if test "x$with_unity" = "xyes"; then
	PKG_CHECK_MODULES(UNITY,
                  dbusmenu-glib-0.4 >= $DBUSMENU_REQUIRED
                  unity >= $UNITY_REQUIRED)
	AC_SUBST(UNITY_CFLAGS)
	AC_SUBST(UNITY_LIBS)
	if test "x$with_localinstall" = "xyes"; then
        	LENSESDIR="${datadir}/unity/lenses"
	else
        	LENSESDIR=`$PKG_CONFIG --variable=lensesdir unity`
	fi
	AC_SUBST(LENSESDIR)
fi

dnl Create the Makefiles
AC_CONFIG_FILES([
  Makefile
  man/Makefile
  gwibber/Makefile
  gwibber/lib/Makefile
  gwibber/lib/gtk/Makefile
  gwibber/microblog/Makefile
  gwibber/microblog/util/Makefile
  gwibber/microblog/util/const.py
  gwibber/microblog/uploader/Makefile
  gwibber/microblog/uploader/imageshack/Makefile
  gwibber/microblog/uploader/ubuntuone_uploader/Makefile
  gwibber/microblog/urlshorter/Makefile
  gwibber/microblog/plugins/Makefile
  gwibber/microblog/plugins/facebook/Makefile
  gwibber/microblog/plugins/facebook/gtk/Makefile
  gwibber/microblog/plugins/facebook/gtk/facebook/Makefile
  gwibber/microblog/plugins/facebook/ui/Makefile
  gwibber/microblog/plugins/flickr/Makefile
  gwibber/microblog/plugins/flickr/gtk/Makefile
  gwibber/microblog/plugins/flickr/gtk/flickr/Makefile
  gwibber/microblog/plugins/flickr/ui/Makefile
  gwibber/microblog/plugins/foursquare/Makefile
  gwibber/microblog/plugins/foursquare/gtk/Makefile
  gwibber/microblog/plugins/foursquare/gtk/foursquare/Makefile
  gwibber/microblog/plugins/foursquare/ui/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/16x16/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/16x16/apps/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/22x22/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/22x22/apps/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/32x32/Makefile
  gwibber/microblog/plugins/foursquare/ui/icons/hicolor/32x32/apps/Makefile
  gwibber/microblog/plugins/identica/Makefile
  gwibber/microblog/plugins/identica/gtk/Makefile
  gwibber/microblog/plugins/identica/gtk/identica/Makefile
  gwibber/microblog/plugins/identica/ui/Makefile
  gwibber/microblog/plugins/statusnet/Makefile
  gwibber/microblog/plugins/statusnet/gtk/Makefile
  gwibber/microblog/plugins/statusnet/gtk/statusnet/Makefile
  gwibber/microblog/plugins/statusnet/ui/Makefile
  gwibber/microblog/plugins/twitter/Makefile
  gwibber/microblog/plugins/twitter/gtk/Makefile
  gwibber/microblog/plugins/twitter/gtk/twitter/Makefile
  gwibber/microblog/plugins/twitter/ui/Makefile
  data/Makefile
  data/icons/Makefile
  data/icons/hicolor/Makefile
  data/icons/hicolor/16x16/Makefile
  data/icons/hicolor/16x16/status/Makefile
  data/icons/hicolor/16x16/apps/Makefile
  data/icons/hicolor/22x22/Makefile
  data/icons/hicolor/22x22/places/Makefile
  data/icons/hicolor/22x22/status/Makefile
  data/icons/hicolor/22x22/apps/Makefile
  data/icons/hicolor/48x48/Makefile
  data/icons/hicolor/48x48/places/Makefile
  data/icons/hicolor/scalable/Makefile
  data/icons/hicolor/scalable/apps/Makefile
  data/icons/hicolor/scalable/places/Makefile
  data/icons/streams/Makefile
  data/icons/streams/16x16/Makefile
  data/icons/streams/24x24/Makefile
  data/icons/streams/32x32/Makefile
  data/icons/scalable/apps/Makefile
  data/icons/16x16/apps/Makefile
  data/icons/24x24/apps/Makefile
  data/icons/32x32/apps/Makefile
  data/icons/48x48/apps/Makefile
  data/icons/256x256/apps/Makefile
  data/icons/scalable/Makefile
  data/icons/16x16/Makefile
  data/icons/24x24/Makefile
  data/icons/32x32/Makefile
  data/icons/48x48/Makefile
  data/icons/256x256/Makefile
  data/gwibber.desktop.in
  data/org.gwibber.gschema.xml.in
  libgwibber/Makefile
  libgwibber-gtk/Makefile
  vapi/Makefile
  po/Makefile.in
  gwibber-$GWIBBER_API_VERSION.pc
  gwibber-gtk-$GWIBBER_API_VERSION.pc
  lens/Makefile
  lens/src/Makefile
  lens/data/Makefile
  lens/data/gwibber.lens.in
  client/Makefile
  bin/Makefile
  examples/Makefile
  tests/Makefile
  tests/vala/Makefile
  tests/python/Makefile
])
AC_OUTPUT

dnl Output the results
AC_MSG_NOTICE([

  libgwibber $VERSION
  ----------------------

  Prefix         : ${prefix}

  Localinstall   : ${with_localinstall}

  Unity   : ${with_unity}
  gtkspell   : ${enable_spell}

  Lenses Directory: ${LENSESDIR}

  Extra CFlags   : ${CPPFLAGS} $MAINTAINER_CFLAGS $DEPRECATED_CFLAGS
  Extra ValaFlags: ${CPPFLAGS} $MAINTAINER_VALAFLAGS
])