Add link to download area
[entangle:entangle.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([entangle], [0.1.0])
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.10.0
22 AC_SUBST(GLIB_REQUIRED)
23 GIO_REQUIRED=2.10.0
24 AC_SUBST(GIO_REQUIRED)
25 GTHREAD_REQUIRED=2.10.0
26 AC_SUBST(GTHREAD_REQUIRED)
27 GDK_PIXBUF_REQUIRED=2.12.0
28 AC_SUBST(GDK_PIXBUF_REQUIRED)
29 GTK_REQUIRED=2.12.0
30 AC_SUBST(GTK_REQUIRED)
31 GPHOTO2_REQUIRED=2.4.8
32 AC_SUBST(GPHOTO2_REQUIRED)
33 GLADE2_REQUIRED=2.6.0
34 AC_SUBST(GLADE2_REQUIRED)
35 GCONF2_REQUIRED=2.12.0
36 AC_SUBST(GCONF2_REQUIRED)
37 HAL_REQUIRED=0.5.0
38 AC_SUBST(HAL_REQUIRED)
39 GUDEV_REQUIRED=145
40 AC_SUBST(GUDEV_REQUIRED)
41 DBUS_GLIB_REQUIRED=0.60
42 AC_SUBST(DBUS_GLIB_REQUIRED)
43 GOBJECT_INTROSPECTION_REQUIRED=0.6.2
44 AC_SUBST(GOBJECT_INTROSPECTION_REQUIRED)
45 LCMS_REQUIRED=1.18
46 AC_SUBST(LCMS_REQUIRED)
47 STARTUP_REQUIRED=0.5
48 AC_SUBST(STARTUP_REQUIRED)
49 UNIQUE_REQUIRED=1.0.0
50 AC_SUBST(UNIQUE_REQUIRED)
51 GJS_REQUIRED=0.4
52 AC_SUBST(GJS_REQUIRED)
53
54 dnl *******************************************************************************
55 dnl Setup core compilers / build helpers
56 dnl *******************************************************************************
57
58 AC_PROG_CC_STDC
59 AM_PROG_CC_C_O
60
61 AM_PROG_LIBTOOL
62
63
64 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
65 AC_SUBST(GLIB_CFLAGS)
66 AC_SUBST(GLIB_LIBS)
67
68 PKG_CHECK_MODULES(GIO, glib-2.0 >= $GIO_REQUIRED)
69 AC_SUBST(GIO_CFLAGS)
70 AC_SUBST(GIO_LIBS)
71
72 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
73 AC_SUBST(GMODULE_CFLAGS)
74 AC_SUBST(GMODULE_LIBS)
75
76 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GTHREAD_REQUIRED)
77 AC_SUBST(GTHREAD_CFLAGS)
78 AC_SUBST(GTHREAD_LIBS)
79
80 PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED)
81 AC_SUBST(GDK_PIXBUF_CFLAGS)
82 AC_SUBST(GDK_PIXBUF_LIBS)
83
84 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
85 AC_SUBST(GTK_CFLAGS)
86 AC_SUBST(GTK_LIBS)
87
88 PKG_CHECK_MODULES(GPHOTO2, libgphoto2 >= $GPHOTO2_REQUIRED)
89 AC_SUBST(GPHOTO2_CFLAGS)
90 AC_SUBST(GPHOTO2_LIBS)
91
92 PKG_CHECK_MODULES(GLADE2, libglade-2.0 >= $GLADE2_REQUIRED)
93 AC_SUBST(GLADE2_CFLAGS)
94 AC_SUBST(GLADE2_LIBS)
95
96 PKG_CHECK_MODULES(GCONF2, gconf-2.0 >= $GCONF2_REQUIRED)
97 AC_SUBST(GCONF2_CFLAGS)
98 AC_SUBST(GCONF2_LIBS)
99
100 with_hal=0
101 with_gudev=0
102 PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= $GUDEV_REQUIRED, [
103           AC_SUBST(GUDEV_CFLAGS)
104           AC_SUBST(GUDEV_LIBS)
105           with_gudev=1
106         ], [
107           PKG_CHECK_MODULES(HAL, hal >= $HAL_REQUIRED, [
108             AC_SUBST(HAL_CFLAGS)
109             AC_SUBST(HAL_LIBS)
110             with_hal=1
111           ])
112     ])
113 AC_DEFINE_UNQUOTED([WITH_GUDEV], [$with_gudev], [Whether gudev is available])
114 AC_DEFINE_UNQUOTED([WITH_HAL], [$with_hal], [Whether HAL is available])
115
116 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
117 AC_SUBST(DBUS_GLIB_CFLAGS)
118 AC_SUBST(DBUS_GLIB_LIBS)
119
120 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_REQUIRED)
121 AC_SUBST(LCMS_CFLAGS)
122 AC_SUBST(LCMS_LIBS)
123
124 PKG_CHECK_MODULES(STARTUP, libstartup-notification-1.0 >= $STARTUP_REQUIRED)
125 AC_SUBST(STARTUP_CFLAGS)
126 AC_SUBST(STARTUP_LIBS)
127
128 PKG_CHECK_MODULES(UNIQUE, unique-1.0 >= $UNIQUE_REQUIRED)
129 AC_SUBST(UNIQUE_CFLAGS)
130 AC_SUBST(UNIQUE_LIBS)
131
132
133 GTK_DOC_CHECK(1.9)
134
135
136 AC_ARG_ENABLE([introspection],
137         AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
138         [], [enable_introspection=check])
139
140 if test "x$enable_introspection" != "xno" ; then
141         PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
142                           [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
143                           [enable_introspection=yes],
144                           [
145                              if test "x$enable_introspection" = "xcheck"; then
146                                enable_introspection=no
147                              else
148                                AC_MSG_ERROR([gobject-introspection is not available])
149                              fi
150                           ])
151         if test "x$enable_introspection" = "xyes" ; then
152           AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
153           AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
154           AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
155           AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
156           AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
157         fi
158 fi
159 AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
160
161 AC_ARG_WITH([javascript],
162       AS_HELP_STRING([--with-javascript],[enable JavaScript plugins]),
163       [], [with_javascript=check])
164
165 if test "x$with_javascript" != "xno" ; then
166   if test "x$enable_introspection" = "xno" ; then
167     if test "x$with_javascript" = "xyes"; then
168       AC_MSG_ERROR([gobject-introspection is requird for javascript plugins])
169     fi
170   fi
171
172   PKG_CHECK_MODULES(GJS, gjs-1.0 >= $GJS_REQUIRED)
173   AC_SUBST(GJS_CFLAGS)
174   AC_SUBST(GJS_LIBS)
175
176   PKG_CHECK_MODULES(GJS_GI, gjs-gi-1.0 >= $GJS_REQUIRED)
177   AC_SUBST(GJS_GI_CFLAGS)
178   AC_SUBST(GJS_GI_LIBS)
179
180   with_javascript=yes
181   AC_DEFINE([WITH_JAVASCRIPT], [1], [enable JavaScript plugins])
182 fi
183 AM_CONDITIONAL([WITH_JAVASCRIPT], [test "x$with_javascript" = "xyes"])
184
185
186 ENTANGLE_COMPILE_WARNINGS
187
188 AC_PATH_PROG([TPAGE], [tpage])
189
190 if test -z "$TPAGE" ; then
191    AC_MSG_ERROR([The 'tpage' command from Template-Toolkit is required to build the website])
192 fi
193
194
195 AC_CONFIG_FILES(
196   Makefile
197   entangle.spec
198   src/Makefile
199   docs/Makefile
200   docs/reference/Makefile
201   docs/website/Makefile
202   )
203
204 AC_OUTPUT