configure.ac 8.49 KB
Newer Older
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
1
2
 Process this file with autoconf to produce a configure script.

Felix Riemann's avatar
Felix Riemann committed
3
4
EOG_MAJOR=3.0.0
EOG_PLUGINS_MAJOR=3.0.0
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
5

Felix Riemann's avatar
Felix Riemann committed
6
AC_INIT([eog-plugins], [3.25.1], [http://bugzilla.gnome.org/enter_bug.cgi?product=eog&component=plugins])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
7
8
9
10
11
12
13
14

AC_CONFIG_SRCDIR([plugins])
AC_PREFIX_PROGRAM([eog])

AC_SUBST(EOG_PLUGINS_MAJOR)

AC_PREREQ(2.59)

Felix Riemann's avatar
Felix Riemann committed
15
AM_INIT_AUTOMAKE([1.11 foreign tar-ustar dist-xz no-dist-gzip])
Felix Riemann's avatar
Felix Riemann committed
16
AC_CONFIG_MACRO_DIR([m4])
17
18
# Support silencing the build output if supported (automake-1.11+)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
19
20
21
22

AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([config.h])

23
24
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
25
26
27
28
29
30
31
32
33
34

AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET

# ***********
# Translation 
# ***********

AM_GLIB_GNU_GETTEXT
35
IT_PROG_INTLTOOL([0.50.1])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
36
37
38
39
40
41
42
43
44

GETTEXT_PACKAGE=eog-plugins
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])

# **********
# GNOME Libs 
# **********

45
PKG_CHECK_MODULES([EOG], [
46
47
	glib-2.0 >= 2.38.0
	gtk+-3.0 >= 3.14.0
48
	libpeas-1.0 >= 0.7.4
49
	eog >= 3.15.90
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
])
AC_SUBST(EOG_LIBS)
AC_SUBST(EOG_CFLAGS)

# *******
# Plugins
# *******

#FIXME
EOG_HAS_PYTHON=1
#/FIXME

AC_MSG_CHECKING([which plugins to build])

64
65
66
ALL_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-titlebar light-theme"
USEFUL_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-titlebar light-theme"
DEFAULT_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-titlebar light-theme"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
67

68
69
70
PYTHON_ALL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
PYTHON_USEFUL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
PYTHON_DEFAULT_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
71
72
73
74
75
76
77
78
79
80
81
82

DIST_PLUGINS="$ALL_PLUGINS $PYTHON_ALL_PLUGINS"

if test $EOG_HAS_PYTHON
then
	ALL_PLUGINS="$ALL_PLUGINS $PYTHON_ALL_PLUGINS"
	USEFUL_PLUGINS="$USEFUL_PLUGINS $PYTHON_USEFUL_PLUGINS"
	DEFAULT_PLUGINS="$DEFAULT_PLUGINS $PYTHON_DEFAULT_PLUGINS"
else
	AC_MSG_WARN([eog compiled without python support, plugins $PYTHON_ALL_PLUGINS will not be available])
fi
AC_ARG_WITH([plugins],
83
84
	    [AS_HELP_STRING([--with-plugins=LIST],
			    [Comma-separated list specifying the plugins to build.
85
86
87
			    Available: map, exif-display, fit-to-width,
			    fullscreenbg, postr, postasa, pythonconsole,
			    slideshowshuffle, as well as the aliases default,
88
89
90
			    all, and really-all])],
	    [plugins=$with_plugins],
	    [plugins="default"])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
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

if test "x$with_plugins" = xyes
then
	plugins="default"
fi

need_python=no
explicit_plugins=
PLUGINS=
IFS="${IFS=	}"; eogpl_save_ifs="$IFS"; IFS=","
for pl in $plugins
do
	if echo "$ALL_PLUGINS" | egrep "(^| )$pl(\$| )" > /dev/null
	then
		PLUGINS="$PLUGINS $pl"
		explicit_plugins="$explicit_plugins $pl"
	elif test "x$pl" = "xdefault"
	then
		PLUGINS="$PLUGINS $DEFAULT_PLUGINS"
	elif test "x$pl" = "xall"
	then
		PLUGINS="$PLUGINS $USEFUL_PLUGINS"
	elif test "x$pl" = "xreally-all"
	then
		PLUGINS="$PLUGINS $ALL_PLUGINS"
	else
