my first git commit
[gwget-havlin.git] / configure.ac
blob55dff895fcd61ebc6fb15712c7d1e8c84b478ae9
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(configure.ac)
4 AM_INIT_AUTOMAKE(gwget, 1.0.4)
5 AM_CONFIG_HEADER(config.h)
7 AC_PATH_PROG(GCONFTOOL, gconftool-2)
8 IT_PROG_INTLTOOL([0.35.0])
10 AC_ISC_POSIX
11 AC_PROG_CC
12 AC_STDC_HEADERS
13 AM_PROG_LIBTOOL
15 AM_GCONF_SOURCE_2
17 LIBGNOMEUI_REQUIRED=2.0.0
18 LIBGNOME_REQUIRED=2.0.0
19 GTK_REQUIRED=2.6.0
20 GCONF_REQUIRED=1.1.11
21 DBUS_GLIB_REQUIRED=0.33
22 GIO_REQUIRED=2.16.0
24 PKG_CHECK_MODULES(GNOME, libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
25                           gtk+-2.0      >= $GTK_REQUIRED 
26                           gmodule-2.0
27                           gio-unix-2.0 >= $GIO_REQUIRED)
28                         
30 AC_SUBST(GNOME_LIBS)
31 AC_SUBST(GNOME_CFLAGS)
32 AC_SUBST(GIO_REQUIRED)
34 dnl ========= Check for DBUS
35 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
36         [enable_dbus=yes],[enable_dbus=no])
37 AC_SUBST([DBUS_CFLAGS])
38 AC_SUBST([DBUS_LIBS])
40 if test "x$enable_dbus" = "xno"; then
41         AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
44 if test "x$enable_dbus" = "xyes" ; then
45         AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
47         if test x$DBUS_BINDING_TOOL = "xno" ; then
48                 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
49         fi
51         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
53         DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0\.\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)/\1/'`
54         AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
57 GETTEXT_PACKAGE=gwget
58 AC_SUBST(GETTEXT_PACKAGE)
59 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package])
60 ALL_LINGUAS="ar bg ca cs da de dz el en_CA en_GB es eu fi fr hu it ja lt lv mk ne nl oc pa pl pt pt_BR ro ru rw sk sq sv tr uk vi zh_CN zh_HK zh_TW"
61 AM_GLIB_GNU_GETTEXT
63 GWGET_CFLAGS="$DBUS_CFLAGS"
64 GWGET_LIBS="$DBUS_LIBS -lz"
66 AC_SUBST(GWGET_CFLAGS)
67 AC_SUBST(GWGET_LIBS)
68 AC_SUBST(CFLAGS)
69 AC_SUBST(CPPFLAGS)
70 AC_SUBST(LDFLAGS)
72 if test "x${prefix}" = "xNONE"; then
73         AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${ac_default_prefix}/share/pixmaps", [Gnome pixmap directory])
74 else
75         AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${prefix}/share/pixmaps", [Gnome pixmap directory])
77                                                                                                                                                                                    
78 if test "x${prefix}" = "xNONE"; then
79         AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps", [pixmaps directory])
80         pixmapsdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
81 else
82         AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps", [pixmaps directory])
83         pixmapsdir="${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
85                                                                                                                                                                                                
86 AC_SUBST(pixmapsdir)
88 AC_ARG_ENABLE([epiphany-extension],
89                 [  --enable-epiphany-extension   Enable Epiphany Extension ],
90                 enable_epiphany_extension=$enableval,
91                 enable_epiphany_extension=yes)
95 AC_MSG_CHECKING([which epiphany to use])
97 EPHY_VER=
98 AC_ARG_WITH([epiphany-version],
99         AC_HELP_STRING([--with-epiphany-version@<:@=1.6|1.8|1.10|2.14|2.16|2.18|2.20|2.22|2.24|2.26|2.28@:>@],
100                        [Whether to use epiphany version 1.6 or 1.8 or 1.10 or 2.14 or 2.16 or 2.18 or 2.20 or 2.22 or 2.24 or 2.26 or 2.28 (default 1.6)]),
101         [EPHY_VER="$withval"])
103 dnl try to autodetect Epiphany 1.2, 1.4, 1.6, 1.8, 1.10, 2.14, 2.15, 2.16, 2.17, 2.18, 2.19, 2.20, 2.21, 2.22, 2.23, 2.24, 2.25, 2.26, 2.27 or 2.28
104 EPHY_AUTODETECT="(autodetect)"
105 if pkg-config --exists epiphany-2.28; then
106         EPHY_VER=2.28
107 elif pkg-config --exists epiphany-2.27; then
108         EPHY_VER=2.27
109 elif pkg-config --exists epiphany-2.26; then
110         EPHY_VER=2.26
111 elif pkg-config --exists epiphany-2.25; then
112         EPHY_VER=2.25
113 elif pkg-config --exists epiphany-2.24; then
114         EPHY_VER=2.24
115 elif pkg-config --exists epiphany-2.23; then
116         EPHY_VER=2.23
117 elif pkg-config --exists epiphany-2.22; then
118         EPHY_VER=2.22
119 elif pkg-config --exists epiphany-2.21; then
120         EPHY_VER=2.21
121 elif pkg-config --exists epiphany-2.20; then
122         EPHY_VER=2.20
123 elif pkg-config --exists epiphany-2.19; then
124         EPHY_VER=2.19
125 elif pkg-config --exists epiphany-2.18; then
126         EPHY_VER=2.18
127 elif pkg-config --exists epiphany-2.17; then
128         EPHY_VER=2.17
129 elif pkg-config --exists epiphany-2.16; then
130         EPHY_VER=2.16
131 elif pkg-config --exists epiphany-2.15; then
132         EPHY_VER=2.15
133 elif pkg-config --exists epiphany-2.14; then
134         EPHY_VER=2.14
135 elif pkg-config --exists epiphany-1.10; then
136         EPHY_VER=1.10
137 elif pkg-config --exists epiphany-1.8; then
138         EPHY_VER=1.8
139 elif pkg-config --exists epiphany-1.6; then
140         EPHY_VER=1.6
141 elif pkg-config --exists epiphany-1.4; then
142         EPHY_VER=1.4
143 elif pkg-config --exists epiphany-1.2; then
144         EPHY_VER=1.2
148 EPIPHANY_REQUIRED=
149 EPIPHANY_PKGCONFIG=
150 EPIPHANY_SHORTVER=
152 if test "x$EPHY_VER" = "x1.2"; then
153           EPIPHANY_PKGCONFIG=epiphany-1.2
154           EPIPHANY_REQUIRED=1.2.0
155           EPIPHANY_SHORTVER=12
156 elif test "x$EPHY_VER" = "x1.4"; then
157           EPIPHANY_PKGCONFIG=epiphany-1.4
158           EPIPHANY_REQUIRED=1.4.0
159           EPIPHANY_SHORTVER=14
160 elif test "x$EPHY_VER" = "x1.6"; then
161           EPIPHANY_PKGCONFIG=epiphany-1.6
162           EPIPHANY_REQUIRED=1.6.0
163           EPIPHANY_SHORTVER=16
164 elif test "x$EPHY_VER" = "x1.8"; then
165           EPIPHANY_PKGCONFIG=epiphany-1.8
166           EPIPHANY_REQUIRED=1.7.0
167           EPIPHANY_SHORTVER=18
168 elif test "x$EPHY_VER" = "x1.10"; then
169           EPIPHANY_PKGCONFIG=epiphany-1.10
170           EPIPHANY_REQUIRED=1.9.0
171           EPIPHANY_SHORTVER=110
172 elif test "x$EPHY_VER" = "x2.14"; then
173           EPIPHANY_PKGCONFIG=epiphany-2.14
174           EPIPHANY_REQUIRED=2.14
175           EPIPHANY_SHORTVER=214
176 elif test "x$EPHY_VER" = "x2.15"; then
177           EPIPHANY_PKGCONFIG=epiphany-2.15
178           EPIPHANY_REQUIRED=2.15
179           EPIPHANY_SHORTVER=215
180 elif test "x$EPHY_VER" = "x2.16"; then
181           EPIPHANY_PKGCONFIG=epiphany-2.16
182           EPIPHANY_REQUIRED=2.16
183           EPIPHANY_SHORTVER=216
184 elif test "x$EPHY_VER" = "x2.17"; then
185           EPIPHANY_PKGCONFIG=epiphany-2.17
186           EPIPHANY_REQUIRED=2.17
187           EPIPHANY_SHORTVER=217
188 elif test "x$EPHY_VER" = "x2.18"; then
189           EPIPHANY_PKGCONFIG=epiphany-2.18
190           EPIPHANY_REQUIRED=2.18
191           EPIPHANY_SHORTVER=218
192 elif test "x$EPHY_VER" = "x2.19"; then
193           EPIPHANY_PKGCONFIG=epiphany-2.19
194           EPIPHANY_REQUIRED=2.19
195           EPIPHANY_SHORTVER=219
196 elif test "x$EPHY_VER" = "x2.20"; then
197           EPIPHANY_PKGCONFIG=epiphany-2.20
198           EPIPHANY_REQUIRED=2.20
199           EPIPHANY_SHORTVER=220
200 elif test "x$EPHY_VER" = "x2.21"; then
201           EPIPHANY_PKGCONFIG=epiphany-2.21
202           EPIPHANY_REQUIRED=2.21
203           EPIPHANY_SHORTVER=221
204 elif test "x$EPHY_VER" = "x2.22"; then
205           EPIPHANY_PKGCONFIG=epiphany-2.22
206           EPIPHANY_REQUIRED=2.22
207           EPIPHANY_SHORTVER=222
208 elif test "x$EPHY_VER" = "x2.23"; then
209           EPIPHANY_PKGCONFIG=epiphany-2.23
210           EPIPHANY_REQUIRED=2.23
211           EPIPHANY_SHORTVER=223
212 elif test "x$EPHY_VER" = "x2.24"; then
213           EPIPHANY_PKGCONFIG=epiphany-2.24
214           EPIPHANY_REQUIRED=2.24
215           EPIPHANY_SHORTVER=224
216 elif test "x$EPHY_VER" = "x2.25"; then
217           EPIPHANY_PKGCONFIG=epiphany-2.25
218           EPIPHANY_REQUIRED=2.25
219           EPIPHANY_SHORTVER=225
220 elif test "x$EPHY_VER" = "x2.26"; then
221           EPIPHANY_PKGCONFIG=epiphany-2.26
222           EPIPHANY_REQUIRED=2.26
223           EPIPHANY_SHORTVER=226
224 elif test "x$EPHY_VER" = "x2.27"; then
225           EPIPHANY_PKGCONFIG=epiphany-2.27
226           EPIPHANY_REQUIRED=2.27
227           EPIPHANY_SHORTVER=227
228 elif test "x$EPHY_VER" = "x2.28"; then
229           EPIPHANY_PKGCONFIG=epiphany-2.28
230           EPIPHANY_REQUIRED=2.28
231           EPIPHANY_SHORTVER=228
232 else
233         AC_MSG_RESULT([no epiphany installed])
236 if test -n "$EPIPHANY_SHORTVER" ; then
237 AC_DEFINE_UNQUOTED(EPHY_VERSION, $EPIPHANY_SHORTVER,
238        [Define to the Epiphany version (12, 14, 16, 18, 110, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227 or 228)])
239 AC_MSG_RESULT([$EPHY_VER $EPHY_AUTODETECT])
241 LIBGLIB_REQUIRED=2.4.0
242 LIBGTK_REQUIRED=2.4.0
244 AC_SUBST(EPIPHANY_REQUIRED)
245 AC_SUBST(LIBGLIB_REQUIRED)
246 AC_SUBST(LIBGTK_REQUIRED)
248 PKG_CHECK_MODULES(EPIPHANY_DEPENDENCY, \
249                   glib-2.0 >= $LIBGLIB_REQUIRED \
250                   gmodule-2.0 \
251                   gtk+-2.0 >= $LIBGTK_REQUIRED \
252                   $EPIPHANY_PKGCONFIG >= $EPIPHANY_REQUIRED \
253                   )
254 AC_SUBST(EPIPHANY_DEPENDENCY_CFLAGS)
255 AC_SUBST(EPIPHANY_DEPENDENCY_LIBS)
257 if test "x$EPHY_VER" = "x1.2"; then
258 EPIPHANY_EXTENSIONS_DIR="`$PKG_CONFIG --variable=libdir epiphany-1.2`/epiphany/extensions"
259 else
260 EPIPHANY_EXTENSIONS_DIR="`$PKG_CONFIG --variable=extensionsdir epiphany-$EPHY_VER`"
262 AC_SUBST([EPIPHANY_EXTENSIONS_DIR])
264 else
265         enable_epiphany_extension=no
267 AM_CONDITIONAL(ENABLE_EPIPHANY_EXTENSION, test "x$enable_epiphany_extension" = "xyes")
271 # Check for libnotify
273 LIBNOTIFY_REQUIRED=0.2.2
274 AC_ARG_ENABLE(libnotify,
275             AC_HELP_STRING([--disable-libnotify],
276                            [Disable libnotify support]),,
277               enable_libnotify=auto)
278 if test "x$enable_libnotify" != "xno"; then
279         PKG_CHECK_MODULES(NOTIFY,                            \
280                           libnotify >= $LIBNOTIFY_REQUIRED,
281                           have_libnotify=yes,
282                           have_libnotify=no)
283         if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
284           AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
285         fi
286         if test "x$have_libnotify" = "xyes"; then
287              enable_libnotify=yes
288         fi
290 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
291 if test x$enable_libnotify = xyes ; then
292     # Find out the version of LIBNOTIFY we're using
293     libnotify_version=`pkg-config --modversion libnotify`
294     LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
295     LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
296     LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
297     if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
298         LIBNOTIFY_VERSION_MAJOR="0"
299     fi
300     if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
301         LIBNOTIFY_VERSION_MINOR="0"
302     fi
303     if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
304         LIBNOTIFY_VERSION_MICRO="0"
305     fi
306     echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
307     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
308     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
309     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
311     AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
312     AC_SUBST(NOTIFY_CFLAGS)
313     AC_SUBST(NOTIFY_LIBS)
318 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
319 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
321 AC_ARG_WITH([extension-prefix],
322     [  --with-extension-prefix=path              Epiphany extension prefix],    
323     [extension_prefix=$withval],
324     [extension_prefix=/]
326 EXTENSION_PREFIX="$extension_prefix"
327 AC_SUBST([EXTENSION_PREFIX])
329 dnl Stuff for the CORBA interface
330 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
332 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
333 AC_SUBST(ORBIT_IDL)
334                                                                                                                                                               
335 AC_OUTPUT([
336 Makefile
337 po/Makefile.in
338 src/Makefile
339 pixmaps/Makefile
340 data/Makefile
341 epiphany-extension/Makefile