bgo #706630 - Incorrect MimeType in .desktop file
[anjuta.git] / configure.ac
blobdbd56c2004149af2f0a3a33c1abc4f77ac102b0b
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.65)
5 m4_define(anjuta_major_version,   3)
6 m4_define(anjuta_minor_version,   9)
7 m4_define(anjuta_micro_version,  91)
8 m4_define(anjuta_version, anjuta_major_version.anjuta_minor_version.anjuta_micro_version)
9 m4_define(bugzilla_version, anjuta_major_version.anjuta_minor_version.anjuta_micro_version)
11 AC_INIT([Anjuta],[anjuta_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=anjuta],[anjuta],[http://www.anjuta.org/])
13 AC_CONFIG_HEADERS([config.h])
14 AC_CONFIG_SRCDIR([src/main.c])
15 AC_CONFIG_MACRO_DIR([m4])
18 AC_DEFINE(ANJUTA_MAJOR_VERSION, anjuta_major_version, [Anjuta major version])
19 AC_SUBST(ANJUTA_MAJOR_VERSION, anjuta_major_version)
20 AC_DEFINE(ANJUTA_MINOR_VERSION, anjuta_minor_version, [Anjuta minor version])
21 AC_SUBST(ANJUTA_MINOR_VERSION, anjuta_minor_version)
22 AC_DEFINE(ANJUTA_MICRO_VERSION, anjuta_micro_version, [Anjuta micro version])
23 AC_SUBST(ANJUTA_MICRO_VERSION, anjuta_micro_version)
24 AC_DEFINE(ANJUTA_VERSION, anjuta_version, [Anjuta version])
25 AC_SUBST(ANJUTA_VERSION)
27 ANJUTA_VERSION=anjuta_version
28 AC_SUBST(ANJUTA_VERSION)
30 BUGZILLA_VERSION=bugzilla_version
31 AC_SUBST(BUGZILLA_VERSION)
33 dnl Anjuta core
34 GLIB_REQUIRED=2.34.0
35 GTK_REQUIRED=3.6.0
36 GTHREAD_REQUIRED=2.22.0
37 GDK_PIXBUF_REQUIRED=2.0.0
38 GDA4_REQUIRED=4.2.0
39 GDA5_REQUIRED=5.0.0
40 LIBXML_REQUIRED=2.4.23
41 GDL_REQUIRED=3.5.5
42 LIBWNCK_REQUIRED=2.12
44 dnl GtkSourceView
45 GTKSOURCEVIEW_REQUIRED=3.0.0
47 dnl Terminal
48 VTE_REQUIRED=0.27.6
50 dnl Devhelp
51 LIBDEVHELP_REQUIRED=3.7.4
53 dnl Glade
54 GLADEUI_REQUIRED=3.12.0
56 dnl Introspection
57 GI_REQUIRED=0.9.5
59 dnl Subversion plugin
60 NEON_REQUIRED=0.28.2
61 SVN_MAJOR=1
62 SVN_MINOR=5
63 SVN_PATCH=0
64 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
66 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip])
67 AM_MAINTAINER_MODE([enable])
69 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
71 dnl Check for C Compiler
72 AC_PROG_CC
73 AC_PROG_CPP
74 AC_PROG_LEX
75 if test "$LEX" != "flex"; then
76         AC_MSG_ERROR(flex is required)
78 AC_PROG_YACC
79 if test "$YACC" != "bison -y"; then
80         AC_MSG_ERROR(bison is required)
82 AC_LANG([C])
83 AC_LANG([C++])
84 AC_PROG_CXX
85 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],,
86    AC_MSG_ERROR([C++ Compiler required to compile Anjuta]))
87 AM_PROG_CC_C_O
89 GNOME_COMPILE_WARNINGS([maximum])
90 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
91 AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
93 dnl Enable debugging mode
94 AC_ARG_ENABLE(debug,
95   AS_HELP_STRING([--enable-debug],[Enable debug messages]),
96   [if test "x$enableval" = "xyes"; then
97       AM_CFLAGS="$AM_CFLAGS -DDEBUG"
98   fi]
99   AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG")
100 AC_SUBST(AM_CFLAGS)
101 AC_SUBST(AM_CXXFLAGS)
103 ANJUTA_LDFLAGS="-no-undefined"
104 ANJUTA_PLUGIN_LDFLAGS="-module -avoid-version -no-undefined"
105 AC_SUBST(ANJUTA_LDFLAGS)
106 AC_SUBST(ANJUTA_PLUGIN_LDFLAGS)
108 dnl GSettings
109 GLIB_GSETTINGS
111 dnl Disable deprecated APIs
112 dnl if test x$MAINT = x; then
113 dnl     DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
114 dnl     AC_SUBST(DEPRECATED_FLAGS)
115 dnl fi
117 dnl Check for pkg-config
118 PKG_PROG_PKG_CONFIG([0.22])
120 dnl Enable versioned user preferences directory
121 AC_ARG_WITH(pref-suffix,
122   AS_HELP_STRING([--with-pref-suffix=VALUE],[Suffix to add to user preferences dir.]),
123   PREF_SUFFIX="$withval")
125 AC_SUBST(PREF_SUFFIX)
126 AC_DEFINE_UNQUOTED(PREF_SUFFIX,
127       "${PREF_SUFFIX}",
128           [Suffix to add to preferences directory])
130 # Initialize libtool
131 LT_PREREQ([2.2])
132 LT_INIT([disable-static])
134 dnl ***************************************************************************
135 dnl Check for GObject-Introspection
136 dnl ***************************************************************************
137 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [GOBJECT_INTROSPECTION_CHECK([0.6.7])],
138 [AM_CONDITIONAL(HAVE_INTROSPECTION, false)])
140 dnl ***************************************************************************
141 dnl Set gjsdir
142 dnl ***************************************************************************
143 gjsdir=`pkg-config --variable=jsdir gjs-1.0`
144 AC_SUBST(gjsdir)
146 dnl Check base modules
148 PKG_CHECK_MODULES([ANJUTA],
149    [gthread-2.0 >= $GTHREAD_REQUIRED
150         glib-2.0 >= $GLIB_REQUIRED
151         gio-2.0 >= $GLIB_REQUIRED
152         gmodule-2.0 >= $GLIB_REQUIRED
153         gtk+-3.0 >= $GTK_REQUIRED
154         gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
156 PKG_CHECK_MODULES([XML],
157    [libxml-2.0 >= $LIBXML_REQUIRED])
159 PKG_CHECK_MODULES([GDL],
160    [gdl-3.0 >= $GDL_REQUIRED])
162 PKG_CHECK_MODULES([GDA],
163    [libgda-5.0 >= $GDA5_REQUIRED],,
164    [PKG_CHECK_MODULES([GDA],
165       [libgda-4.0 >= $GDA4_REQUIRED])])
167 dnl Check for autogen
168 dnl -----------------
169 AC_PATH_PROG(AUTOGEN_PATH, autogen,no)
170 if test x$AUTOGEN_PATH = xno; then
171    AC_MSG_WARN([Couldn't find autogen. You will be able to build anjuta without autogen \
172                 but several things won't work. You can get it from http://autogen.sourceforge.net/])
175 dnl Check for Terminal
176 dnl ---------------------
178 AC_ARG_ENABLE(plugin-terminal,
179   AS_HELP_STRING([--disable-plugin-terminal],[Disable terminal plugin support in Anjuta.]),
180   [ if test "$enableval" = "no"; then
181        user_disabled_terminal=1
182     fi ],
183   [ user_disabled_terminal=0 ] )
185 AC_MSG_CHECKING(if terminal plugin is disabled)
186 if test "$user_disabled_terminal" = 1; then
187         AC_MSG_RESULT(yes)
188         terminal_enabled="no"
189 else
190         AC_MSG_RESULT(no)
191         PKG_CHECK_MODULES(PLUGIN_TERMINAL, [vte-2.90 >= $VTE_REQUIRED],
192             [
193                 terminal_enabled=yes
194             ], [
195                 terminal_enabled=no
196             ])
199 AM_CONDITIONAL(HAVE_PLUGIN_TERMINAL, [test x$terminal_enabled = xyes])
201 dnl Check for Devhelp
202 dnl -----------------
204 AC_ARG_ENABLE(plugin-devhelp,
205   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
206   [ if test "$enableval" = "no"; then
207        user_disabled_devhelp=1
208     fi ],
209   [ user_disabled_devhelp=0 ] )
211 AC_MSG_CHECKING(if devhelp plugin is disabled)
212 if test "$user_disabled_devhelp" = 1; then
213         AC_MSG_RESULT(yes)
214         devhelp_enabled="no"
215 else
216         AC_MSG_RESULT(no)
217         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
218                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
219                                 [
220                                     devhelp_enabled=yes
221                                 ], [
222                                     devhelp_enabled=no
223                                 ])
226 if test "x$devhelp_enabled" = "xyes"; then
227         case "$PLUGIN_DEVHELP_LIBS" in
228                 *webkit2gtk-3.0*)
229                         AC_DEFINE([HAVE_WEBKIT2], [1], [Defined if devhelp is built against webkitgtk2])
230                         ;;
231                 esac
233 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
235 dnl Check for Glade3
236 dnl ---------------------
238 AC_ARG_ENABLE(plugin-glade,
239   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
240   [ if test "$enableval" = "no"; then
241        user_disabled_glade=1
242     fi ],
243   [ user_disabled_glade=0 ] )
245 AC_MSG_CHECKING(if glade plugin is disabled)
246 if test "$user_disabled_glade" = 1; then
247         AC_MSG_RESULT(yes)
248         gladeui_found="no"
249 else
250         AC_MSG_RESULT(no)
251         gladeui_version=0
252         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
253             [
254                 gladeui_found=yes
255             ], [
256                 gladeui_found=no
257             ])
260 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
262 dnl Glade catalog
263 dnl ---------------------
265 AC_ARG_ENABLE(glade-catalog,
266   AS_HELP_STRING([--enable-glade-catalog], [Enable glade catalog. Glade UI libraries must be installed]),
267   [ user_enabled_glade_catalog=1 ],
268   [ user_enabled_glade_catalog=0 ])
270 glade_catalog_enabled="no"
272 AC_MSG_CHECKING(if glade catalog is enabled)
273 if test "$gladeui_found" = "yes"; then
274   if test "$user_enabled_glade_catalog" = 1; then
275     AC_MSG_RESULT(yes)
276     glade_catalog_enabled="yes"
277     GLADE_CATALOG_PATH=`pkg-config --variable=catalogdir gladeui-2.0`
278     GLADE_PLUGINS_PATH=`pkg-config --variable=moduledir gladeui-2.0`
280     AC_SUBST(GLADE_CATALOG_PATH)
281     AC_SUBST(GLADE_PLUGINS_PATH)
282   else
283     AC_MSG_RESULT(no) 
284   fi
285 else
286   AC_MSG_RESULT(no)
289 AM_CONDITIONAL(ENABLE_GLADE_CATALOG, [test x$glade_catalog_enabled = xyes])
291 dnl Check for gtksourceview
292 dnl -------------------------------------------------------------
293 PKG_CHECK_MODULES(SOURCEVIEW,
294                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
297 dnl Check for libsqlite3 used in symbol-db benchmarks
298 dnl -------------------------------------------------------------
299 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite3_found=yes, sqlite3_found=no)
300 AM_CONDITIONAL(HAVE_SQLITE, [test x$sqlite3_found = xyes])
303 dnl Check for vala
304 dnl -------------------------------------------------------------
306 AC_ARG_ENABLE(vala,
307         AS_HELP_STRING([--disable-vala],[Disable vala support]),
308         [ if test "$enableval" = "no"; then
309                 user_disabled_vala=1
310           fi ],
311         [ user_disabled_vala=0 ])
313 AC_MSG_CHECKING(if vala support is disabled)
314 if test "$user_disabled_vala" = 1; then
315         AC_MSG_RESULT(yes)
316         enable_vala="no"
317 else
318         AC_MSG_RESULT(no)
319         AC_MSG_CHECKING(if libvala is available)
320         m4_foreach([VERSION], [[0.18], [0.20], [0.22]],
321                 [PKG_CHECK_EXISTS([ libvala-VERSION ],
322                          [ valaver="-VERSION" ])
323                          ])
324         if test "x$valaver" != "x"; then
325                 AC_MSG_RESULT(yes)
326                 enable_vala="yes"
327                 LIBVALA="libvala${valaver}"
328                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
329         else
330                 AC_MSG_RESULT(no)
331                 enable_vala="no"
332                 VALA_REQUIRED=0.18.0
333         fi
334         AC_SUBST(LIBVALA)
337 if test x$enable_vala = xyes; then
338         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
339         AC_SUBST(VALAC)
342 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
344 dnl Check for Python
345 dnl -------------------------------------------------------------
347 AM_PATH_PYTHON([],
348         [have_python="yes"],
349         [have_python="no"])
351 if test x$have_python = xyes; then
352         if test -x $PYTHON-config; then
353                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
354                 PYTHON_LIBS=`$PYTHON-config --libs`
355                 AC_SUBST(PYTHON_CFLAGS)
356                 AC_SUBST(PYTHON_LIBS)
357         elif test -x $PYTHON$PYTHON_VERSION-config; then
358                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
359                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
360                 AC_SUBST(PYTHON_CFLAGS)
361                 AC_SUBST(PYTHON_LIBS)           
362         else
363                 have_python="no"
364                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
365         fi
368 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
370 dnl Disable packagekit support
371 dnl -----------------------------------
372 AC_ARG_ENABLE(packagekit,
373   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
374   [enable_packagekit=yes])
375 if test "x$enable_packagekit" != "xno"; then
376   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
379 dnl Setup Anjuta Library flags
380 dnl --------------------------
381 LIBANJUTA_CFLAGS='$(ANJUTA_CFLAGS) $(GDL_CFLAGS) $(DEPRECATED_FLAGS) -I$(top_srcdir) -I$(top_builddir)/libanjuta -DPACKAGE_PIXMAPS_DIR=\""$(datadir)/pixmaps/$(PACKAGE)"\" -DPACKAGE_LIB_DIR=\""$(pkglibdir)"\" -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\"'
382 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
383 AC_SUBST(LIBANJUTA_CFLAGS)
384 AC_SUBST(LIBANJUTA_LIBS)
386 dnl Setup FooCanvas Library flags
387 dnl --------------------------
388 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
389 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
390 AC_SUBST(LIBFOOCANVAS_CFLAGS)
391 AC_SUBST(LIBFOOCANVAS_LIBS)
393 dnl Checks for Xft/XRender for foocanvas
395 AC_CHECK_LIB(Xrender, XRenderFindFormat,
396         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
397          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
398         [AC_SUBST(RENDER_LIBS, "")],
399         [-lXext])
401 dnl Setup Plugin directories
402 dnl ------------------------
403 anjuta_plugin_dir='$(libdir)/anjuta'
404 anjuta_data_dir='$(datadir)/anjuta'
405 anjuta_ui_dir='$(datadir)/anjuta/ui'
406 anjuta_glade_dir='$(datadir)/anjuta/glade'
407 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
408 AC_SUBST(anjuta_plugin_dir)
409 AC_SUBST(anjuta_data_dir)
410 AC_SUBST(anjuta_ui_dir)
411 AC_SUBST(anjuta_glade_dir)
412 AC_SUBST(anjuta_image_dir)
414 dnl ***************************************************************************
415 dnl Check for marshal and enum generators
416 dnl ***************************************************************************
417 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
418 AC_SUBST(GLIB_GENMARSHAL)
419 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
420 AC_SUBST(GLIB_MKENUMS)
422 dnl ***************************************************************************
423 dnl Internatinalization
424 dnl ***************************************************************************
425 IT_PROG_INTLTOOL([0.40.1])
427 AM_GNU_GETTEXT([external])
428 AM_GNU_GETTEXT_VERSION([0.17])
430 GETTEXT_PACKAGE=anjuta
431 AC_SUBST(GETTEXT_PACKAGE)
432 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
434 BISON_I18N
436 dnl ***************************************************************************
437 dnl Check for gtk-doc.
438 dnl ***************************************************************************
439 GTK_DOC_CHECK([1.4])
441 dnl ***************************************************************************
442 dnl User manual
443 dnl ***************************************************************************
444 YELP_HELP_INIT
446 dnl Define convenience macros
447 dnl -------------------------
448 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
449 AC_DEFUN([CHECK_HEADER_DEFINE],
451         AC_MSG_CHECKING("if $1 is defined in $2")
452         AC_EGREP_CPP(yes,
453 [#include <$2>
454 #ifdef $1
455   yes
456 #endif
457 ], [
458         AC_MSG_RESULT(yes)
459         $3
460 ], [
461         AC_MSG_RESULT(no)
462         $4
463 ]) ])
465 dnl Checks for header files.
466 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
467 AC_CHECK_HEADERS(time.h types.h unistd.h)
468 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
470 dnl Checks for typedefs, structures, and compiler characteristics.
472 AC_CANONICAL_HOST
473 CYGWIN=no
474 MINGW32=no
475 case $host_os in
476   *cygwin* ) CYGWIN=yes;;
477   *mingw32* ) MINGW32=yes;;
478 esac
481 dnl Check for bind in libsocket (needed on Solaris)
482 AC_CHECK_LIB(socket, bind)
484 dnl Check for function forkpty and related headers
485 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
486 AC_CHECK_HEADERS(libutil.h util.h pty.h)
488 dnl Checks for library functions.
489 AC_CHECK_FUNCS(fnmatch)
490 AC_CHECK_FUNCS(strstr)
491 AC_CHECK_FUNCS(stricmp)
492 AC_CHECK_FUNCS(strnicmp)
493 AC_CHECK_FUNCS(getline)
495 dnl for libegg/egg-recent-model.c
496 AC_CHECK_DECLS([lockf])
497 AC_CHECK_FUNCS([lockf])
499 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
501 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
502 if test "$have_fgetpos" != yes ; then
503     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
504         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
505             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
508 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
509 if test "$have_mkstemp" != yes ; then
510     AC_CHECK_FUNCS(chmod)
511     if test "$tmpdir_specified" = yes ; then
512         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
513     fi
514 else
515     AC_MSG_CHECKING(directory to use for temporary files)
516     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
517         then tmpdir=/tmp
518         else tmpdir="$enable_tmpdir"
519     fi
520     if test -d $tmpdir ; then
521         AC_MSG_RESULT($tmpdir)
522         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
523     else
524         AC_MSG_WARN($tmpdir does not exist)
525     fi
528 dnl -----------------------------
529 dnl Checks for FreeBSD Build
530 dnl -----------------------------
531 AC_MSG_CHECKING(if building on FreeBSD)
533 if test `uname -s` = "FreeBSD" ; then
534         AC_MSG_RESULT(yes)
535         FREEBSD_BUILD=-DFREEBSD
536         AC_SUBST(FREEBSD_BUILD)
537         AC_PATH_PROG(GMAKE, gmake, no)
538         if test "x$GMAKE" = "xno"; then
539                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
540         fi
541 else
542         AC_MSG_RESULT(no)
543         GMAKE="make"
546 AC_SUBST(GMAKE)
548 dnl Checks for missing prototypes
549 dnl -----------------------------
550 AC_MSG_NOTICE([checking for missing prototypes...])
552 AC_DEFUN([CHECK_PROTO], [AC_EGREP_HEADER([[^A-Za-z0-9_]$1([   ]+[A-Za-z0-9_]*)?\(], $2,, AC_DEFINE(patsubst([NEED_PROTO_NAME], [NAME], translit($1, [a-z], [A-Z])),,[Do not know]) AC_MSG_RESULT(adding prototype for $1))])
554 if test "$have_remove" = yes ; then
555     CHECK_PROTO(remove, stdio.h)
556 else
557     CHECK_PROTO(unlink, unistd.h)
559 CHECK_PROTO(malloc, stdlib.h)
560 CHECK_PROTO(getenv, stdlib.h)
561 CHECK_PROTO(stat,   sys/stat.h)
562 CHECK_PROTO(lstat,  sys/stat.h)
563 if test "$have_fgetpos" = yes ; then
564     CHECK_PROTO(fgetpos, stdio.h)
566 if test "$have_truncate" = yes ; then
567     CHECK_PROTO(truncate, unistd.h)
569 if test "$have_ftruncate" = yes ; then
570     CHECK_PROTO(ftruncate, unistd.h)
573 dnl  **********************************************************
574 dnl  check if we have svn libraries to build subversion plugin
575 dnl  (stolen from kdevelop ;-)
576 dnl  **********************************************************
578 AC_MSG_CHECKING(for Subversion svn-config)
579 AC_ARG_WITH(subversion-dir,
580                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
581                 [
582                                 SVNCONFIG="$withval/bin/svn-config"
583                 ])
585 if test -z "$SVNCONFIG"; then
586                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
587                 if test -n "$_SVNCONFIG"; then
588                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
589                 fi
592 AC_SUBST(SVNCONFIG)
593 if test -x "$SVNCONFIG"; then
594                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
595                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
596                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
597                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
598                 AC_MSG_RESULT(yes)
599 else
600                 AC_MSG_RESULT(not found)
602                 dnl just a fallback to debian's config so that it works for me :)
603                 AC_ARG_WITH(svn-include,
604                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
605                                                                 [
606                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
607                                                                                 SVN_INCLUDES=$withval
608                                                                 fi
609                                                                 ])
610                 if test -z "$SVN_INCLUDES"; then
611                         SVN_INCLUDES="/usr/local/include /usr/include"
612                 fi
613                 AC_MSG_CHECKING([for Subversion headers])
614                 SVN_INCLUDE=""
615                 for VALUE in $SVN_INCLUDES ; do
616                                 if test -f $VALUE/subversion-1/svn_types.h ; then
617                                                 SVN_INCLUDE=$VALUE/subversion-1
618                                                 break
619                                 fi
620                                 if test -f $VALUE/svn_types.h ; then
621                                                 SVN_INCLUDE=$VALUE
622                                                 break
623                                 fi
624                 done
625                 if test $SVN_INCLUDE ; then
626                                 AC_MSG_RESULT([found])
627                 else
628                                 AC_MSG_RESULT([not found])
629                 fi
630                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
631                 AC_ARG_WITH(svn-lib,
632                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
633                                                 [
634                                                         if test "$withval" != "yes" -a "$withval" != ""; then
635                                                                 SVN_LIBS=$withval
636                                                         fi
637                                                 ])
638                 AC_MSG_CHECKING([for Subversion libraries])
639                 SVN_LIB=""
640                 for VALUE in $SVN_LIBS ; do
641                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
642                                                 SVN_LIB=$VALUE
643                                                 break
644                                 fi
645                 done
646                 if test $SVN_LIB ; then
647                                 AC_MSG_RESULT([found])
648                 else
649                                 AC_MSG_RESULT([not found])
650                 fi
653 dnl ******************************************************************
654 dnl Check for extra libs required by subversion.
655 dnl FIXME: This should actually be done by subversion and not by us.
656 dnl ******************************************************************
658 AC_ARG_ENABLE(plugin-subversion,
659   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
660   [ if test "$enableval" = "no"; then
661         user_disabled_subversion=1
662     fi ],
663   [ user_disabled_subversion=0 ] )
665 AC_MSG_CHECKING(if subversion support is disabled)
666 if test "$user_disabled_subversion" = 1; then
667         AC_MSG_RESULT(yes)
668         SVN_INCLUDE=""
669         SVN_LIB=""
670 else
671         AC_MSG_RESULT(no)
674 if test -n "$SVN_INCLUDE" ; then
675         dnl ------------------------------------
676         dnl APR. Required by subversion (devel)
677         dnl ------------------------------------
678         have_atr=no
679         PKG_CHECK_MODULES(APR,                            \
680                 apr-1, have_apr=yes, have_apr=no)
681         if test x"$have_apr" = "xno"; then
682                 SVN_INCLUDE=""
683         fi
685         dnl -----------------------------------------
686         dnl APR util. Required by subversion (devel)
687         dnl------------------------------------------
688         have_atr_util=no
689         PKG_CHECK_MODULES(APR_UTILS,                            \
690                 apr-util-1, have_apr_util=yes, have_apr_util=no)
691         if test x"$have_apr_util" = "xno"; then
692                 SVN_INCLUDE=""
693         fi
695         dnl -----------------------------------------
696         dnl NEON. Required by subversion (devel)
697         dnl------------------------------------------
698         have_neon=no
699         PKG_CHECK_MODULES(NEON,                            \
700                 neon, have_neon=yes, have_neon=no)
701         if test x"$have_neon" = "xno"; then
702                 SVN_INCLUDE=""
703         fi
705         dnl Make sure our SVN version is high enough
706         dnl Eww, eww, eww, this is dirty
707         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
708         AC_LANG([C])
709         dnl Temporarily set CFLAGS so that include dirs are found
710         CFLAGS_TMP=$CFLAGS
711         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
712         AC_COMPILE_IFELSE(
713                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
714                         [[
715                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
716                                 #       error "Version too low"
717                                 #endif
718                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
719         if test x"$have_svn_version" = "xno"; then
720                 AC_MSG_RESULT(no)
721                 SVN_INCLUDE=""
722         fi
723         CFLAGS=$CFLAGS_TMP
726 dnl ------------------------------------------
727 dnl Finally prepare subversion build flags
728 dnl ------------------------------------------
730 if test -n "$SVN_INCLUDE" ; then
731         SVN_INCLUDE="-I$SVN_INCLUDE"
732         if test x != "x$SVN_LIB" ; then
733             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
734         else
735             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
736         fi
737         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
740 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
741 AC_SUBST(SVN_INCLUDE)
742 AC_SUBST(SVN_LIB)
743 AC_SUBST(SVN_CFLAGS)
745 dnl ------------------------------------------
746 dnl Symbol-db shared memory checks
747 dnl ------------------------------------------
749 SYMBOL_DB_SHM="/dev/shm"
750 user_specified_shm=0
751 AC_MSG_CHECKING(for symbol-db shared memory)
752 AC_ARG_WITH(symbol-db-shm,
753                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
754                 [
755                                 user_specified_shm=1
756                                 SYMBOL_DB_SHM="$withval"
757                 ])
758 if test "$user_specified_shm" = 1; then
759         AC_MSG_RESULT(yes)
760 else
761         AC_MSG_RESULT(no)
764 AC_SUBST(SYMBOL_DB_SHM)
766 dnl On Linux, need librt for shm_open/shm_unlink
767 bck_LIBS="$LIBS"
768 AC_SEARCH_LIBS(shm_open, rt, [SHM_LIBS="$LIBS"], [AC_MSG_ERROR([Failed to find library with shm_open()])])
769 AC_SUBST(SHM_LIBS)
770 LIBS="$bck_LIBS"
772 dnl Test using autotest
773 dnl -----------------------------
774 AC_CONFIG_TESTDIR(plugins/am-project/tests)
775 AM_MISSING_PROG([AUTOM4TE], [autom4te])
777 AC_CONFIG_FILES([
778 Makefile
779 po/Makefile.in
780 libanjuta/Makefile
781 libanjuta/tests/Makefile
782 libanjuta/interfaces/Makefile
783 libanjuta/libanjuta-3.0.pc
784 libanjuta/anjuta-version.h
785 src/Makefile
786 pixmaps/Makefile
787 pixmaps/hicolor/Makefile
788 pixmaps/hicolor/16x16/Makefile
789 pixmaps/hicolor/22x22/Makefile
790 pixmaps/hicolor/24x24/Makefile
791 pixmaps/hicolor/32x32/Makefile
792 pixmaps/hicolor/48x48/Makefile
793 pixmaps/hicolor/scalable/Makefile
794 pixmaps/HighContrast/Makefile
795 pixmaps/HighContrast/16x16/Makefile
796 pixmaps/HighContrast/22x22/Makefile
797 pixmaps/HighContrast/24x24/Makefile
798 pixmaps/HighContrast/32x32/Makefile
799 pixmaps/HighContrast/48x48/Makefile
800 pixmaps/HighContrast/256x256/Makefile
801 data/Makefile
802 data/welcome.txt
803 data/templates/Makefile
804 doc/anjuta.1
805 doc/anjuta-launcher.1
806 doc/Makefile
807 scripts/Makefile
808 launcher/Makefile
809 plugins/Makefile
810 plugins/class-gen/Makefile
811 plugins/class-gen/templates/Makefile
812 plugins/patch/Makefile
813 plugins/document-manager/Makefile
814 plugins/document-manager/images/Makefile
815 plugins/message-view/Makefile
816 plugins/gdb/Makefile
817 plugins/gdb/images/Makefile
818 plugins/debug-manager/Makefile
819 plugins/debug-manager/images/Makefile
820 plugins/devhelp/Makefile
821 plugins/devhelp/images/Makefile
822 plugins/glade/Makefile
823 plugins/glade/images/Makefile
824 plugins/js-debugger/Makefile
825 plugins/file-manager/Makefile
826 plugins/file-loader/Makefile
827 plugins/file-wizard/Makefile
828 plugins/build-basic-autotools/Makefile
829 plugins/project-manager/Makefile
830 plugins/symbol-db/benchmark/Makefile
831 plugins/symbol-db/benchmark/symbol-db/Makefile
832 plugins/symbol-db/benchmark/libgda/Makefile
833 plugins/symbol-db/benchmark/sqlite/Makefile
834 plugins/symbol-db/images/Makefile
835 plugins/symbol-db/Makefile
836 plugins/symbol-db/anjuta-tags/Makefile
837 plugins/project-wizard/Makefile
838 plugins/snippets-manager/Makefile
839 plugins/cvs-plugin/Makefile
840 plugins/subversion/Makefile
841 plugins/git/Makefile
842 plugins/git/images/Makefile
843 plugins/sourceview/Makefile
844 plugins/terminal/Makefile
845 plugins/tools/Makefile
846 plugins/tools/scripts/Makefile
847 plugins/language-manager/Makefile
848 plugins/project-import/Makefile
849 plugins/project-wizard/templates/Makefile
850 plugins/project-wizard/templates/mkfile/Makefile
851 plugins/project-wizard/templates/mkfile/src/Makefile
852 plugins/project-wizard/templates/mkfile/po/Makefile
853 plugins/project-wizard/templates/minimal/Makefile
854 plugins/project-wizard/templates/js_minimal/Makefile
855 plugins/project-wizard/templates/js_minimal/src/Makefile
856 plugins/project-wizard/templates/terminal/Makefile
857 plugins/project-wizard/templates/terminal/src/Makefile
858 plugins/project-wizard/templates/terminal/po/Makefile
859 plugins/project-wizard/templates/cpp/Makefile
860 plugins/project-wizard/templates/cpp/src/Makefile
861 plugins/project-wizard/templates/cpp/po/Makefile
862 plugins/project-wizard/templates/gtk/Makefile
863 plugins/project-wizard/templates/gtk/src/Makefile
864 plugins/project-wizard/templates/gtk/po/Makefile
865 plugins/project-wizard/templates/gtkapplication/Makefile
866 plugins/project-wizard/templates/gtkapplication/src/Makefile
867 plugins/project-wizard/templates/gtkapplication/po/Makefile
868 plugins/project-wizard/templates/anjuta-plugin/Makefile
869 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
870 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
871 plugins/project-wizard/templates/gtkmm/Makefile
872 plugins/project-wizard/templates/gtkmm/src/Makefile
873 plugins/project-wizard/templates/gtkmm/po/Makefile
874 plugins/project-wizard/templates/gcj/Makefile
875 plugins/project-wizard/templates/gcj/src/Makefile
876 plugins/project-wizard/templates/java/Makefile
877 plugins/project-wizard/templates/java/src/Makefile
878 plugins/project-wizard/templates/java/po/Makefile
879 plugins/project-wizard/templates/python/Makefile
880 plugins/project-wizard/templates/python/src/Makefile
881 plugins/project-wizard/templates/python/po/Makefile
882 plugins/project-wizard/templates/pygtk/Makefile
883 plugins/project-wizard/templates/pygtk/src/Makefile
884 plugins/project-wizard/templates/pygtk/po/Makefile
885 plugins/project-wizard/templates/vala-gtk/Makefile
886 plugins/project-wizard/templates/vala-gtk/src/Makefile
887 plugins/project-wizard/templates/wxwin/Makefile
888 plugins/project-wizard/templates/wxwin/src/Makefile
889 plugins/project-wizard/templates/wxwin/po/Makefile
890 plugins/project-wizard/templates/xlib/Makefile
891 plugins/project-wizard/templates/xlib/src/Makefile
892 plugins/project-wizard/templates/xlib/po/Makefile
893 plugins/project-wizard/templates/xlib-dock/Makefile
894 plugins/project-wizard/templates/xlib-dock/src/Makefile
895 plugins/project-wizard/templates/xlib-dock/po/Makefile
896 plugins/project-wizard/templates/sdl/Makefile
897 plugins/project-wizard/templates/sdl/src/Makefile
898 plugins/project-wizard/templates/sdl/po/Makefile
899 plugins/project-wizard/templates/library/Makefile
900 plugins/project-wizard/templates/library/src/Makefile
901 plugins/project-wizard/templates/library/po/Makefile
902 plugins/project-wizard/templates/directory/Makefile
903 plugins/project-wizard/templates/m4/Makefile
904 plugins/project-wizard/templates/gnome-shell-extension/Makefile
905 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
906 plugins/am-project/Makefile
907 plugins/am-project/tests/atlocal
908 plugins/am-project/tests/Makefile
909 plugins/mk-project/Makefile
910 plugins/dir-project/Makefile
911 plugins/language-support-cpp-java/Makefile
912 plugins/run-program/Makefile
913 plugins/starter/Makefile
914 plugins/indentation-c-style/Makefile
915 plugins/indentation-python-style/Makefile
916 plugins/language-support-js/Makefile
917 plugins/language-support-vala/Makefile
918 plugins/language-support-python/Makefile
919 plugins/parser-cxx/Makefile
920 plugins/parser-cxx/cxxparser/Makefile
921 plugins/python-loader/Makefile
922 plugins/jhbuild/Makefile
923 plugins/quick-open/Makefile
924 anjuta.desktop.in
925 manuals/Makefile
926 manuals/reference/Makefile
927 manuals/reference/libanjuta/Makefile
928 manuals/reference/libanjuta/version.xml
929 manuals/anjuta-manual/Makefile
930 manuals/anjuta-faqs/Makefile
931 manuals/anjuta-build-tutorial/Makefile
932 mime/Makefile
934 AC_OUTPUT
935 echo " "
936 echo "-------------------------------------------------------------------"
937 echo "Conditionally built plugins:"
938 echo "-------------------------------------------------------------------"
939 if [ test -n "$SVN_INCLUDE" ]; then
940         echo "Building subversion plugin: ............................YES"
941 else
942         echo "Building subversion plugin: ............................NO"
943                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
944                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
945                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
946                 echo "        Requires subversion (>= 1.5); http://subversion.org"
949 if [ test x$gladeui_found = xyes ]; then
950        echo "Building glade plugin: .................................YES"
951 else
952        echo "Building glade plugin: .................................NO"
953        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
956 if [ test x$devhelp_enabled = xyes ]; then
957        echo "Building devhelp plugin: ...............................YES"
958 else
959        echo "Building devhelp plugin: ...............................NO"
960        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
963 if [ test x$terminal_enabled = xyes ]; then
964        echo "Building terminal plugin: ..............................YES"
965 else
966        echo "Building terminal plugin: ..............................NO"
967        echo "        Requires vte-2.90 (>= $VTE_REQUIRED)"
970 if [ test x$enable_vala = xyes ]; then
971         echo "Building Vala support: .................................YES"
972 else
973         echo "Building Vala support: .................................NO"
974         echo "        Requires libvala (>= $VALA_REQUIRED)"
976 if [ test x$have_python = xyes]; then
977         echo "Building python plugin loaeder: ........................YES"
978 else
979         echo "Building python plugin loaeder: ........................NO"
980         echo "        Requires python"
982 echo "-------------------------------------------------------------------"
983 echo "AM_CFLAGS = $AM_CFLAGS"
984 echo "AM_CXXFLAGS = $AM_CXXFLAGS"