117
		IFS=$eogpl_save_ifs
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
118
119
120
121
122
123
124
125
126
127
128
129
130
		AC_MSG_ERROR([the specified plugin $pl does not exist])
	fi
	
	if echo "$PYTHON_ALL_PLUGINS" | egrep "(^| )$pl(\$| )" > /dev/null
	then
		need_python=yes
	fi
done
IFS="$eogpl_save_ifs"

AC_MSG_RESULT([$PLUGINS])

# *****
131
# GSettings 
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
132
133
# *****

134
GLIB_GSETTINGS
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

# **************
# Python Support 
# **************

AC_MSG_CHECKING([whether Python support is requested])

AC_ARG_ENABLE([python],
	AS_HELP_STRING([--enable-python],[Enable python support]),
	[enable_python=$enableval have_python=$enableval],
	[enable_python=autodetect have_python=yes])

AC_MSG_RESULT([$enable_python])

if test "x$have_python" != "xno"; then
150
	AM_PATH_PYTHON([3.2],[],[:])
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
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
	if test "x$PYTHON" = "x:"; then
		have_python=no
	fi
fi

if test "x$have_python" != "xyes"; then
	if test "x$enable_python" = "xyes"; then
		AC_MSG_ERROR([Python not found])
	elif test "x$enable_python" = "xautodetect"; then
		enable_python=no
		AC_MSG_WARN([Python not found, disabling python support])
	fi
elif test "x$enable_python" != "xno"; then
	enable_python=yes
	AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
fi

AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])

disabled_plugins=

# *******************
# Plugin Dependencies
# *******************

check_plugin_defined() {
177
	if echo "$2" | grep -w "$1" > /dev/null;
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
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
	then
		return 1
	else
		return 0
	fi
}

plugin_defined() {
	check_plugin_defined "$1" "$PLUGINS"
	return $?
}

plugin_defined_explicit() {
	check_plugin_defined "$1" "$explicit_plugins"
	return $?
}

undef_plugin() {
	if test -z "$disabled_plugins"
	then
		disabled_plugins="$1 ($2)"
	else
		disabled_plugins="$disabled_plugins, $1 ($2)"
	fi
	
	PLUGINS=$(echo "$PLUGINS" | sed -e "s/[[^a-zA-Z0-9_]]$1[[ \t\r\n\f]]\{1,\}/ /" -e "s/[[^a-zA-Z0-9_]]$1$//" -e "s/^$1[[ \t\r\n\f]]\{1,\}//")
}

# Disable python plugins if there is no python support
if test "x$enable_python" = "xno"
then
	for pl in $PYTHON_ALL_PLUGINS
	do
		undef_plugin "$pl" "no python support"
	done
fi

# *****
# Postr 
# *****
plugin_defined postr
if test "$?" = 1
then
	AC_PATH_PROG(POSTR, postr)
222
223
224
225
	if test -z "$POSTR"
	then
		undef_plugin postr "postr was not found"
	fi
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
226
227
fi

228
229
230
231
232
233
234
235
# *******
# Postasa
# *******
plugin_defined postasa
if test "$?" = 1
then
    PKG_CHECK_MODULES(POSTASA,
        [ libgdata >= 0.6.0 ],
236
	[have_postasa=yes],
237
	[have_postasa=no])
238
239
240
241
242
    AC_SUBST(POSTASA_LIBS)
    AC_SUBST(POSTASA_CFLAGS)
    if test "x$have_postasa" = "xno"
    then
        undef_plugin postasa "libgdata was not found"
243
244
    else
         PKG_CHECK_EXISTS([ libgdata >= 0.8 ],
245
	     AC_DEFINE([HAVE_LIBGDATA_0_8], [1],
246
247
248
	               [Define to be compatible with the API of libgdata-0.8]),
	)
        PKG_CHECK_EXISTS([ libgdata >= 0.9.1 ],
249
	     AC_DEFINE([HAVE_LIBGDATA_0_9], [1],
250
251
252
253
	               [Define to be compatible with the API of libgdata-0.9]),
	)


254
255
256
    fi
fi

257
258
259
260
# ***
# Map
# ***
plugin_defined map
261
262
263
264
if test "$?" = 1
then
	
	PKG_CHECK_MODULES(CHAMPLAIN,
265
266
		[ champlain-0.12 >= 0.9.0,
		  champlain-gtk-0.12 >= 0.9.0,
267
268
		  clutter-1.0 >= 1.9.4,
		  clutter-gtk-1.0 >= 1.1.2,
269
		  libexif >= 0.6.16 ],
270
		[],[have_libchamplain=no])
