Update for 0.5.3 release
[entangle:entangle.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([entangle], [0.5.3])
4 AC_CONFIG_SRCDIR([src/entangle-main.c])
5 AM_CONFIG_HEADER([config.h])
6 dnl Make automake keep quiet about wildcards & other GNUmake-isms
7 AM_INIT_AUTOMAKE([-Wno-portability])
8
9 AC_CONFIG_MACRO_DIR([m4])
10
11 # Use the silent-rules feature when possible.
12 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
13 AM_SILENT_RULES([yes])
14
15 AC_CANONICAL_HOST
16
17 dnl *******************************************************************************
18 dnl Declare required library versions
19 dnl *******************************************************************************
20
21 GLIB_REQUIRED=2.26.0
22 AC_SUBST(GLIB_REQUIRED)
23 GIO_REQUIRED=2.26.0
24 AC_SUBST(GIO_REQUIRED)
25 GTHREAD_REQUIRED=2.26.0
26 AC_SUBST(GTHREAD_REQUIRED)
27 GDK_PIXBUF_REQUIRED=2.12.0
28 AC_SUBST(GDK_PIXBUF_REQUIRED)
29 GTK_REQUIRED=3.0.0
30 AC_SUBST(GTK_REQUIRED)
31 GPHOTO2_REQUIRED=2.4.11
32 AC_SUBST(GPHOTO2_REQUIRED)
33 GUDEV_REQUIRED=145
34 AC_SUBST(GUDEV_REQUIRED)
35 DBUS_GLIB_REQUIRED=0.60
36 AC_SUBST(DBUS_GLIB_REQUIRED)
37 GOBJECT_INTROSPECTION_REQUIRED=0.9.3
38 AC_SUBST(GOBJECT_INTROSPECTION_REQUIRED)
39 LCMS_REQUIRED=1.18
40 AC_SUBST(LCMS_REQUIRED)
41 LIBPEAS_REQUIRED=0.5.5
42 AC_SUBST(LIBPEAS_REQUIRED)
43 GEXIV2_REQUIRED=0.2.2
44 AC_SUBST(GEXIV2_REQUIRED)
45 XEXT_REQUIRED=1.3.0
46 AC_SUBST(XEXT_REQUIRED)
47 LIBRAW_REQUIRED=0.9.0
48 AC_SUBST(LIBRAW_REQUIRED)
49
50 dnl *******************************************************************************
51 dnl Setup core compilers / build helpers
52 dnl *******************************************************************************
53
54 AC_PROG_CC_STDC
55 AM_PROG_CC_C_O
56
57 LT_INIT([disable-static])
58
59
60 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_REQUIRED])
61 AC_SUBST(GLIB_CFLAGS)
62 AC_SUBST(GLIB_LIBS)
63
64 PKG_CHECK_MODULES([GIO], [glib-2.0 >= $GIO_REQUIRED])
65 AC_SUBST(GIO_CFLAGS)
66 AC_SUBST(GIO_LIBS)
67
68 PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= $GLIB_REQUIRED])
69 AC_SUBST(GMODULE_CFLAGS)
70 AC_SUBST(GMODULE_LIBS)
71
72 PKG_CHECK_MODULES([GTHREAD], [gthread-2.0 >= $GTHREAD_REQUIRED])
73 AC_SUBST(GTHREAD_CFLAGS)
74 AC_SUBST(GTHREAD_LIBS)
75
76 PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
77 AC_SUBST(GDK_PIXBUF_CFLAGS)
78 AC_SUBST(GDK_PIXBUF_LIBS)
79
80 PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQUIRED])
81 AC_SUBST(GTK_CFLAGS)
82 AC_SUBST(GTK_LIBS)
83
84 have_gphoto25=no
85 PKG_CHECK_MODULES([GPHOTO2], [libgphoto2 >= 2.5], [
86     have_gphoto25=yes
87 ], [
88     PKG_CHECK_MODULES([GPHOTO2], [libgphoto2 >= $GPHOTO2_REQUIRED])
89 ])
90 AC_SUBST(GPHOTO2_CFLAGS)
91 AC_SUBST(GPHOTO2_LIBS)
92
93 if test "$have_gphoto25" = "yes" ; then
94   AC_DEFINE_UNQUOTED([HAVE_GPHOTO25], 1, [whether we're building libgphoto >= 2.5])
95 fi
96
97 PKG_CHECK_MODULES([GUDEV], [gudev-1.0 >= $GUDEV_REQUIRED])
98 AC_SUBST(GUDEV_CFLAGS)
99 AC_SUBST(GUDEV_LIBS)
100
101 PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
102 AC_SUBST(DBUS_GLIB_CFLAGS)
103 AC_SUBST(DBUS_GLIB_LIBS)
104
105 PKG_CHECK_MODULES([LCMS], [lcms >= $LCMS_REQUIRED])
106 AC_SUBST(LCMS_CFLAGS)
107 AC_SUBST(LCMS_LIBS)
108
109 PKG_CHECK_MODULES([GEXIV2], [gexiv2 >= $GEXIV2_REQUIRED])
110 AC_SUBST(GEXIV2_CFLAGS)
111 AC_SUBST(GEXIV2_LIBS)
112
113 PKG_CHECK_MODULES([LIBRAW], [libraw_r >= $LIBRAW_REQUIRED])
114 AC_SUBST(LIBRAW_CFLAGS)
115 AC_SUBST(LIBRAW_LIBS)
116
117 PKG_CHECK_MODULES([XEXT], [xext >= $XEXT_REQUIRED],
118                   [have_xext=yes], [have_xext=no])
119 AC_SUBST(XEXT_CFLAGS)
120 AC_SUBST(XEXT_LIBS)
121 if test "$have_xext" = "yes"; then
122   AC_DEFINE_UNQUOTED([HAVE_XEXT], [], [Use Xext library])
123 fi
124
125 GLIB_GSETTINGS
126
127 GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
128
129 PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
130                   [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
131 AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
132 AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
133 AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
134 AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
135
136 PKG_CHECK_MODULES([LIBPEAS], [libpeas-1.0 >= $LIBPEAS_REQUIRED])
137 PKG_CHECK_MODULES([LIBPEAS_UI], [libpeas-gtk-1.0 >= $LIBPEAS_REQUIRED])
138 AC_SUBST(LIBPEAS_CFLAGS)
139 AC_SUBST(LIBPEAS_LIBS)
140 AC_SUBST(LIBPEAS_UI_CFLAGS)
141 AC_SUBST(LIBPEAS_UI_LIBS)
142
143 ENTANGLE_COMPILE_WARNINGS
144
145 GETTEXT_PACKAGE=entangle
146 AC_SUBST(GETTEXT_PACKAGE)
147 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name])
148 AM_GLIB_GNU_GETTEXT
149 IT_PROG_INTLTOOL([0.35.0])
150
151 # Autoconf 2.61a.99 and earlier don't support linking a file only
152 # in VPATH builds.  But since GNUmakefile is for maintainer use
153 # only, it does not matter if we skip the link with older autoconf.
154 # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
155 # builds, so use a shell variable to bypass this.
156 GNUmakefile=GNUmakefile
157 m4_if(m4_version_compare([2.61a.100],
158         m4_defn([m4_PACKAGE_VERSION])), [1], [],
159       [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
160         [GNUmakefile=$GNUmakefile])])
161
162 AC_CONFIG_FILES(
163   Makefile
164   entangle.spec
165   src/Makefile
166   src/icons/Makefile
167   src/icons/128x128/Makefile
168   src/icons/128x128/actions/Makefile
169   src/icons/16x16/Makefile
170   src/icons/16x16/actions/Makefile
171   src/icons/22x22/Makefile
172   src/icons/22x22/actions/Makefile
173   src/icons/32x32/Makefile
174   src/icons/32x32/actions/Makefile
175   src/icons/48x48/Makefile
176   src/icons/48x48/actions/Makefile
177   src/icons/64x64/Makefile
178   src/icons/64x64/actions/Makefile
179   po/Makefile.in
180   docs/Makefile
181   docs/man/Makefile
182   docs/man/en/Makefile
183   docs/reference/Makefile
184   )
185
186 AC_OUTPUT
187
188 # Need to eval twice, to ensure we fully subsitute out all path variables
189 rawdatadir=`eval "echo $datadir"`
190 rawdatadir=`eval "echo $rawdatadir"`
191
192 searchdirs="/usr/share:/usr/local/share"
193 test -n "$XDG_DATA_DIRS" && searchdirs="$searchdirs:$XDG_DATA_DIRS"
194
195 found=0
196 oldIFS=$IFS
197 IFS=:
198 for i in $searchdirs
199 do
200     test "$i" = "$rawdatadir" && found=1
201 done
202 IFS=$oldIFS
203
204 if test "$found" = "0"
205 then
206   AC_MSG_NOTICE([WARNING:])
207   AC_MSG_NOTICE([WARNING: GSettings schemas will be installed under:])
208   AC_MSG_NOTICE([WARNING:])
209   AC_MSG_NOTICE([WARNING:      $rawdatadir])
210   AC_MSG_NOTICE([WARNING:])
211   AC_MSG_NOTICE([WARNING: GSettings will only look for configuration file schemas under:])
212   AC_MSG_NOTICE([WARNING:])
213   AC_MSG_NOTICE([WARNING:      $searchdirs])
214   AC_MSG_NOTICE([WARNING:])
215   AC_MSG_NOTICE([WARNING: If you continue with this install location for schemas, you])
216   AC_MSG_NOTICE([WARNING: should set the following environment variable:])
217   AC_MSG_NOTICE([WARNING:])
218   AC_MSG_NOTICE([WARNING:      XDG_DATA_DIRS=$rawdatadir:$searchdirs])
219   AC_MSG_NOTICE([WARNING:])
220   AC_MSG_NOTICE([WARNING: If XDG_DATA_DIRS is not set, Entangle will attempt to enable])
221   AC_MSG_NOTICE([WARNING: a workaround on startup to avoid crashes])
222 fi