2008-02-29 Cosimo Cecchi <cosimoc@gnome.org>
[nautilus.git] / configure.in
blobac829d831a0cfc62848588c989fc02dafe744d59
1 AC_PREREQ(2.54)
3 dnl ===========================================================================
5 m4_define(bonobo_activation_minver,    2.1.0)
6 m4_define(bonobo_minver,               2.1.0)
7 m4_define(eel_minver,                  2.21.90)
8 m4_define(esound_minver,               0.2.27)
9 m4_define(glib_minver,                 2.15.6)
10 m4_define(gnome_desktop_minver,        2.9.91)
11 m4_define(gnome_minver,                2.14.0)
12 m4_define(gnome_ui_minver,             2.6.0)
13 m4_define(orbit_minver,                2.4.0)
14 m4_define(pango_minver,                1.1.2)
15 m4_define(gtk_minver,                  2.11.6)
16 m4_define(rsvg_minver,                 2.0.1)
17 m4_define(xml_minver,                  2.4.7)
18 m4_define(startup_notification_minver, 0.8)
19 m4_define(exif_minver,                 0.5.12)
20 m4_define(beagle_minver,               0.0.12)
21 m4_define(tracker_minver,              0.0.1)
22 m4_define(exempi_minver,               1.99.2)
23 m4_define(exempi_minver_newapi,        1.99.5)
25 dnl 1. If the library code has changed at all since last release, then increment revision.
26 dnl 2. If any interfaces have been added, then increment current and set revision to 0.
27 dnl Interface break is not allowed.
28 m4_define(nautilus_extension_current,  2)
29 m4_define(nautilus_extension_revision, 0)
31 AC_INIT([nautilus],[2.21.93],
32         [http://bugzilla.gnome.org/enter_bug.cgi?product=nautilus])
34 dnl ===========================================================================
36 AC_CONFIG_SRCDIR(src)
37 AC_CONFIG_HEADERS(config.h)
39 AM_INIT_AUTOMAKE
40 AM_MAINTAINER_MODE
41 AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
43 AC_SUBST(BONOBO_ACTIVATION_REQUIRED, [bonobo_activation_minver])
44 AC_SUBST(BONOBO_REQUIRED, [bonobo_minver])
45 AC_SUBST(EEL_REQUIRED, [eel_minver])
46 AC_SUBST(ESOUND_REQUIRED, [esound_minver])
47 AC_SUBST(GLIB_REQUIRED [glib_minver])
48 AC_SUBST(GNOME_DESKTOP_REQUIRED, [gnome_desktop_minver])
49 AC_SUBST(GNOME_REQUIRED, [gnome_minver])
50 AC_SUBST(GNOME_UI_REQUIRED, [gnome_ui_minver])
51 AC_SUBST(ORBIT_REQUIRED, [orbit_minver])
52 AC_SUBST(PANGO_REQUIRED, [pango_minver])
53 AC_SUBST(GTK_REQUIRED, [gtk_minver])
54 AC_SUBST(RSVG_REQUIRED, [rsvg_minver])
55 AC_SUBST(XML_REQUIRED, [xml_minver])
56 AC_SUBST(STARTUP_NOTIFICATION_REQUIRED, [startup_notification_minver])
58 dnl We need to decrement current by one in the calculation of the age because
59 dnl the library was started with version "1:0:0" instead of "0:0:0"
60 AC_SUBST(NAUTILUS_EXTENSION_VERSION_INFO, [nautilus_extension_current]:[nautilus_extension_revision]:`expr [nautilus_extension_current] - 1`)
62 AC_C_BIGENDIAN
63 AC_C_CONST
64 AC_PROG_CC
65 AC_PROG_CPP
66 AC_PROG_INSTALL
67 AC_PROG_LN_S
68 AC_PROG_MAKE_SET
69 AM_DISABLE_STATIC
70 AC_LIBTOOL_WIN32_DLL
71 AM_PROG_LIBTOOL
72 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
74 if $PKG_CONFIG --atleast-version startup_notification_minver libstartup-notification-1.0; then
75   echo "Building with libstartup-notification"
76   AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1,
77             [define to enable startup notification support])
78   with_startup_notification=yes
79   STARTUP_NOTIFICATION_PACKAGE=libstartup-notification-1.0
80   EXTRA_CORE_MODULES="$EXTRA_CORE_MODULES libstartup-notification-1.0"
81 else
82   echo "***** WARNING: Building without libstartup-notification"
83   with_startup_notification=no
84   STARTUP_NOTIFICATION_PACKAGE=
87 AC_SUBST(STARTUP_NOTIFICATION_PACKAGE)
89 PKG_CHECK_MODULES(ALL, [
90         esound                  >= esound_minver
91         bonobo-activation-2.0   >= bonobo_activation_minver
92         eel-2.0                 >= eel_minver
93         glib-2.0                >= glib_minver
94         gnome-desktop-2.0       >= gnome_desktop_minver
95         gio-unix-2.0            
96         gio-2.0         
97         ORBit-2.0               >= orbit_minver
98         pango                   >= pango_minver
99         gtk+-2.0                >= gtk_minver
100         libbonobo-2.0           >= bonobo_minver
101         libgnome-2.0            >= gnome_minver
102         libgnomeui-2.0          >= gnome_ui_minver
103         librsvg-2.0             >= rsvg_minver
104         libxml-2.0              >= xml_minver
105         $STARTUP_NOTIFICATION_PACKAGE
107 dnl ==========================================================================
109 GETTEXT_PACKAGE=nautilus
110 AC_SUBST(GETTEXT_PACKAGE)
111 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
112                    [the gettext translation domain])
114 AM_GLIB_GNU_GETTEXT
115 GLIB_DEFINE_LOCALEDIR(GNOMELOCALEDIR)
117 IT_PROG_INTLTOOL([0.35.0])
119 dnl ==========================================================================
121 ENABLE_PROFILER=
122 AC_ARG_ENABLE(profiler,
123  AC_HELP_STRING([--enable-profiler], [Enable profiler]),
124  [ENABLE_PROFILER=1
125   AC_DEFINE(ENABLE_PROFILER, 1, [define to enable the profiler])])
127 profiling_support=off
128 if test "x$ENABLE_PROFILER" = "x1"
129 then
130         CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES $CFLAGS"
131         LDFLAGS="/gnome/GNOME2/lib/libprofiler.so -lpthread $LDFLAGS"
132         profiling_support=on
135 AC_SUBST(ENABLE_PROFILER)
136 AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
138 dnl ==========================================================================
140 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
142 dnl ==========================================================================
144 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
145 AC_SUBST(ORBIT_IDL)
147 dnl ==========================================================================
149 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/param.h)
150                               
151 dnl ==========================================================================
153 AC_CHECK_FUNCS(statfs statvfs)
154 AC_CHECK_HEADERS(sys/statfs.h sys/statvfs.h)
157 dnl if statfs() takes 2 arguments or 4 (Solaris)
159 if test "$ac_cv_func_statfs" = yes ; then
160   AC_MSG_CHECKING([number of arguments to statfs()])
161   AC_TRY_COMPILE([#include <unistd.h>
162   #ifdef HAVE_SYS_PARAM_H
163   #include <sys/param.h>
164   #endif
165   #ifdef HAVE_SYS_VFS_H
166   #include <sys/vfs.h>
167   #endif
168   #ifdef HAVE_SYS_MOUNT_H
169   #include <sys/mount.h>
170   #endif
171   #ifdef HAVE_SYS_STATFS_H
172   #include <sys/statfs.h>
173   #endif], [struct statfs st;
174   statfs(NULL, &st);],[
175     AC_MSG_RESULT([2])
176     AC_DEFINE(STATFS_ARGS, 2, [Number of arguments to statfs()])],[
177     AC_TRY_COMPILE([#include <unistd.h>
178   #ifdef HAVE_SYS_PARAM_H
179   #include <sys/param.h>
180   #endif
181   #ifdef HAVE_SYS_VFS_H
182   #include <sys/vfs.h>
183   #endif
184   #ifdef HAVE_SYS_MOUNT_H
185   #include <sys/mount.h>
186   #endif
187   #ifdef HAVE_SYS_STATFS_H
188   #include <sys/statfs.h>
189   #endif], [struct statfs st;
190   statfs(NULL, &st, sizeof (st), 0);],[
191       AC_MSG_RESULT([4])
192       AC_DEFINE(STATFS_ARGS, 4, [Number of arguments to statfs()])],[
193       AC_MSG_RESULT(unknown)
194       AC_MSG_ERROR([unable to determine number of arguments to statfs()])])])
195 fi dnl test "$ac_cv_func_statfs" = yes
197 dnl ==========================================================================
199 dnl X
201 x_libs="`$PKG_CONFIG --libs pangox`"
202 case x_libs in
203   *-lX11*) pango_omitted_x_deps=no ;;
204   *)       pango_omitted_x_deps=yes ;;
205 esac
207 x_cflags="`$PKG_CONFIG --cflags pangox`"
208 x_extra_libs=
210 if test $pango_omitted_x_deps = yes ; then
211   AC_PATH_XTRA
213   if test x$no_x = xyes ; then
214     AC_MSG_ERROR([X development libraries not found])
215   fi
217   x_libs="$X_LIBS -lX11 $X_EXTRA_LIBS"
218 fi  
220 ## Strip the .la files
222 x_libs_for_checks=$x_libs
223 #for I in $x_libs ; do
224 #  case $I in 
225 #    *.la) ;;
226 #    *) x_libs_for_checks="$x_libs_for_checks $I" ;;
227 #  esac
228 #done
230 AC_CHECK_LIB(X11, XOpenDisplay, :, 
231         AC_MSG_ERROR([*** libX11 not found.  Check 'config.log' for more details.]),
232         $x_libs_for_checks) 
234 dnl ==========================================================================
236 AM_CONDITIONAL(HAVE_EXIF, false)
238 dnl libexif checking
240 PKG_CHECK_MODULES(EXIF, libexif > exif_minver, [
241                   AM_CONDITIONAL(HAVE_EXIF, true)
242                   AC_DEFINE(HAVE_EXIF, 1, [Define to enable EXIF support])
243                   ], [
244                   PKG_CHECK_MODULES(EXIF, libexif = exif_minver, [
245                                     AM_CONDITIONAL(HAVE_EXIF, true)
246                                     AC_DEFINE(HAVE_OLD_EXIF, 1, [Define if your EXIF library has old API])
247                                     ], [AM_CONDITIONAL(HAVE_EXIF, false)])
248                   ])
250 AC_SUBST(EXIF_CFLAGS)
251 AC_SUBST(EXIF_LIBS)
253 dnl ==========================================================================
255 dnl exempi checking
257 PKG_CHECK_MODULES(EXEMPI, exempi-2.0 >= exempi_minver, [
258                   AM_CONDITIONAL(HAVE_EXEMPI, true)
259                   AC_DEFINE(HAVE_EXEMPI, 1, [Define to enable XMP support])
260                   ], [AM_CONDITIONAL(HAVE_EXEMPI, false)])
262 PKG_CHECK_MODULES(EXEMPI_NEW_API, exempi-2.0 >= exempi_minver_newapi,
263                   AC_DEFINE(HAVE_EXEMPI_NEW_API, 1, [Define if we have exempi with the new API]), true)
265 AC_SUBST(EXEMPI_CFLAGS)
266 AC_SUBST(EXEMPI_LIBS)
268 dnl ==========================================================================
269 dnl search implementations
270 dnl ****************************
272 AM_CONDITIONAL(HAVE_TRACKER, false)
274 dnl libtracker checking
275                                                   
276 AC_ARG_ENABLE(tracker, [  --disable-tracker     build without tracker support])
277 msg_tracker=no
278 if test "x$enable_tracker" != "xno"; then
279         PKG_CHECK_MODULES(TRACKER, tracker >= tracker_minver, [
280                           AM_CONDITIONAL(HAVE_TRACKER, true)
281                           AC_DEFINE(HAVE_TRACKER, 1, [Define to enable tracker support])
282                           ]
283                           msg_tracker=yes,
284                           [AM_CONDITIONAL(HAVE_TRACKER, false)])
285         AC_SUBST(TRACKER_CFLAGS)
286         AC_SUBST(TRACKER_LIBS)
289 dnl ==========================================================================
292 AM_CONDITIONAL(HAVE_BEAGLE, false)
294 dnl libbeagle checking
295                                                   
296 AC_ARG_ENABLE(beagle, [  --disable-beagle     build without beagle support])
297 msg_beagle=no
298 if test "x$enable_beagle" != "xno"; then
299         BEAGLE_PKGCONFIG=
300         if $PKG_CONFIG --exists libbeagle-1.0; then
301                 BEAGLE_PKGCONFIG=libbeagle-1.0
302         else
303                 BEAGLE_PKGCONFIG=libbeagle-0.0
304         fi
306         PKG_CHECK_MODULES(BEAGLE, $BEAGLE_PKGCONFIG >= beagle_minver, [
307                           AM_CONDITIONAL(HAVE_BEAGLE, true)
308                           AC_DEFINE(HAVE_BEAGLE, 1, [Define to enable beagle support])
309                           ]
310                           msg_beagle=yes,
311                           [AM_CONDITIONAL(HAVE_BEAGLE, false)])
312         AC_SUBST(BEAGLE_CFLAGS)
313         AC_SUBST(BEAGLE_LIBS)
316 dnl ==========================================================================
318 dnl ****************************
319 dnl *** Check for libselinux ***
320 dnl ****************************
321     
322 SELINUX_LIBS=
323 msg_selinux=no
324 AC_CHECK_LIB(selinux, is_selinux_enabled,
325    [AC_CHECK_HEADERS(selinux/selinux.h,
326      [AC_SEARCH_LIBS(selinux_raw_to_trans_context, selinux, 
327        [AC_DEFINE(HAVE_SELINUX, 1, [Define to 1 if libselinux is available])
328         SELINUX_LIBS="-lselinux"
329         msg_selinux=yes])
330      ])
331    ])
332 AC_SUBST(SELINUX_LIBS)
335 AC_ARG_ENABLE(empty_view,
336  AC_HELP_STRING([--enable-empty-view], [Enable empty view]),
337  [ENABLE_EMPTY_VIEW=1
338   AC_DEFINE(ENABLE_EMPTY_VIEW, 1, [define to enable the empty view that is used for performance measurement])])
340 AC_SUBST(ENABLE_EMPTY_VIEW)
341 AM_CONDITIONAL(ENABLE_EMPTY_VIEW, test "x$ENABLE_EMPTY_VIEW" = "x1")
343 dnl ==========================================================================
345 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
347 AC_ARG_ENABLE(more-warnings,
348 AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
349 set_more_warnings="$enableval",[
350 if test -f $srcdir/CVSVERSION; then
351         is_cvs_version=true
352         set_more_warnings=yes
353 else
354         set_more_warnings=no
357 AC_MSG_CHECKING(for more warnings, including -Werror)
358 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
359         AC_MSG_RESULT(yes)
360         WARNING_CFLAGS="\
361         -Wall \
362         -Wmissing-declarations -Wmissing-prototypes \
363         -Wnested-externs -Wpointer-arith \
364         -Wcast-align \
365         -Werror"
367         for option in -Wno-strict-aliasing -Wno-pointer-sign; do
368                 SAVE_CFLAGS="$WARNING_CFLAGS"
369                 WARNING_CFLAGS="$WARNING_CFLAGS $option"
370                 AC_MSG_CHECKING([whether gcc understands $option])
371                 AC_TRY_COMPILE([], [],
372                         has_option=yes,
373                         has_option=no,)
374                 if test $has_option = no; then
375                         WARNING_CFLAGS="$SAVE_CFLAGS"
376                 fi
377                 AC_MSG_RESULT($has_option)
378                 unset has_option
379                 unset SAVE_CFLAGS
380         done
381         unset option
382 else
383         AC_MSG_RESULT(no)
386 dnl ==========================================================================
388 dnl gsequence
389 GSEQUENCE_MODULES="glib-2.0"
390 GSEQUENCE_CFLAGS="`$PKG_CONFIG --cflags $GSEQUENCE_MODULES`"
391 AC_SUBST(GSEQUENCE_CFLAGS)
392         
393 dnl libegg
394 LIBEGG_MODULES="gtk+-2.0 libgnome-2.0"
395 LIBEGG_CFLAGS="`$PKG_CONFIG --cflags $LIBEGG_MODULES`"
396 AC_SUBST(LIBEGG_CFLAGS)
398 # check for gsequence in glib
399 PKG_CHECK_EXISTS([glib-2.0 >= 2.13.0],[have_glib_2_14=yes],[have_glib_2_14=no])
400 AM_CONDITIONAL([HAVE_GLIB_2_14],[test "$have_glib_2_14" = "yes"])
402 dnl libnautilus-extension
403 LIBNAUTILUS_EXTENSION_MODULES="glib-2.0 gtk+-2.0"
404 LIBNAUTILUS_EXTENSION_CFLAGS="`$PKG_CONFIG --cflags $LIBNAUTILUS_EXTENSION_MODULES` $WARNING_CFLAGS"
405 AC_SUBST(LIBNAUTILUS_EXTENSION_CFLAGS)
406 LIBNAUTILUS_EXTENSION_LIBS="`$PKG_CONFIG --libs $LIBNAUTILUS_EXTENSION_MODULES`"
407 AC_SUBST(LIBNAUTILUS_EXTENSION_LIBS)
409 dnl core nautilus (must list bonobo-activation and libbonobo because idldir does not respect "requires")
410 CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 esound gnome-desktop-2.0 gio-2.0 gio-unix-2.0 $EXTRA_CORE_MODULES"
411 CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES` $x_cflags $WARNING_CFLAGS"
412 AC_SUBST(CORE_CFLAGS)
413 CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $x_libs"
414 AC_SUBST(CORE_LIBS)
415 CORE_IDL_INCLUDES="`$PKG_CONFIG --variable=idldir $CORE_MODULES | $srcdir/add-include-prefix`"
416 AC_SUBST(CORE_IDL_INCLUDES)
418 DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
420 dnl Multimedia keys
421 AC_CHECK_HEADERS([X11/XF86keysym.h])
424 dnl Taken out for now
425 dnl     -DGDK_DISABLE_DEPRECATED \
426 dnl     -DGDK_PIXBUF_DISABLE_DEPRECATED \
427 dnl     -DGTK_DISABLE_DEPRECATED \
428 dnl     -DGNOME_DISABLE_DEPRECATED"
430 dnl FIXME: put this back once the registration_id stuff is cleared up.
431 dnl     -DBONOBO_DISABLE_DEPRECATED
433 AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
435 dnl libbackground
436 PKG_CHECK_MODULES(LIBBACKGROUND, "gtk+-2.0 gconf-2.0 libgnomeui-2.0")
437 dnl ==========================================================================
439 dnl ==============================================
440 dnl Special GConf section 
441 dnl ==============================================
443 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
445 if test x"$GCONFTOOL" = xno; then
446   AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
449 AM_GCONF_SOURCE_2
451 dnl ==========================================================================
453 AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database, no)
455 AC_ARG_ENABLE(update-mimedb,
456    AC_HELP_STRING([--disable-update-mimedb],
457                    [disable the update-mime-database after install [default=no]]),,
458     enable_update_mimedb=yes)
459 AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes)
461         
462 AC_CONFIG_FILES([
463 Makefile
464 cut-n-paste-code/Makefile
465 cut-n-paste-code/libegg/Makefile
466 cut-n-paste-code/gsequence/Makefile
467 cut-n-paste-code/widgets/Makefile
468 data/Makefile
469 data/icons/Makefile
470 data/icons/16x16/Makefile
471 data/icons/16x16/apps/Makefile
472 data/icons/22x22/Makefile
473 data/icons/22x22/apps/Makefile
474 data/icons/24x24/Makefile
475 data/icons/24x24/apps/Makefile
476 data/icons/32x32/Makefile
477 data/icons/32x32/apps/Makefile
478 data/icons/scalable/Makefile
479 data/icons/scalable/apps/Makefile
480 data/patterns/Makefile
481 docs/Makefile
482 icons/Makefile
483 libbackground/Makefile
484 libnautilus-private/Makefile
485 libnautilus-extension/Makefile
486 libnautilus-extension/libnautilus-extension.pc
487 libnautilus-extension/libnautilus-extension-uninstalled.pc
488 nautilus.spec
489 nautilus-computer.desktop.in
490 nautilus-file-management-properties.desktop.in
491 nautilus-home.desktop.in
492 nautilus.desktop.in
493 nautilus-folder-handler.desktop.in
494 nautilus-autorun-software.desktop.in
495 po/Makefile.in
496 src/Makefile
497 src/file-manager/Makefile
498 test/Makefile
501 AC_OUTPUT
503 dnl ==========================================================================
504 echo "
505 nautilus-$VERSION:
507         prefix:                 ${prefix}
508         source code location:   ${srcdir}
509         compiler:               ${CC}
510         tracker support:        $msg_tracker
511         beagle support:         $msg_beagle
513         profiling support:      ${profiling_support}