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