Update NEWS for 0.4.1 release
[entangle:entangle.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([entangle], [0.4.1])
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
48 dnl *******************************************************************************
49 dnl Setup core compilers / build helpers
50 dnl *******************************************************************************
51
52 AC_PROG_CC_STDC
53 AM_PROG_CC_C_O
54
55 AM_PROG_LIBTOOL
56
57
58 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_REQUIRED])
59 AC_SUBST(GLIB_CFLAGS)
60 AC_SUBST(GLIB_LIBS)
61
62 PKG_CHECK_MODULES([GIO], [glib-2.0 >= $GIO_REQUIRED])
63 AC_SUBST(GIO_CFLAGS)
64 AC_SUBST(GIO_LIBS)
65
66 AC_MSG_CHECKING([for glib-compile-schemas])
67 AC_SUBST([GLIB_COMPILE_SCHEMAS], [$($PKG_CONFIG --variable=glib_compile_schemas gio-2.0)])
68 if [ test -n "$GLIB_COMPILE_SCHEMAS" ]; then
69   AC_MSG_RESULT([$GLIB_COMPILE_SCHEMAS])
70 else
71   AC_MSG_ERROR([The $GLIB_COMPILE_SCHEMAS binary must be installed before building entangle])
72 fi
73
74 PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= $GLIB_REQUIRED])
75 AC_SUBST(GMODULE_CFLAGS)
76 AC_SUBST(GMODULE_LIBS)
77
78 PKG_CHECK_MODULES([GTHREAD], [gthread-2.0 >= $GTHREAD_REQUIRED])
79 AC_SUBST(GTHREAD_CFLAGS)
80 AC_SUBST(GTHREAD_LIBS)
81
82 PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
83 AC_SUBST(GDK_PIXBUF_CFLAGS)
84 AC_SUBST(GDK_PIXBUF_LIBS)
85
86 PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQUIRED])
87 AC_SUBST(GTK_CFLAGS)
88 AC_SUBST(GTK_LIBS)
89
90 PKG_CHECK_MODULES([GPHOTO2], [libgphoto2 >= $GPHOTO2_REQUIRED])
91 AC_SUBST(GPHOTO2_CFLAGS)
92 AC_SUBST(GPHOTO2_LIBS)
93
94 PKG_CHECK_MODULES([GUDEV], [gudev-1.0 >= $GUDEV_REQUIRED])
95 AC_SUBST(GUDEV_CFLAGS)
96 AC_SUBST(GUDEV_LIBS)
97
98 PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
99 AC_SUBST(DBUS_GLIB_CFLAGS)
100 AC_SUBST(DBUS_GLIB_LIBS)
101
102 PKG_CHECK_MODULES([LCMS], [lcms >= $LCMS_REQUIRED])
103 AC_SUBST(LCMS_CFLAGS)
104 AC_SUBST(LCMS_LIBS)
105
106 PKG_CHECK_MODULES([GEXIV2], [gexiv2 >= $GEXIV2_REQUIRED])
107 AC_SUBST(GEXIV2_CFLAGS)
108 AC_SUBST(GEXIV2_LIBS)
109
110 PKG_CHECK_MODULES([XEXT], [xext >= $XEXT_REQUIRED],
111                   [have_xext=yes], [have_xext=no])
112 AC_SUBST(XEXT_CFLAGS)
113 AC_SUBST(XEXT_LIBS)
114 if test "$have_xext" = "yes"; then
115   AC_DEFINE_UNQUOTED([HAVE_XEXT], [], [Use Xext library])
116 fi
117
118
119 GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
120
121 PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
122                   [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
123 AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
124 AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
125 AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
126 AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
127
128 PKG_CHECK_MODULES([LIBPEAS], [libpeas-1.0 >= $LIBPEAS_REQUIRED])
129 PKG_CHECK_MODULES([LIBPEAS_UI], [libpeas-gtk-1.0 >= $LIBPEAS_REQUIRED])
130 AC_SUBST(LIBPEAS_CFLAGS)
131 AC_SUBST(LIBPEAS_LIBS)
132 AC_SUBST(LIBPEAS_UI_CFLAGS)
133 AC_SUBST(LIBPEAS_UI_LIBS)
134
135 ENTANGLE_COMPILE_WARNINGS
136
137 GETTEXT_PACKAGE=entangle
138 AC_SUBST(GETTEXT_PACKAGE)
139 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name])
140 AM_GLIB_GNU_GETTEXT
141 IT_PROG_INTLTOOL([0.35.0])
142
143 # Autoconf 2.61a.99 and earlier don't support linking a file only
144 # in VPATH builds.  But since GNUmakefile is for maintainer use
145 # only, it does not matter if we skip the link with older autoconf.
146 # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
147 # builds, so use a shell variable to bypass this.
148 GNUmakefile=GNUmakefile
149 m4_if(m4_version_compare([2.61a.100],
150         m4_defn([m4_PACKAGE_VERSION])), [1], [],
151       [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
152         [GNUmakefile=$GNUmakefile])])
153
154 AC_CONFIG_FILES(
155   Makefile
156   entangle.spec
157   src/Makefile
158   src/icons/Makefile
159   src/icons/128x128/Makefile
160   src/icons/128x128/actions/Makefile
161   src/icons/16x16/Makefile
162   src/icons/16x16/actions/Makefile
163   src/icons/22x22/Makefile
164   src/icons/22x22/actions/Makefile
165   src/icons/32x32/Makefile
166   src/icons/32x32/actions/Makefile
167   src/icons/48x48/Makefile
168   src/icons/48x48/actions/Makefile
169   src/icons/64x64/Makefile
170   src/icons/64x64/actions/Makefile
171   po/Makefile.in
172   docs/Makefile
173   docs/man/Makefile
174   docs/man/en/Makefile
175   docs/reference/Makefile
176   )
177
178 AC_OUTPUT
179
180 # Need to eval twice, to ensure we fully subsitute out all path variables
181 rawdatadir=`eval "echo $datadir"`
182 rawdatadir=`eval "echo $rawdatadir"`
183
184 searchdirs="/usr/share:/usr/local/share"
185 test -n "$XDG_DATA_DIRS" && searchdirs="$searchdirs:$XDG_DATA_DIRS"
186
187 found=0
188 oldIFS=$IFS
189 IFS=:
190 for i in $searchdirs
191 do
192     test "$i" = "$rawdatadir" && found=1
193 done
194 IFS=$oldIFS
195
196 if test "$found" = "0"
197 then
198   AC_MSG_NOTICE([WARNING:])
199   AC_MSG_NOTICE([WARNING: GSettings schemas will be installed under:])
200   AC_MSG_NOTICE([WARNING:])
201   AC_MSG_NOTICE([WARNING:      $rawdatadir])
202   AC_MSG_NOTICE([WARNING:])
203   AC_MSG_NOTICE([WARNING: GSettings will only look for configuration file schemas under:])
204   AC_MSG_NOTICE([WARNING:])
205   AC_MSG_NOTICE([WARNING:      $searchdirs])
206   AC_MSG_NOTICE([WARNING:])
207   AC_MSG_NOTICE([WARNING: If you continue with this install location for schemas, you])
208   AC_MSG_NOTICE([WARNING: should set the following environment variable:])
209   AC_MSG_NOTICE([WARNING:])
210   AC_MSG_NOTICE([WARNING:      XDG_DATA_DIRS=$rawdatadir])
211   AC_MSG_NOTICE([WARNING:])
212   AC_MSG_NOTICE([WARNING: If XDG_DATA_DIRS is not set, Entangle will attempt to enable])
213   AC_MSG_NOTICE([WARNING: a workaround on startup to avoid crashes])
214 fi