bgo #701419 - sqlite not in depencies
[anjuta.git] / configure.ac
blobe3c52da8a824d815d365eb842f8be9e74f09c66b
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,  90)
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.4.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         PKG_CHECK_EXISTS([ libvala-0.20 ],
321                          [ valaver="-0.20" ],
322                          [ PKG_CHECK_EXISTS([ libvala-0.18 ],
323                                             [ valaver="-0.18" ],
324                                             [ valaver="" ])
325                          ])
326         if test "x$valaver" != "x"; then
327                 AC_MSG_RESULT(yes)
328                 enable_vala="yes"
329                 LIBVALA="libvala${valaver}"
330                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
331         else
332                 AC_MSG_RESULT(no)
333                 enable_vala="no"
334                 VALA_REQUIRED=0.18.0
335         fi
336         AC_SUBST(LIBVALA)
339 if test x$enable_vala = xyes; then
340         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
341         AC_SUBST(VALAC)
344 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
346 dnl Check for Python
347 dnl -------------------------------------------------------------
349 AM_PATH_PYTHON([],
350         [have_python="yes"],
351         [have_python="no"])
353 if test x$have_python = xyes; then
354         if test -x $PYTHON-config; then
355                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
356                 PYTHON_LIBS=`$PYTHON-config --libs`
357                 AC_SUBST(PYTHON_CFLAGS)
358                 AC_SUBST(PYTHON_LIBS)
359         elif test -x $PYTHON$PYTHON_VERSION-config; then
360                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
361                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
362                 AC_SUBST(PYTHON_CFLAGS)
363                 AC_SUBST(PYTHON_LIBS)           
364         else
365                 have_python="no"
366                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
367         fi
370 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
372 dnl Disable packagekit support
373 dnl -----------------------------------
374 AC_ARG_ENABLE(packagekit,
375   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
376   [enable_packagekit=yes])
377 if test "x$enable_packagekit" != "xno"; then
378   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
381 dnl Setup Anjuta Library flags
382 dnl --------------------------
383 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)"\"'
384 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
385 AC_SUBST(LIBANJUTA_CFLAGS)
386 AC_SUBST(LIBANJUTA_LIBS)
388 dnl Setup FooCanvas Library flags
389 dnl --------------------------
390 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
391 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
392 AC_SUBST(LIBFOOCANVAS_CFLAGS)
393 AC_SUBST(LIBFOOCANVAS_LIBS)
395 dnl Checks for Xft/XRender for foocanvas
397 AC_CHECK_LIB(Xrender, XRenderFindFormat,
398         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
399          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
400         [AC_SUBST(RENDER_LIBS, "")],
401         [-lXext])
403 dnl Setup Plugin directories
404 dnl ------------------------
405 anjuta_plugin_dir='$(libdir)/anjuta'
406 anjuta_data_dir='$(datadir)/anjuta'
407 anjuta_ui_dir='$(datadir)/anjuta/ui'
408 anjuta_glade_dir='$(datadir)/anjuta/glade'
409 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
410 AC_SUBST(anjuta_plugin_dir)
411 AC_SUBST(anjuta_data_dir)
412 AC_SUBST(anjuta_ui_dir)
413 AC_SUBST(anjuta_glade_dir)
414 AC_SUBST(anjuta_image_dir)
416 dnl ***************************************************************************
417 dnl Check for marshal and enum generators
418 dnl ***************************************************************************
419 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
420 AC_SUBST(GLIB_GENMARSHAL)
421 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
422 AC_SUBST(GLIB_MKENUMS)
424 dnl ***************************************************************************
425 dnl Internatinalization
426 dnl ***************************************************************************
427 IT_PROG_INTLTOOL([0.40.1])
429 AM_GNU_GETTEXT([external])
430 AM_GNU_GETTEXT_VERSION([0.17])
432 GETTEXT_PACKAGE=anjuta
433 AC_SUBST(GETTEXT_PACKAGE)
434 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
436 BISON_I18N
438 dnl ***************************************************************************
439 dnl Check for gtk-doc.
440 dnl ***************************************************************************
441 GTK_DOC_CHECK([1.4])
443 dnl ***************************************************************************
444 dnl User manual
445 dnl ***************************************************************************
446 YELP_HELP_INIT
448 dnl Define convenience macros
449 dnl -------------------------
450 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
451 AC_DEFUN([CHECK_HEADER_DEFINE],
453         AC_MSG_CHECKING("if $1 is defined in $2")
454         AC_EGREP_CPP(yes,
455 [#include <$2>
456 #ifdef $1
457   yes
458 #endif
459 ], [
460         AC_MSG_RESULT(yes)
461         $3
462 ], [
463         AC_MSG_RESULT(no)
464         $4
465 ]) ])
467 dnl Checks for header files.
468 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
469 AC_CHECK_HEADERS(time.h types.h unistd.h)
470 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
472 dnl Checks for typedefs, structures, and compiler characteristics.
474 AC_CANONICAL_HOST
475 CYGWIN=no
476 MINGW32=no
477 case $host_os in
478   *cygwin* ) CYGWIN=yes;;
479   *mingw32* ) MINGW32=yes;;
480 esac
483 dnl Check for bind in libsocket (needed on Solaris)
484 AC_CHECK_LIB(socket, bind)
486 dnl Check for function forkpty and related headers
487 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
488 AC_CHECK_HEADERS(libutil.h util.h pty.h)
490 dnl Checks for library functions.
491 AC_CHECK_FUNCS(fnmatch)
492 AC_CHECK_FUNCS(strstr)
493 AC_CHECK_FUNCS(stricmp)
494 AC_CHECK_FUNCS(strnicmp)
495 AC_CHECK_FUNCS(getline)
497 dnl for libegg/egg-recent-model.c
498 AC_CHECK_DECLS([lockf])
499 AC_CHECK_FUNCS([lockf])
501 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
503 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
504 if test "$have_fgetpos" != yes ; then
505     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
506         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
507             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
510 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
511 if test "$have_mkstemp" != yes ; then
512     AC_CHECK_FUNCS(chmod)
513     if test "$tmpdir_specified" = yes ; then
514         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
515     fi
516 else
517     AC_MSG_CHECKING(directory to use for temporary files)
518     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
519         then tmpdir=/tmp
520         else tmpdir="$enable_tmpdir"
521     fi
522     if test -d $tmpdir ; then
523         AC_MSG_RESULT($tmpdir)
524         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
525     else
526         AC_MSG_WARN($tmpdir does not exist)
527     fi
530 dnl -----------------------------
531 dnl Checks for FreeBSD Build
532 dnl -----------------------------
533 AC_MSG_CHECKING(if building on FreeBSD)
535 if test `uname -s` = "FreeBSD" ; then
536         AC_MSG_RESULT(yes)
537         FREEBSD_BUILD=-DFREEBSD
538         AC_SUBST(FREEBSD_BUILD)
539         AC_PATH_PROG(GMAKE, gmake, no)
540         if test "x$GMAKE" = "xno"; then
541                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
542         fi
543 else
544         AC_MSG_RESULT(no)
545         GMAKE="make"
548 AC_SUBST(GMAKE)
550 dnl Checks for missing prototypes
551 dnl -----------------------------
552 AC_MSG_NOTICE([checking for missing prototypes...])
554 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))])
556 if test "$have_remove" = yes ; then
557     CHECK_PROTO(remove, stdio.h)
558 else
559     CHECK_PROTO(unlink, unistd.h)
561 CHECK_PROTO(malloc, stdlib.h)
562 CHECK_PROTO(getenv, stdlib.h)
563 CHECK_PROTO(stat,   sys/stat.h)
564 CHECK_PROTO(lstat,  sys/stat.h)
565 if test "$have_fgetpos" = yes ; then
566     CHECK_PROTO(fgetpos, stdio.h)
568 if test "$have_truncate" = yes ; then
569     CHECK_PROTO(truncate, unistd.h)
571 if test "$have_ftruncate" = yes ; then
572     CHECK_PROTO(ftruncate, unistd.h)
575 dnl  **********************************************************
576 dnl  check if we have svn libraries to build subversion plugin
577 dnl  (stolen from kdevelop ;-)
578 dnl  **********************************************************
580 AC_MSG_CHECKING(for Subversion svn-config)
581 AC_ARG_WITH(subversion-dir,
582                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
583                 [
584                                 SVNCONFIG="$withval/bin/svn-config"
585                 ])
587 if test -z "$SVNCONFIG"; then
588                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
589                 if test -n "$_SVNCONFIG"; then
590                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
591                 fi
594 AC_SUBST(SVNCONFIG)
595 if test -x "$SVNCONFIG"; then
596                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
597                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
598                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
599                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
600                 AC_MSG_RESULT(yes)
601 else
602                 AC_MSG_RESULT(not found)
604                 dnl just a fallback to debian's config so that it works for me :)
605                 AC_ARG_WITH(svn-include,
606                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
607                                                                 [
608                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
609                                                                                 SVN_INCLUDES=$withval
610                                                                 fi
611                                                                 ])
612                 if test -z "$SVN_INCLUDES"; then
613                         SVN_INCLUDES="/usr/local/include /usr/include"
614                 fi
615                 AC_MSG_CHECKING([for Subversion headers])
616                 SVN_INCLUDE=""
617                 for VALUE in $SVN_INCLUDES ; do
618                                 if test -f $VALUE/subversion-1/svn_types.h ; then
619                                                 SVN_INCLUDE=$VALUE/subversion-1
620                                                 break
621                                 fi
622                                 if test -f $VALUE/svn_types.h ; then
623                                                 SVN_INCLUDE=$VALUE
624                                                 break
625                                 fi
626                 done
627                 if test $SVN_INCLUDE ; then
628                                 AC_MSG_RESULT([found])
629                 else
630                                 AC_MSG_RESULT([not found])
631                 fi
632                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
633                 AC_ARG_WITH(svn-lib,
634                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
635                                                 [
636                                                         if test "$withval" != "yes" -a "$withval" != ""; then
637                                                                 SVN_LIBS=$withval
638                                                         fi
639                                                 ])
640                 AC_MSG_CHECKING([for Subversion libraries])
641                 SVN_LIB=""
642                 for VALUE in $SVN_LIBS ; do
643                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
644                                                 SVN_LIB=$VALUE
645                                                 break
646                                 fi
647                 done
648                 if test $SVN_LIB ; then
649                                 AC_MSG_RESULT([found])
650                 else
651                                 AC_MSG_RESULT([not found])
652                 fi
655 dnl ******************************************************************
656 dnl Check for extra libs required by subversion.
657 dnl FIXME: This should actually be done by subversion and not by us.
658 dnl ******************************************************************
660 AC_ARG_ENABLE(plugin-subversion,
661   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
662   [ if test "$enableval" = "no"; then
663         user_disabled_subversion=1
664     fi ],
665   [ user_disabled_subversion=0 ] )
667 AC_MSG_CHECKING(if subversion support is disabled)
668 if test "$user_disabled_subversion" = 1; then
669         AC_MSG_RESULT(yes)
670         SVN_INCLUDE=""
671         SVN_LIB=""
672 else
673         AC_MSG_RESULT(no)
676 if test -n "$SVN_INCLUDE" ; then
677         dnl ------------------------------------
678         dnl APR. Required by subversion (devel)
679         dnl ------------------------------------
680         have_atr=no
681         PKG_CHECK_MODULES(APR,                            \
682                 apr-1, have_apr=yes, have_apr=no)
683         if test x"$have_apr" = "xno"; then
684                 SVN_INCLUDE=""
685         fi
687         dnl -----------------------------------------
688         dnl APR util. Required by subversion (devel)
689         dnl------------------------------------------
690         have_atr_util=no
691         PKG_CHECK_MODULES(APR_UTILS,                            \
692                 apr-util-1, have_apr_util=yes, have_apr_util=no)
693         if test x"$have_apr_util" = "xno"; then
694                 SVN_INCLUDE=""
695         fi
697         dnl -----------------------------------------
698         dnl NEON. Required by subversion (devel)
699         dnl------------------------------------------
700         have_neon=no
701         PKG_CHECK_MODULES(NEON,                            \
702                 neon, have_neon=yes, have_neon=no)
703         if test x"$have_neon" = "xno"; then
704                 SVN_INCLUDE=""
705         fi
707         dnl Make sure our SVN version is high enough
708         dnl Eww, eww, eww, this is dirty
709         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
710         AC_LANG([C])
711         dnl Temporarily set CFLAGS so that include dirs are found
712         CFLAGS_TMP=$CFLAGS
713         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
714         AC_COMPILE_IFELSE(
715                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
716                         [[
717                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
718                                 #       error "Version too low"
719                                 #endif
720                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
721         if test x"$have_svn_version" = "xno"; then
722                 AC_MSG_RESULT(no)
723                 SVN_INCLUDE=""
724         fi
725         CFLAGS=$CFLAGS_TMP
728 dnl ------------------------------------------
729 dnl Finally prepare subversion build flags
730 dnl ------------------------------------------
732 if test -n "$SVN_INCLUDE" ; then
733         SVN_INCLUDE="-I$SVN_INCLUDE"
734         if test x != "x$SVN_LIB" ; then
735             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
736         else
737             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
738         fi
739         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
742 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
743 AC_SUBST(SVN_INCLUDE)
744 AC_SUBST(SVN_LIB)
745 AC_SUBST(SVN_CFLAGS)
747 dnl ------------------------------------------
748 dnl Symbol-db shared memory checks
749 dnl ------------------------------------------
751 SYMBOL_DB_SHM="/dev/shm"
752 user_specified_shm=0
753 AC_MSG_CHECKING(for symbol-db shared memory)
754 AC_ARG_WITH(symbol-db-shm,
755                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
756                 [
757                                 user_specified_shm=1
758                                 SYMBOL_DB_SHM="$withval"
759                 ])
760 if test "$user_specified_shm" = 1; then
761         AC_MSG_RESULT(yes)
762 else
763         AC_MSG_RESULT(no)
766 AC_SUBST(SYMBOL_DB_SHM)
768 dnl On Linux, need librt for shm_open/shm_unlink
769 bck_LIBS="$LIBS"
770 AC_SEARCH_LIBS(shm_open, rt, [SHM_LIBS="$LIBS"], [AC_MSG_ERROR([Failed to find library with shm_open()])])
771 AC_SUBST(SHM_LIBS)
772 LIBS="$bck_LIBS"
774 dnl Test using autotest
775 dnl -----------------------------
776 AC_CONFIG_TESTDIR(plugins/am-project/tests)
777 AM_MISSING_PROG([AUTOM4TE], [autom4te])
779 AC_CONFIG_FILES([
780 Makefile
781 po/Makefile.in
782 libanjuta/Makefile
783 libanjuta/tests/Makefile
784 libanjuta/interfaces/Makefile
785 libanjuta/libanjuta-3.0.pc
786 libanjuta/anjuta-version.h
787 src/Makefile
788 pixmaps/Makefile
789 pixmaps/hicolor/Makefile
790 pixmaps/hicolor/16x16/Makefile
791 pixmaps/hicolor/22x22/Makefile
792 pixmaps/hicolor/24x24/Makefile
793 pixmaps/hicolor/32x32/Makefile
794 pixmaps/hicolor/48x48/Makefile
795 pixmaps/hicolor/scalable/Makefile
796 pixmaps/HighContrast/Makefile
797 pixmaps/HighContrast/16x16/Makefile
798 pixmaps/HighContrast/22x22/Makefile
799 pixmaps/HighContrast/24x24/Makefile
800 pixmaps/HighContrast/32x32/Makefile
801 pixmaps/HighContrast/48x48/Makefile
802 pixmaps/HighContrast/256x256/Makefile
803 data/Makefile
804 data/welcome.txt
805 data/templates/Makefile
806 doc/anjuta.1
807 doc/anjuta-launcher.1
808 doc/Makefile
809 scripts/Makefile
810 launcher/Makefile
811 plugins/Makefile
812 plugins/class-gen/Makefile
813 plugins/class-gen/templates/Makefile
814 plugins/patch/Makefile
815 plugins/document-manager/Makefile
816 plugins/document-manager/images/Makefile
817 plugins/message-view/Makefile
818 plugins/gdb/Makefile
819 plugins/gdb/images/Makefile
820 plugins/debug-manager/Makefile
821 plugins/debug-manager/images/Makefile
822 plugins/devhelp/Makefile
823 plugins/devhelp/images/Makefile
824 plugins/glade/Makefile
825 plugins/glade/images/Makefile
826 plugins/js-debugger/Makefile
827 plugins/file-manager/Makefile
828 plugins/file-loader/Makefile
829 plugins/file-wizard/Makefile
830 plugins/build-basic-autotools/Makefile
831 plugins/project-manager/Makefile
832 plugins/symbol-db/benchmark/Makefile
833 plugins/symbol-db/benchmark/symbol-db/Makefile
834 plugins/symbol-db/benchmark/libgda/Makefile
835 plugins/symbol-db/benchmark/sqlite/Makefile
836 plugins/symbol-db/images/Makefile
837 plugins/symbol-db/Makefile
838 plugins/symbol-db/anjuta-tags/Makefile
839 plugins/project-wizard/Makefile
840 plugins/snippets-manager/Makefile
841 plugins/cvs-plugin/Makefile
842 plugins/subversion/Makefile
843 plugins/git/Makefile
844 plugins/git/images/Makefile
845 plugins/sourceview/Makefile
846 plugins/terminal/Makefile
847 plugins/tools/Makefile
848 plugins/tools/scripts/Makefile
849 plugins/language-manager/Makefile
850 plugins/project-import/Makefile
851 plugins/project-wizard/templates/Makefile
852 plugins/project-wizard/templates/mkfile/Makefile
853 plugins/project-wizard/templates/mkfile/src/Makefile
854 plugins/project-wizard/templates/mkfile/po/Makefile
855 plugins/project-wizard/templates/minimal/Makefile
856 plugins/project-wizard/templates/js_minimal/Makefile
857 plugins/project-wizard/templates/js_minimal/src/Makefile
858 plugins/project-wizard/templates/terminal/Makefile
859 plugins/project-wizard/templates/terminal/src/Makefile
860 plugins/project-wizard/templates/terminal/po/Makefile
861 plugins/project-wizard/templates/cpp/Makefile
862 plugins/project-wizard/templates/cpp/src/Makefile
863 plugins/project-wizard/templates/cpp/po/Makefile
864 plugins/project-wizard/templates/gtk/Makefile
865 plugins/project-wizard/templates/gtk/src/Makefile
866 plugins/project-wizard/templates/gtk/po/Makefile
867 plugins/project-wizard/templates/gtkapplication/Makefile
868 plugins/project-wizard/templates/gtkapplication/src/Makefile
869 plugins/project-wizard/templates/gtkapplication/po/Makefile
870 plugins/project-wizard/templates/anjuta-plugin/Makefile
871 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
872 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
873 plugins/project-wizard/templates/gtkmm/Makefile
874 plugins/project-wizard/templates/gtkmm/src/Makefile
875 plugins/project-wizard/templates/gtkmm/po/Makefile
876 plugins/project-wizard/templates/gcj/Makefile
877 plugins/project-wizard/templates/gcj/src/Makefile
878 plugins/project-wizard/templates/java/Makefile
879 plugins/project-wizard/templates/java/src/Makefile
880 plugins/project-wizard/templates/java/po/Makefile
881 plugins/project-wizard/templates/python/Makefile
882 plugins/project-wizard/templates/python/src/Makefile
883 plugins/project-wizard/templates/python/po/Makefile
884 plugins/project-wizard/templates/pygtk/Makefile
885 plugins/project-wizard/templates/pygtk/src/Makefile
886 plugins/project-wizard/templates/pygtk/po/Makefile
887 plugins/project-wizard/templates/vala-gtk/Makefile
888 plugins/project-wizard/templates/vala-gtk/src/Makefile
889 plugins/project-wizard/templates/wxwin/Makefile
890 plugins/project-wizard/templates/wxwin/src/Makefile
891 plugins/project-wizard/templates/wxwin/po/Makefile
892 plugins/project-wizard/templates/xlib/Makefile
893 plugins/project-wizard/templates/xlib/src/Makefile
894 plugins/project-wizard/templates/xlib/po/Makefile
895 plugins/project-wizard/templates/xlib-dock/Makefile
896 plugins/project-wizard/templates/xlib-dock/src/Makefile
897 plugins/project-wizard/templates/xlib-dock/po/Makefile
898 plugins/project-wizard/templates/sdl/Makefile
899 plugins/project-wizard/templates/sdl/src/Makefile
900 plugins/project-wizard/templates/sdl/po/Makefile
901 plugins/project-wizard/templates/library/Makefile
902 plugins/project-wizard/templates/library/src/Makefile
903 plugins/project-wizard/templates/library/po/Makefile
904 plugins/project-wizard/templates/directory/Makefile
905 plugins/project-wizard/templates/m4/Makefile
906 plugins/project-wizard/templates/gnome-shell-extension/Makefile
907 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
908 plugins/am-project/Makefile
909 plugins/am-project/tests/atlocal
910 plugins/am-project/tests/Makefile
911 plugins/mk-project/Makefile
912 plugins/dir-project/Makefile
913 plugins/language-support-cpp-java/Makefile
914 plugins/run-program/Makefile
915 plugins/starter/Makefile
916 plugins/indentation-c-style/Makefile
917 plugins/indentation-python-style/Makefile
918 plugins/language-support-js/Makefile
919 plugins/language-support-vala/Makefile
920 plugins/language-support-python/Makefile
921 plugins/parser-cxx/Makefile
922 plugins/parser-cxx/cxxparser/Makefile
923 plugins/python-loader/Makefile
924 plugins/jhbuild/Makefile
925 plugins/quick-open/Makefile
926 anjuta.desktop.in
927 manuals/Makefile
928 manuals/reference/Makefile
929 manuals/reference/libanjuta/Makefile
930 manuals/reference/libanjuta/version.xml
931 manuals/anjuta-manual/Makefile
932 manuals/anjuta-faqs/Makefile
933 manuals/anjuta-build-tutorial/Makefile
934 mime/Makefile
936 AC_OUTPUT
937 echo " "
938 echo "-------------------------------------------------------------------"
939 echo "Conditionally built plugins:"
940 echo "-------------------------------------------------------------------"
941 if [ test -n "$SVN_INCLUDE" ]; then
942         echo "Building subversion plugin: ............................YES"
943 else
944         echo "Building subversion plugin: ............................NO"
945                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
946                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
947                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
948                 echo "        Requires subversion (>= 1.5); http://subversion.org"
951 if [ test x$gladeui_found = xyes ]; then
952        echo "Building glade plugin: .................................YES"
953 else
954        echo "Building glade plugin: .................................NO"
955        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
958 if [ test x$devhelp_enabled = xyes ]; then
959        echo "Building devhelp plugin: ...............................YES"
960 else
961        echo "Building devhelp plugin: ...............................NO"
962        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
965 if [ test x$terminal_enabled = xyes ]; then
966        echo "Building terminal plugin: ..............................YES"
967 else
968        echo "Building terminal plugin: ..............................NO"
969        echo "        Requires vte-2.90 (>= $VTE_REQUIRED)"
972 if [ test x$enable_vala = xyes ]; then
973         echo "Building Vala support: .................................YES"
974 else
975         echo "Building Vala support: .................................NO"
976         echo "        Requires libvala (>= $VALA_REQUIRED)"
978 if [ test x$have_python = xyes]; then
979         echo "Building python plugin loaeder: ........................YES"
980 else
981         echo "Building python plugin loaeder: ........................NO"
982         echo "        Requires python"
984 echo "-------------------------------------------------------------------"
985 echo "AM_CFLAGS = $AM_CFLAGS"
986 echo "AM_CXXFLAGS = $AM_CXXFLAGS"