271
272
	AC_SUBST(CHAMPLAIN_LIBS)
	AC_SUBST(CHAMPLAIN_CFLAGS)
273
	if test "x$have_libchamplain" = "xno"
274
	then
275
		undef_plugin map "libchamplain or libexif was not found"
276
277
278
	fi
fi

Emmanuel Touzery's avatar
Emmanuel Touzery committed
279
280
281
282
283
284
285
286
# ***********
# ExifDisplay
# ***********
plugin_defined exif-display
if test "$?" = 1
then

    PKG_CHECK_MODULES(EXIFDISPLAY,
287
        [ libexif >= 0.6.16 ],
Emmanuel Touzery's avatar
Emmanuel Touzery committed
288
289
290
291
292
        [],[have_exifdisplay=no])
    AC_SUBST(EXIFDISPLAY_LIBS)
    AC_SUBST(EXIFDISPLAY_CFLAGS)
    if test "x$have_exifdisplay" = "xno"
    then
293
        undef_plugin exif-display "libexif was not found"
Emmanuel Touzery's avatar
Emmanuel Touzery committed
294
295
296
    fi
fi

297
298
299
300
301
302
303
304
305
306
307
308
309
# ***********
# PythonConsole
# ***********
plugin_defined pythonconsole
if test "$?" = 1
then

    PKG_CHECK_EXISTS([ gsettings-desktop-schemas ],
        [],
	undef_plugin pythonconsole "gsettings-desktop-schemas missing"
    )
fi

Emmanuel Touzery's avatar
Emmanuel Touzery committed
310

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
311
312
313
314
315
316
317
318
319
320
321
322
323
if test -z "$disabled_plugins"
then
	disabled_plugins="none"
fi

PLUGINS=$(echo $PLUGINS | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
AC_SUBST([DIST_PLUGINS])
AC_SUBST([BUILD_PLUGINS],[$PLUGINS])

# ****
# Misc 
# ****
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
324
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
325
326
327
328

PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)

329
330
331
332
333
334
EOG_PLUGINS_LIBS_DIR="$libdir/eog/plugins"
AC_SUBST(EOG_PLUGINS_LIBS_DIR)

EOG_PLUGINS_DATA_DIR="$datadir/eog/plugins"
AC_SUBST(EOG_PLUGINS_DATA_DIR)

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
335
336
337
AC_CONFIG_FILES([
Makefile
plugins/Makefile
338
plugins/map/Makefile
339
plugins/fit-to-width/Makefile
Emmanuel Touzery's avatar
Emmanuel Touzery committed
340
plugins/exif-display/Makefile
341
plugins/exif-display/org.gnome.eog.plugins.exif-display.gschema.xml
Jendrik Seipp's avatar
Jendrik Seipp committed
342
plugins/export-to-folder/Makefile
343
plugins/export-to-folder/org.gnome.eog.plugins.export-to-folder.gschema.xml
344
plugins/fullscreenbg/Makefile
345
plugins/fullscreenbg/org.gnome.eog.plugins.fullscreenbg.gschema.xml
Felix Riemann's avatar
Felix Riemann committed
346
plugins/hide-titlebar/Makefile
347
plugins/light-theme/Makefile
348
plugins/maximize-windows/Makefile
Felix Riemann's avatar
Felix Riemann committed
349
plugins/send-by-mail/Makefile
350
plugins/slideshowshuffle/Makefile
351
plugins/postr/Makefile
352
plugins/postasa/Makefile
353
plugins/pythonconsole/Makefile
354
plugins/pythonconsole/org.gnome.eog.plugins.pythonconsole.gschema.xml
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
po/Makefile.in])

AC_OUTPUT

echo "
Configure summary:

	Source code location:..: ${srcdir}
	Compiler...............: ${CC}
	Prefix ................: ${prefix}
	Python Support ........: $enable_python
	Plugins ...............: $PLUGINS
	Disabled plugins ......: $disabled_plugins

Note: you have to install these plugins into the same prefix than your eog
installation (probably /usr if you're using your distro packages, /usr/local
if you have compiled it on your own).
"