bgo #731844 - AppData file does not validate
[anjuta.git] / configure.ac
blob0998b1125862963460b64e4135106ac1f67d2192
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,  13)
7 m4_define(anjuta_micro_version,   1)
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.10.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 SERF_REQUIRED=1.2.0
62 SVN_MAJOR=1
63 SVN_MINOR=5
64 SVN_PATCH=0
65 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
67 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip tar-ustar])
68 AM_MAINTAINER_MODE([enable])
70 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
72 dnl Check for C Compiler
73 AC_PROG_CC
74 AC_PROG_CPP
75 AC_PROG_LEX
76 if test "$LEX" != "flex"; then
77         AC_MSG_ERROR(flex is required)
79 AC_PROG_YACC
80 if test "$YACC" != "bison -y"; then
81         AC_MSG_ERROR(bison is required)
83 AC_LANG([C])
84 AC_LANG([C++])
85 AC_PROG_CXX
86 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],,
87    AC_MSG_ERROR([C++ Compiler required to compile Anjuta]))
88 AM_PROG_CC_C_O
90 GNOME_COMPILE_WARNINGS([maximum])
91 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
92 AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
94 dnl Enable debugging mode
95 AC_ARG_ENABLE(debug,
96   AS_HELP_STRING([--enable-debug],[Enable debug messages]),
97   [if test "x$enableval" = "xyes"; then
98       AM_CFLAGS="$AM_CFLAGS -DDEBUG"
99   fi]
100   AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG")
101 AC_SUBST(AM_CFLAGS)
102 AC_SUBST(AM_CXXFLAGS)
104 ANJUTA_LDFLAGS="-no-undefined"
105 ANJUTA_PLUGIN_LDFLAGS="-module -avoid-version -no-undefined"
106 AC_SUBST(ANJUTA_LDFLAGS)
107 AC_SUBST(ANJUTA_PLUGIN_LDFLAGS)
109 dnl GSettings
110 GLIB_GSETTINGS
112 dnl Disable deprecated APIs
113 dnl if test x$MAINT = x; then
114 dnl     DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
115 dnl     AC_SUBST(DEPRECATED_FLAGS)
116 dnl fi
118 dnl Check for pkg-config
119 PKG_PROG_PKG_CONFIG([0.22])
121 dnl Enable versioned user preferences directory
122 AC_ARG_WITH(pref-suffix,
123   AS_HELP_STRING([--with-pref-suffix=VALUE],[Suffix to add to user preferences dir.]),
124   PREF_SUFFIX="$withval")
126 AC_SUBST(PREF_SUFFIX)
127 AC_DEFINE_UNQUOTED(PREF_SUFFIX,
128       "${PREF_SUFFIX}",
129           [Suffix to add to preferences directory])
131 # Initialize libtool
132 LT_PREREQ([2.2])
133 LT_INIT([disable-static])
135 dnl ***************************************************************************
136 dnl Check for GObject-Introspection
137 dnl ***************************************************************************
138 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [GOBJECT_INTROSPECTION_CHECK([0.6.7])],
139 [AM_CONDITIONAL(HAVE_INTROSPECTION, false)])
141 dnl ***************************************************************************
142 dnl Set gjsdir
143 dnl ***************************************************************************
144 gjsdir=`pkg-config --variable=jsdir gjs-1.0`
145 AC_SUBST(gjsdir)
147 dnl Check base modules
149 PKG_CHECK_MODULES([ANJUTA],
150    [gthread-2.0 >= $GTHREAD_REQUIRED
151         glib-2.0 >= $GLIB_REQUIRED
152         gio-2.0 >= $GLIB_REQUIRED
153         gmodule-2.0 >= $GLIB_REQUIRED
154         gtk+-3.0 >= $GTK_REQUIRED
155         gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
157 PKG_CHECK_MODULES([XML],
158    [libxml-2.0 >= $LIBXML_REQUIRED])
160 PKG_CHECK_MODULES([GDL],
161    [gdl-3.0 >= $GDL_REQUIRED])
163 PKG_CHECK_MODULES([GDA],
164    [libgda-5.0 >= $GDA5_REQUIRED],,
165    [PKG_CHECK_MODULES([GDA],
166       [libgda-4.0 >= $GDA4_REQUIRED])])
168 dnl Check for autogen
169 dnl -----------------
170 AC_PATH_PROG(AUTOGEN_PATH, autogen,no)
171 if test x$AUTOGEN_PATH = xno; then
172    AC_MSG_WARN([Couldn't find autogen. You will be able to build anjuta without autogen \
173                 but several things won't work. You can get it from http://autogen.sourceforge.net/])
176 dnl Check for Terminal
177 dnl ---------------------
179 AC_ARG_ENABLE(plugin-terminal,
180   AS_HELP_STRING([--disable-plugin-terminal],[Disable terminal plugin support in Anjuta.]),
181   [ if test "$enableval" = "no"; then
182        user_disabled_terminal=1
183     fi ],
184   [ user_disabled_terminal=0 ] )
186 AC_MSG_CHECKING(if terminal plugin is disabled)
187 if test "$user_disabled_terminal" = 1; then
188         AC_MSG_RESULT(yes)
189         terminal_enabled="no"
190 else
191         AC_MSG_RESULT(no)
192         PKG_CHECK_MODULES(PLUGIN_TERMINAL, [vte-2.90 >= $VTE_REQUIRED],
193             [
194                 terminal_enabled=yes
195             ], [
196                 terminal_enabled=no
197             ])
200 AM_CONDITIONAL(HAVE_PLUGIN_TERMINAL, [test x$terminal_enabled = xyes])
202 dnl Check for Devhelp
203 dnl -----------------
205 AC_ARG_ENABLE(plugin-devhelp,
206   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
207   [ if test "$enableval" = "no"; then
208        user_disabled_devhelp=1
209     fi ],
210   [ user_disabled_devhelp=0 ] )
212 AC_MSG_CHECKING(if devhelp plugin is disabled)
213 if test "$user_disabled_devhelp" = 1; then
214         AC_MSG_RESULT(yes)
215         devhelp_enabled="no"
216 else
217         AC_MSG_RESULT(no)
218         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
219                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
220                                 [
221                                     devhelp_enabled=yes
222                                 ], [
223                                     devhelp_enabled=no
224                                 ])
227 if test "x$devhelp_enabled" = "xyes"; then
228         case "$PLUGIN_DEVHELP_LIBS" in
229                 *webkit2gtk-3.0*)
230                         AC_DEFINE([HAVE_WEBKIT2], [1], [Defined if devhelp is built against webkitgtk2])
231                         ;;
232                 esac
234 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
236 dnl Check for Glade3
237 dnl ---------------------
239 AC_ARG_ENABLE(plugin-glade,
240   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
241   [ if test "$enableval" = "no"; then
242        user_disabled_glade=1
243     fi ],
244   [ user_disabled_glade=0 ] )
246 AC_MSG_CHECKING(if glade plugin is disabled)
247 if test "$user_disabled_glade" = 1; then
248         AC_MSG_RESULT(yes)
249         gladeui_found="no"
250 else
251         AC_MSG_RESULT(no)
252         gladeui_version=0
253         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
254             [
255                 gladeui_found=yes
256             ], [
257                 gladeui_found=no
258             ])
261 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
263 dnl Glade catalog
264 dnl ---------------------
266 AC_ARG_ENABLE(glade-catalog,
267   AS_HELP_STRING([--enable-glade-catalog], [Enable glade catalog. Glade UI libraries must be installed]),
268   [ user_enabled_glade_catalog=1 ],
269   [ user_enabled_glade_catalog=0 ])
271 glade_catalog_enabled="no"
273 AC_MSG_CHECKING(if glade catalog is enabled)
274 if test "$gladeui_found" = "yes"; then
275   if test "$user_enabled_glade_catalog" = 1; then
276     AC_MSG_RESULT(yes)
277     glade_catalog_enabled="yes"
278     GLADE_CATALOG_PATH=`pkg-config --variable=catalogdir gladeui-2.0`
279     GLADE_PLUGINS_PATH=`pkg-config --variable=moduledir gladeui-2.0`
281     AC_SUBST(GLADE_CATALOG_PATH)
282     AC_SUBST(GLADE_PLUGINS_PATH)
283   else
284     AC_MSG_RESULT(no) 
285   fi
286 else
287   AC_MSG_RESULT(no)
290 AM_CONDITIONAL(ENABLE_GLADE_CATALOG, [test x$glade_catalog_enabled = xyes])
292 dnl Check for gtksourceview
293 dnl -------------------------------------------------------------
294 PKG_CHECK_MODULES(SOURCEVIEW,
295                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
298 dnl Check for libsqlite3 used in symbol-db benchmarks
299 dnl -------------------------------------------------------------
300 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite3_found=yes, sqlite3_found=no)
301 AM_CONDITIONAL(HAVE_SQLITE, [test x$sqlite3_found = xyes])
304 dnl Check for vala
305 dnl -------------------------------------------------------------
307 AC_ARG_ENABLE(vala,
308         AS_HELP_STRING([--disable-vala],[Disable vala support]),
309         [ if test "$enableval" = "no"; then
310                 user_disabled_vala=1
311           fi ],
312         [ user_disabled_vala=0 ])
314 AC_MSG_CHECKING(if vala support is disabled)
315 if test "$user_disabled_vala" = 1; then
316         AC_MSG_RESULT(yes)
317         enable_vala="no"
318 else
319         AC_MSG_RESULT(no)
320         AC_MSG_CHECKING(if libvala is available)
321         m4_foreach([VERSION], [[0.18], [0.20], [0.22], [0.24]],
322                 [PKG_CHECK_EXISTS([ libvala-VERSION ],
323                          [ valaver="-VERSION" ])
324                          ])
325         if test "x$valaver" != "x"; then
326                 AC_MSG_RESULT(yes)
327                 enable_vala="yes"
328                 LIBVALA="libvala${valaver}"
329                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
330         else
331                 AC_MSG_RESULT(no)
332                 enable_vala="no"
333                 VALA_REQUIRED=0.18.0
334         fi
335         AC_SUBST(LIBVALA)
338 if test x$enable_vala = xyes; then
339         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
340         AC_SUBST(VALAC)
343 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
345 dnl Check for Python
346 dnl -------------------------------------------------------------
348 AM_PATH_PYTHON([],
349         [have_python="yes"],
350         [have_python="no"])
352 if test x$have_python = xyes; then
353         if test -x $PYTHON-config; then
354                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
355                 PYTHON_LIBS=`$PYTHON-config --libs`
356                 AC_SUBST(PYTHON_CFLAGS)
357                 AC_SUBST(PYTHON_LIBS)
358         elif test -x $PYTHON$PYTHON_VERSION-config; then
359                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
360                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
361                 AC_SUBST(PYTHON_CFLAGS)
362                 AC_SUBST(PYTHON_LIBS)           
363         else
364                 have_python="no"
365                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
366         fi
369 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
371 dnl Disable packagekit support
372 dnl -----------------------------------
373 AC_ARG_ENABLE(packagekit,
374   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
375   [enable_packagekit=yes])
376 if test "x$enable_packagekit" != "xno"; then
377   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
380 dnl Setup Anjuta Library flags
381 dnl --------------------------
382 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)"\"'
383 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
384 AC_SUBST(LIBANJUTA_CFLAGS)
385 AC_SUBST(LIBANJUTA_LIBS)
387 dnl Setup FooCanvas Library flags
388 dnl --------------------------
389 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
390 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
391 AC_SUBST(LIBFOOCANVAS_CFLAGS)
392 AC_SUBST(LIBFOOCANVAS_LIBS)
394 dnl Checks for Xft/XRender for foocanvas
396 AC_CHECK_LIB(Xrender, XRenderFindFormat,
397         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
398          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
399         [AC_SUBST(RENDER_LIBS, "")],
400         [-lXext])
402 dnl Setup Plugin directories
403 dnl ------------------------
404 anjuta_plugin_dir='$(libdir)/anjuta'
405 anjuta_data_dir='$(datadir)/anjuta'
406 anjuta_ui_dir='$(datadir)/anjuta/ui'
407 anjuta_glade_dir='$(datadir)/anjuta/glade'
408 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
409 AC_SUBST(anjuta_plugin_dir)
410 AC_SUBST(anjuta_data_dir)
411 AC_SUBST(anjuta_ui_dir)
412 AC_SUBST(anjuta_glade_dir)
413 AC_SUBST(anjuta_image_dir)
415 dnl ***************************************************************************
416 dnl Check for marshal and enum generators
417 dnl ***************************************************************************
418 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
419 AC_SUBST(GLIB_GENMARSHAL)
420 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
421 AC_SUBST(GLIB_MKENUMS)
423 dnl ***************************************************************************
424 dnl Internatinalization
425 dnl ***************************************************************************
426 IT_PROG_INTLTOOL([0.40.1])
428 AM_GNU_GETTEXT([external])
429 AM_GNU_GETTEXT_VERSION([0.17])
431 GETTEXT_PACKAGE=anjuta
432 AC_SUBST(GETTEXT_PACKAGE)
433 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
435 BISON_I18N
437 dnl ***************************************************************************
438 dnl Check for gtk-doc.
439 dnl ***************************************************************************
440 GTK_DOC_CHECK([1.4])
442 dnl ***************************************************************************
443 dnl User manual
444 dnl ***************************************************************************
445 YELP_HELP_INIT
447 dnl Define convenience macros
448 dnl -------------------------
449 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
450 AC_DEFUN([CHECK_HEADER_DEFINE],
452         AC_MSG_CHECKING("if $1 is defined in $2")
453         AC_EGREP_CPP(yes,
454 [#include <$2>
455 #ifdef $1
456   yes
457 #endif
458 ], [
459         AC_MSG_RESULT(yes)
460         $3
461 ], [
462         AC_MSG_RESULT(no)
463         $4
464 ]) ])
466 dnl Checks for header files.
467 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
468 AC_CHECK_HEADERS(time.h types.h unistd.h)
469 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
471 dnl Checks for typedefs, structures, and compiler characteristics.
473 AC_CANONICAL_HOST
474 CYGWIN=no
475 MINGW32=no
476 case $host_os in
477   *cygwin* ) CYGWIN=yes;;
478   *mingw32* ) MINGW32=yes;;
479 esac
482 dnl Check for bind in libsocket (needed on Solaris)
483 AC_CHECK_LIB(socket, bind)
485 dnl Check for function forkpty and related headers
486 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
487 AC_CHECK_HEADERS(libutil.h util.h pty.h)
489 dnl Checks for library functions.
490 AC_CHECK_FUNCS(fnmatch)
491 AC_CHECK_FUNCS(strstr)
492 AC_CHECK_FUNCS(stricmp)
493 AC_CHECK_FUNCS(strnicmp)
494 AC_CHECK_FUNCS(getline)
496 dnl for libegg/egg-recent-model.c
497 AC_CHECK_DECLS([lockf])
498 AC_CHECK_FUNCS([lockf])
500 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
502 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
503 if test "$have_fgetpos" != yes ; then
504     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
505         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
506             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
509 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
510 if test "$have_mkstemp" != yes ; then
511     AC_CHECK_FUNCS(chmod)
512     if test "$tmpdir_specified" = yes ; then
513         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
514     fi
515 else
516     AC_MSG_CHECKING(directory to use for temporary files)
517     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
518         then tmpdir=/tmp
519         else tmpdir="$enable_tmpdir"
520     fi
521     if test -d $tmpdir ; then
522         AC_MSG_RESULT($tmpdir)
523         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
524     else
525         AC_MSG_WARN($tmpdir does not exist)
526     fi
529 dnl -----------------------------
530 dnl Checks for FreeBSD Build
531 dnl -----------------------------
532 AC_MSG_CHECKING(if building on FreeBSD)
534 if test `uname -s` = "FreeBSD" ; then
535         AC_MSG_RESULT(yes)
536         FREEBSD_BUILD=-DFREEBSD
537         AC_SUBST(FREEBSD_BUILD)
538         AC_PATH_PROG(GMAKE, gmake, no)
539         if test "x$GMAKE" = "xno"; then
540                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
541         fi
542 else
543         AC_MSG_RESULT(no)
544         GMAKE="make"
547 AC_SUBST(GMAKE)
549 dnl Checks for missing prototypes
550 dnl -----------------------------
551 AC_MSG_NOTICE([checking for missing prototypes...])
553 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))])
555 if test "$have_remove" = yes ; then
556     CHECK_PROTO(remove, stdio.h)
557 else
558     CHECK_PROTO(unlink, unistd.h)
560 CHECK_PROTO(malloc, stdlib.h)
561 CHECK_PROTO(getenv, stdlib.h)
562 CHECK_PROTO(stat,   sys/stat.h)
563 CHECK_PROTO(lstat,  sys/stat.h)
564 if test "$have_fgetpos" = yes ; then
565     CHECK_PROTO(fgetpos, stdio.h)
567 if test "$have_truncate" = yes ; then
568     CHECK_PROTO(truncate, unistd.h)
570 if test "$have_ftruncate" = yes ; then
571     CHECK_PROTO(ftruncate, unistd.h)
574 dnl  **********************************************************
575 dnl  check if we have svn libraries to build subversion plugin
576 dnl  (stolen from kdevelop ;-)
577 dnl  **********************************************************
579 AC_MSG_CHECKING(for Subversion svn-config)
580 AC_ARG_WITH(subversion-dir,
581                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
582                 [
583                                 SVNCONFIG="$withval/bin/svn-config"
584                 ])
586 if test -z "$SVNCONFIG"; then
587                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
588                 if test -n "$_SVNCONFIG"; then
589                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
590                 fi
593 AC_SUBST(SVNCONFIG)
594 if test -x "$SVNCONFIG"; then
595                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
596                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
597                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
598                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
599                 AC_MSG_RESULT(yes)
600 else
601                 AC_MSG_RESULT(not found)
603                 dnl just a fallback to debian's config so that it works for me :)
604                 AC_ARG_WITH(svn-include,
605                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
606                                                                 [
607                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
608                                                                                 SVN_INCLUDES=$withval
609                                                                 fi
610                                                                 ])
611                 if test -z "$SVN_INCLUDES"; then
612                         SVN_INCLUDES="/usr/local/include /usr/include"
613                 fi
614                 AC_MSG_CHECKING([for Subversion headers])
615                 SVN_INCLUDE=""
616                 for VALUE in $SVN_INCLUDES ; do
617                                 if test -f $VALUE/subversion-1/svn_types.h ; then
618                                                 SVN_INCLUDE=$VALUE/subversion-1
619                                                 break
620                                 fi
621                                 if test -f $VALUE/svn_types.h ; then
622                                                 SVN_INCLUDE=$VALUE
623                                                 break
624                                 fi
625                 done
626                 if test $SVN_INCLUDE ; then
627                                 AC_MSG_RESULT([found])
628                 else
629                                 AC_MSG_RESULT([not found])
630                 fi
631                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
632                 AC_ARG_WITH(svn-lib,
633                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
634                                                 [
635                                                         if test "$withval" != "yes" -a "$withval" != ""; then
636                                                                 SVN_LIBS=$withval
637                                                         fi
638                                                 ])
639                 AC_MSG_CHECKING([for Subversion libraries])
640                 SVN_LIB=""
641                 for VALUE in $SVN_LIBS ; do
642                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
643                                                 SVN_LIB=$VALUE
644                                                 break
645                                 fi
646                 done
647                 if test $SVN_LIB ; then
648                                 AC_MSG_RESULT([found])
649                 else
650                                 AC_MSG_RESULT([not found])
651                 fi
654 dnl ******************************************************************
655 dnl Check for extra libs required by subversion.
656 dnl FIXME: This should actually be done by subversion and not by us.
657 dnl        See http://subversion.tigris.org/issues/show_bug.cgi?id=4435
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_ARG_ENABLE(neon,
668         AS_HELP_STRING([--disable-neon],[Disable neon support in Subversion plugin]),
669         [ if test "$enableval" = "no"; then
670                 user_disabled_neon=1
671           fi ],
672         [ user_disabled_neon=0 ])
674 AC_ARG_ENABLE(serf,
675         AS_HELP_STRING([--disable-serf],[Disable serf support in Subversion plugin]),
676         [ if test "$enableval" = "no"; then
677                 user_disabled_serf=1
678           fi ],
679         [ user_disabled_serf=0 ])
681 AC_MSG_CHECKING(if subversion support is disabled)
682 if test "$user_disabled_subversion" = 1; then
683         AC_MSG_RESULT(yes)
684         SVN_INCLUDE=""
685         SVN_LIB=""
686 else
687         AC_MSG_RESULT(no)
690 if test -n "$SVN_INCLUDE" ; then
691         dnl ------------------------------------
692         dnl APR. Required by subversion (devel)
693         dnl ------------------------------------
694         have_atr=no
695         PKG_CHECK_MODULES(APR,                            \
696                 apr-1, have_apr=yes, have_apr=no)
697         if test x"$have_apr" = "xno"; then
698                 SVN_INCLUDE=""
699         fi
701         dnl -----------------------------------------
702         dnl APR util. Required by subversion (devel)
703         dnl------------------------------------------
704         have_atr_util=no
705         PKG_CHECK_MODULES(APR_UTILS,                            \
706                 apr-util-1, have_apr_util=yes, have_apr_util=no)
707         if test x"$have_apr_util" = "xno"; then
708                 SVN_INCLUDE=""
709         fi
711         dnl ----------------------------------------------------------
712         dnl NEON/SERF. Required by subversion (devel) for HTTP support
713         dnl-----------------------------------------------------------
714         # Subversion <= 1.7 relies on neon (recommended) or serf.
715         # Subversion 1.8 dropped neon support and uses serf to talk
716         # to HTTP servers.
717         #
718         # Subversion can be built without HTTP client support so neon and
719         # serf aren't hard requirements. But if present on the system
720         # it is reasonable to assume that Subversion is linked to them.
721         if test "$user_disabled_neon" = 0; then
722                 have_neon=no
723                 PKG_CHECK_MODULES(NEON,                            \
724                         neon, have_neon=yes, have_neon=no)
725         fi
726         if test "$user_disabled_serf" = 0; then
727                 have_serf=no
728                 PKG_CHECK_MODULES(SERF,                            \
729                         serf-1, have_serf=yes, have_serf=no)
730         fi
732         dnl Make sure our SVN version is high enough
733         dnl Eww, eww, eww, this is dirty
734         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
735         AC_LANG([C])
736         dnl Temporarily set CFLAGS so that include dirs are found
737         CFLAGS_TMP=$CFLAGS
738         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
739         AC_COMPILE_IFELSE(
740                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
741                         [[
742                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
743                                 #       error "Version too low"
744                                 #endif
745                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
746         if test x"$have_svn_version" = "xno"; then
747                 AC_MSG_RESULT(no)
748                 SVN_INCLUDE=""
749         fi
750         CFLAGS=$CFLAGS_TMP
753 dnl ------------------------------------------
754 dnl Finally prepare subversion build flags
755 dnl ------------------------------------------
757 if test -n "$SVN_INCLUDE" ; then
758         SVN_INCLUDE="-I$SVN_INCLUDE"
759         if test x != "x$SVN_LIB" ; then
760             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS $SERF_LIBS -lsvn_client-1 -lsvn_subr-1"
761         else
762             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS $SERF_LIBS -lsvn_client-1 -lsvn_subr-1"
763         fi
764         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS $SERF_CFLAGS"
767 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
768 AC_SUBST(SVN_INCLUDE)
769 AC_SUBST(SVN_LIB)
770 AC_SUBST(SVN_CFLAGS)
772 dnl ------------------------------------------
773 dnl Symbol-db shared memory checks
774 dnl ------------------------------------------
776 SYMBOL_DB_SHM="/dev/shm"
777 user_specified_shm=0
778 AC_MSG_CHECKING(for symbol-db shared memory)
779 AC_ARG_WITH(symbol-db-shm,
780                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
781                 [
782                                 user_specified_shm=1
783                                 SYMBOL_DB_SHM="$withval"
784                 ])
785 if test "$user_specified_shm" = 1; then
786         AC_MSG_RESULT(yes)
787 else
788         AC_MSG_RESULT(no)
791 AC_SUBST(SYMBOL_DB_SHM)
793 dnl On Linux, need librt for shm_open/shm_unlink
794 bck_LIBS="$LIBS"
795 AC_SEARCH_LIBS(shm_open, rt, [SHM_LIBS="$LIBS"], [AC_MSG_ERROR([Failed to find library with shm_open()])])
796 AC_SUBST(SHM_LIBS)
797 LIBS="$bck_LIBS"
799 dnl Test using autotest
800 dnl -----------------------------
801 AC_CONFIG_TESTDIR(plugins/am-project/tests)
802 AM_MISSING_PROG([AUTOM4TE], [autom4te])
804 AC_CONFIG_FILES([
805 Makefile
806 po/Makefile.in
807 libanjuta/Makefile
808 libanjuta/tests/Makefile
809 libanjuta/interfaces/Makefile
810 libanjuta/libanjuta-3.0.pc
811 libanjuta/anjuta-version.h
812 src/Makefile
813 pixmaps/Makefile
814 pixmaps/hicolor/Makefile
815 pixmaps/hicolor/16x16/Makefile
816 pixmaps/hicolor/22x22/Makefile
817 pixmaps/hicolor/24x24/Makefile
818 pixmaps/hicolor/32x32/Makefile
819 pixmaps/hicolor/48x48/Makefile
820 pixmaps/hicolor/scalable/Makefile
821 pixmaps/HighContrast/Makefile
822 pixmaps/HighContrast/16x16/Makefile
823 pixmaps/HighContrast/22x22/Makefile
824 pixmaps/HighContrast/24x24/Makefile
825 pixmaps/HighContrast/32x32/Makefile
826 pixmaps/HighContrast/48x48/Makefile
827 pixmaps/HighContrast/256x256/Makefile
828 data/Makefile
829 data/welcome.txt
830 data/templates/Makefile
831 doc/anjuta.1
832 doc/anjuta-launcher.1
833 doc/Makefile
834 scripts/Makefile
835 launcher/Makefile
836 plugins/Makefile
837 plugins/class-gen/Makefile
838 plugins/class-gen/templates/Makefile
839 plugins/patch/Makefile
840 plugins/document-manager/Makefile
841 plugins/document-manager/images/Makefile
842 plugins/message-view/Makefile
843 plugins/gdb/Makefile
844 plugins/gdb/images/Makefile
845 plugins/debug-manager/Makefile
846 plugins/debug-manager/images/Makefile
847 plugins/devhelp/Makefile
848 plugins/devhelp/images/Makefile
849 plugins/glade/Makefile
850 plugins/glade/images/Makefile
851 plugins/js-debugger/Makefile
852 plugins/file-manager/Makefile
853 plugins/file-loader/Makefile
854 plugins/file-wizard/Makefile
855 plugins/build-basic-autotools/Makefile
856 plugins/project-manager/Makefile
857 plugins/symbol-db/benchmark/Makefile
858 plugins/symbol-db/benchmark/symbol-db/Makefile
859 plugins/symbol-db/benchmark/libgda/Makefile
860 plugins/symbol-db/benchmark/sqlite/Makefile
861 plugins/symbol-db/images/Makefile
862 plugins/symbol-db/Makefile
863 plugins/symbol-db/anjuta-tags/Makefile
864 plugins/project-wizard/Makefile
865 plugins/snippets-manager/Makefile
866 plugins/cvs-plugin/Makefile
867 plugins/subversion/Makefile
868 plugins/git/Makefile
869 plugins/git/images/Makefile
870 plugins/git/tests/Makefile
871 plugins/sourceview/Makefile
872 plugins/terminal/Makefile
873 plugins/tools/Makefile
874 plugins/tools/scripts/Makefile
875 plugins/language-manager/Makefile
876 plugins/project-import/Makefile
877 plugins/project-wizard/templates/Makefile
878 plugins/project-wizard/templates/mkfile/Makefile
879 plugins/project-wizard/templates/mkfile/src/Makefile
880 plugins/project-wizard/templates/mkfile/po/Makefile
881 plugins/project-wizard/templates/minimal/Makefile
882 plugins/project-wizard/templates/js_minimal/Makefile
883 plugins/project-wizard/templates/js_minimal/src/Makefile
884 plugins/project-wizard/templates/terminal/Makefile
885 plugins/project-wizard/templates/terminal/src/Makefile
886 plugins/project-wizard/templates/terminal/po/Makefile
887 plugins/project-wizard/templates/cpp/Makefile
888 plugins/project-wizard/templates/cpp/src/Makefile
889 plugins/project-wizard/templates/cpp/po/Makefile
890 plugins/project-wizard/templates/gtk/Makefile
891 plugins/project-wizard/templates/gtk/src/Makefile
892 plugins/project-wizard/templates/gtk/po/Makefile
893 plugins/project-wizard/templates/gtkapplication/Makefile
894 plugins/project-wizard/templates/gtkapplication/src/Makefile
895 plugins/project-wizard/templates/gtkapplication/po/Makefile
896 plugins/project-wizard/templates/anjuta-plugin/Makefile
897 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
898 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
899 plugins/project-wizard/templates/gtkmm/Makefile
900 plugins/project-wizard/templates/gtkmm/src/Makefile
901 plugins/project-wizard/templates/gtkmm/po/Makefile
902 plugins/project-wizard/templates/gcj/Makefile
903 plugins/project-wizard/templates/gcj/src/Makefile
904 plugins/project-wizard/templates/java/Makefile
905 plugins/project-wizard/templates/java/src/Makefile
906 plugins/project-wizard/templates/java/po/Makefile
907 plugins/project-wizard/templates/python/Makefile
908 plugins/project-wizard/templates/python/src/Makefile
909 plugins/project-wizard/templates/python/po/Makefile
910 plugins/project-wizard/templates/pygtk/Makefile
911 plugins/project-wizard/templates/pygtk/src/Makefile
912 plugins/project-wizard/templates/pygtk/po/Makefile
913 plugins/project-wizard/templates/vala-gtk/Makefile
914 plugins/project-wizard/templates/vala-gtk/src/Makefile
915 plugins/project-wizard/templates/wxwin/Makefile
916 plugins/project-wizard/templates/wxwin/src/Makefile
917 plugins/project-wizard/templates/wxwin/po/Makefile
918 plugins/project-wizard/templates/xlib/Makefile
919 plugins/project-wizard/templates/xlib/src/Makefile
920 plugins/project-wizard/templates/xlib/po/Makefile
921 plugins/project-wizard/templates/xlib-dock/Makefile
922 plugins/project-wizard/templates/xlib-dock/src/Makefile
923 plugins/project-wizard/templates/xlib-dock/po/Makefile
924 plugins/project-wizard/templates/sdl/Makefile
925 plugins/project-wizard/templates/sdl/src/Makefile
926 plugins/project-wizard/templates/sdl/po/Makefile
927 plugins/project-wizard/templates/library/Makefile
928 plugins/project-wizard/templates/library/src/Makefile
929 plugins/project-wizard/templates/library/po/Makefile
930 plugins/project-wizard/templates/directory/Makefile
931 plugins/project-wizard/templates/m4/Makefile
932 plugins/project-wizard/templates/gnome-shell-extension/Makefile
933 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
934 plugins/project-wizard/templates/vala-library/Makefile
935 plugins/project-wizard/templates/vala-library/src/Makefile
936 plugins/project-wizard/templates/vala-library/po/Makefile
937 plugins/am-project/Makefile
938 plugins/am-project/tests/atlocal
939 plugins/am-project/tests/Makefile
940 plugins/mk-project/Makefile
941 plugins/dir-project/Makefile
942 plugins/language-support-cpp-java/Makefile
943 plugins/run-program/Makefile
944 plugins/starter/Makefile
945 plugins/indentation-c-style/Makefile
946 plugins/indentation-python-style/Makefile
947 plugins/language-support-js/Makefile
948 plugins/language-support-vala/Makefile
949 plugins/language-support-python/Makefile
950 plugins/parser-cxx/Makefile
951 plugins/parser-cxx/cxxparser/Makefile
952 plugins/python-loader/Makefile
953 plugins/jhbuild/Makefile
954 plugins/quick-open/Makefile
955 anjuta.desktop.in
956 manuals/Makefile
957 manuals/reference/Makefile
958 manuals/reference/libanjuta/Makefile
959 manuals/reference/libanjuta/version.xml
960 manuals/anjuta-manual/Makefile
961 manuals/anjuta-faqs/Makefile
962 manuals/anjuta-build-tutorial/Makefile
963 mime/Makefile
965 AC_OUTPUT
966 echo " "
967 echo "-------------------------------------------------------------------"
968 echo "Conditionally built plugins:"
969 echo "-------------------------------------------------------------------"
970 if [ test -n "$SVN_INCLUDE" ]; then
971         echo "Building subversion plugin: ............................YES"
972 else
973         echo "Building subversion plugin: ............................NO"
974                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
975                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
976                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
977                 echo "        Requires subversion (>= 1.5); http://subversion.org"
980 if [ test x$gladeui_found = xyes ]; then
981        echo "Building glade plugin: .................................YES"
982 else
983        echo "Building glade plugin: .................................NO"
984        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
987 if [ test x$devhelp_enabled = xyes ]; then
988        echo "Building devhelp plugin: ...............................YES"
989 else
990        echo "Building devhelp plugin: ...............................NO"
991        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
994 if [ test x$terminal_enabled = xyes ]; then
995        echo "Building terminal plugin: ..............................YES"
996 else
997        echo "Building terminal plugin: ..............................NO"
998        echo "        Requires vte-2.90 (>= $VTE_REQUIRED)"
1001 if [ test x$enable_vala = xyes ]; then
1002         echo "Building Vala support: .................................YES"
1003 else
1004         echo "Building Vala support: .................................NO"
1005         echo "        Requires libvala (>= $VALA_REQUIRED)"
1007 if [ test x$have_python = xyes]; then
1008         echo "Building python plugin loaeder: ........................YES"
1009 else
1010         echo "Building python plugin loaeder: ........................NO"
1011         echo "        Requires python"
1013 echo "-------------------------------------------------------------------"
1014 echo "AM_CFLAGS = $AM_CFLAGS"
1015 echo "AM_CXXFLAGS = $AM_CXXFLAGS"