Fixes NULL pointer dereference when closing tabs.
[anjuta.git] / configure.ac
blob1f45d5507e35c8afbb74f4ccb3ab2bff47930c38
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.64])
5 m4_define(anjuta_major_version,  2)
6 m4_define(anjuta_minor_version, 91)
7 m4_define(anjuta_micro_version, 6)
8 m4_define(anjuta_nano_version, 0)
9 m4_define(anjuta_version, anjuta_major_version.anjuta_minor_version.anjuta_micro_version.anjuta_nano_version)
11 AC_INIT([anjuta],
12         [anjuta_version],
13         [http://bugzilla.gnome.org/enter_bug.cgi?product=anjuta],
14         [anjuta],
15         [http://www.anjuta.org/])
17 AC_CONFIG_HEADERS([config.h])
18 AC_CONFIG_SRCDIR([src/main.c])
19 AC_CONFIG_MACRO_DIR([m4])
22 AC_DEFINE(ANJUTA_MAJOR_VERSION, anjuta_major_version, [Anjuta major version])
23 AC_SUBST(ANJUTA_MAJOR_VERSION, anjuta_major_version)
24 AC_DEFINE(ANJUTA_MINOR_VERSION, anjuta_minor_version, [Anjuta minor version])
25 AC_SUBST(ANJUTA_MINOR_VERSION, anjuta_minor_version)
26 AC_DEFINE(ANJUTA_MICRO_VERSION, anjuta_micro_version, [Anjuta micro version])
27 AC_SUBST(ANJUTA_MICRO_VERSION, anjuta_micro_version)
28 AC_DEFINE(ANJUTA_VERSION, anjuta_version, [Anjuta version])
29 AC_SUBST(ANJUTA_VERSION)
31 ANJUTA_VERSION=anjuta_version
32 AC_SUBST(ANJUTA_VERSION)
34 dnl Anjuta core
35 GLIB_REQUIRED=2.25.15
36 GTK_REQUIRED=2.29.4
37 GTHREAD_REQUIRED=2.22.0
38 GDK_PIXBUF_REQUIRED=2.0.0
39 GDA_REQUIRED=4.1.6
40 VTE_REQUIRED=0.13.1
41 LIBXML_REQUIRED=2.4.23
42 GDL_REQUIRED=2.91.1
43 LIBWNCK_REQUIRED=2.12
45 dnl GtkSourceView
46 GTKSOURCEVIEW_REQUIRED=2.91.4
48 dnl Devhelp
49 LIBDEVHELP_REQUIRED=2.90.6
51 dnl Glade
52 GLADEUI_REQUIRED=3.9.0
54 dnl Vala
55 VALA_REQUIRED=0.11.2
57 dnl Introspection
58 GI_REQUIRED=0.9.5
60 dnl Various
61 LIBGRAPHVIZ_REQUIRED=1.0
63 dnl Subversion plugin
64 NEON_REQUIRED=0.28.2
65 SVN_MAJOR=1
66 SVN_MINOR=5
67 SVN_PATCH=0
68 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
70 AM_INIT_AUTOMAKE([1.10 dist-bzip2 no-dist-gzip])
71 AM_MAINTAINER_MODE([enable])
73 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
75 dnl Check for C Compiler
76 AC_PROG_CC
77 AC_PROG_CPP
78 AC_PROG_LEX
79 if [["$LEX" != "flex"]]; then
80         AC_MSG_ERROR(flex is required)
82 AC_PROG_YACC
83 if [["$YACC" != "bison"]]; then
84         AC_MSG_ERROR(bison is required)
86 AC_LANG_C
87 AC_PROG_CXX
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         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-4.0 >= $GDA_REQUIRED])
164         
165 PKG_CHECK_MODULES([VTE],
166    [vte-2.90 >= $VTE_REQUIRED])
169 dnl Check for autogen
170 dnl -----------------
171 AC_PATH_PROG(AUTOGEN_PATH, autogen,no)
172 if test x$AUTOGEN_PATH = xno; then
173    AC_MSG_WARN([Couldn't find autogen. You will be able to build anjuta without autogen \
174                 but several things won't work. You can get it from http://autogen.sourceforge.net/])
177 dnl Check for Devhelp
178 dnl -----------------
180 AC_ARG_ENABLE(plugin-devhelp,
181   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
182   [ if test "$enableval" = "no"; then
183        user_disabled_devhelp=1
184     fi ],
185   [ user_disabled_devhelp=0 ] )
187 AC_MSG_CHECKING(if devhelp plugin is disabled)
188 if test "$user_disabled_devhelp" = 1; then
189         AC_MSG_RESULT(yes)
190         devhelp_enabled="no"
191 else
192         AC_MSG_RESULT(no)
193         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
194                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
195                                 [
196                                     devhelp_enabled=yes
197                                 ], [
198                                     devhelp_enabled=no
199                                 ])
202 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
204 dnl Check for Glade3
205 dnl ---------------------
207 AC_ARG_ENABLE(plugin-glade,
208   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
209   [ if test "$enableval" = "no"; then
210        user_disabled_glade=1
211     fi ],
212   [ user_disabled_glade=0 ] )
214 AC_MSG_CHECKING(if glade plugin is disabled)
215 if test "$user_disabled_glade" = 1; then
216         AC_MSG_RESULT(yes)
217         gladeui_found="no"
218 else
219         AC_MSG_RESULT(no)
220         gladeui_version=0
221         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
222             [
223                 gladeui_found=yes
224             ], [
225                 gladeui_found=no
226             ])
229 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
231 dnl Check for gtksourceview
232 dnl -------------------------------------------------------------
233 PKG_CHECK_MODULES(SOURCEVIEW,
234                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
236 dnl Check for vala
237 dnl -------------------------------------------------------------
239 AC_ARG_ENABLE(vala,
240         AC_HELP_STRING([--disable-vala],[Disable vala support]),
241         [ if test "$enableval" = "no"; then
242                 user_disabled_vala=1
243           fi ],
244         [ user_disabled_vala=0 ])
246 AC_MSG_CHECKING(if vala support is disabled)
247 if test "$user_disabled_vala" = 1; then
248         AC_MSG_RESULT(yes)
249         enable_vala="no"
250 else
251         AC_MSG_RESULT(no)
252         enable_vala="yes"
253         PKG_CHECK_MODULES(VALA,
254                 [libvala-0.12 >= $VALA_REQUIRED])
257 if test x$enable_vala = xyes; then
258         AC_PATH_PROGS(VALAC, [valac-0.12 valac], valac)
259         AC_SUBST(VALAC)
262 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
264 dnl Check for Python
265 dnl -------------------------------------------------------------
267 AM_PATH_PYTHON([],
268         [have_python="yes"],
269         [have_python="no"])
271 if test x$have_python = xyes; then
272         if test -x $PYTHON-config; then
273                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
274                 PYTHON_LIBS=`$PYTHON-config --libs`
275                 AC_SUBST(PYTHON_CFLAGS)
276                 AC_SUBST(PYTHON_LIBS)
277         else
278                 have_python="no"
279         fi
282 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
284 PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
285                 [libgda-4.0 >= $GDA_REQUIRED])
287 dnl Setup Anjuta Library flags
288 dnl --------------------------
289 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)"\"'
290 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
291 AC_SUBST(LIBANJUTA_CFLAGS)
292 AC_SUBST(LIBANJUTA_LIBS)
294 dnl Setup FooCanvas Library flags
295 dnl --------------------------
296 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
297 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
298 AC_SUBST(LIBFOOCANVAS_CFLAGS)
299 AC_SUBST(LIBFOOCANVAS_LIBS)
301 dnl Checks for Xft/XRender for foocanvas
303 AC_CHECK_LIB(Xrender, XRenderFindFormat,
304         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
305          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
306         [AC_SUBST(RENDER_LIBS, "")],
307         [-lXext])
309 dnl Setup Plugin directories
310 dnl ------------------------
311 anjuta_plugin_dir='$(libdir)/anjuta'
312 anjuta_data_dir='$(datadir)/anjuta'
313 anjuta_ui_dir='$(datadir)/anjuta/ui'
314 anjuta_glade_dir='$(datadir)/anjuta/glade'
315 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
316 AC_SUBST(anjuta_plugin_dir)
317 AC_SUBST(anjuta_data_dir)
318 AC_SUBST(anjuta_ui_dir)
319 AC_SUBST(anjuta_glade_dir)
320 AC_SUBST(anjuta_image_dir)
322 dnl ***************************************************************************
323 dnl Check for marshal and enum generators
324 dnl ***************************************************************************
325 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
326 AC_SUBST(GLIB_GENMARSHAL)
327 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
328 AC_SUBST(GLIB_MKENUMS)
330 dnl Set up Glade 3 catlog information
331 dnl ---------------------
332 GLADE_PLUGINS_PATH="`$PKG_CONFIG --variable=moduledir gladeui-1.0`"
333 AC_SUBST(GLADE_PLUGINS_PATH)
334 GLADE_CATALOG_PATH="`$PKG_CONFIG --variable=catalogdir gladeui-1.0`"
335 AC_SUBST(GLADE_CATALOG_PATH)
337 dnl ***************************************************************************
338 dnl Internatinalization
339 dnl ***************************************************************************
340 IT_PROG_INTLTOOL([0.40.1])
342 AM_GNU_GETTEXT([external])
343 AM_GNU_GETTEXT_VERSION([0.17])
345 GETTEXT_PACKAGE=anjuta
346 AC_SUBST(GETTEXT_PACKAGE)
347 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
349 BISON_I18N
351 dnl ***************************************************************************
352 dnl Check for gtk-doc.
353 dnl ***************************************************************************
354 GTK_DOC_CHECK([1.4])
356 dnl ***************************************************************************
357 dnl User manual
358 dnl ***************************************************************************
359 GNOME_DOC_INIT([0.18])
361 dnl Define convenience macros
362 dnl -------------------------
363 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
364 AC_DEFUN([CHECK_HEADER_DEFINE],
366         AC_MSG_CHECKING("if $1 is defined in $2")
367         AC_EGREP_CPP(yes,
368 [#include <$2>
369 #ifdef $1
370   yes
371 #endif
372 ], [
373         AC_MSG_RESULT(yes)
374         $3
375 ], [
376         AC_MSG_RESULT(no)
377         $4
378 ]) ])
380 dnl Checks for header files.
381 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
382 AC_CHECK_HEADERS(time.h types.h unistd.h)
383 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
385 dnl Checks for typedefs, structures, and compiler characteristics.
387 AC_CANONICAL_HOST
388 CYGWIN=no
389 MINGW32=no
390 case $host_os in
391   *cygwin* ) CYGWIN=yes;;
392   *mingw32* ) MINGW32=yes;;
393 esac
396 AC_C_CONST
397 AC_OBJEXT
398 AC_EXEEXT
400 AC_TYPE_SIZE_T
401 AC_TYPE_OFF_T
403 AC_MSG_CHECKING("for fpos_t")
404 AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),
406     AC_MSG_RESULT(no)
407     AC_DEFINE(fpos_t, long, [fpos_t is type long])
410 AC_MSG_CHECKING("for clock_t")
411 AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
413     AC_MSG_RESULT(no)
414     AC_DEFINE(clock_t, long, [clock_t is type long])
417 CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20, [L_tmpname is 20]))
419 CHECK_HEADER_DEFINE(INT_MAX, limits.h,,
420     CHECK_HEADER_DEFINE(MAXINT, limits.h,
421         AC_DEFINE(INT_MAX, MAXINT, [Maximum int size]), AC_DEFINE(INT_MAX, 32767, [Maximum int size])))
423 AC_MSG_CHECKING(if struct stat contains st_ino)
424 AC_LANG([C])
425 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
426     struct stat st;
427     stat(".", &st);
428     if (st.st_ino > 0)
429         exit(0);
430 ]])],[have_st_ino=yes],[have_st_ino=no])
431 AC_MSG_RESULT($have_st_ino)
432 if test yes = "$have_st_ino"; then
433     AC_DEFINE(HAVE_STAT_ST_INO,,[Have stat st_ino])
437 dnl Check for bind in libsocket (needed on Solaris)
438 AC_CHECK_LIB(socket, bind)
440 dnl Check for function forkpty and related headers
441 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
442 AC_CHECK_HEADERS(libutil.h util.h pty.h)
444 dnl Checks for library functions.
445 AC_CHECK_FUNCS(fnmatch)
446 AC_CHECK_FUNCS(strstr)
447 AC_CHECK_FUNCS(stricmp)
448 AC_CHECK_FUNCS(strnicmp)
449 AC_CHECK_FUNCS(getline)
451 dnl for libegg/egg-recent-model.c
452 AC_CHECK_DECLS([lockf])
453 AC_CHECK_FUNCS([lockf])
455 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
457 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
458 if test "$have_fgetpos" != yes ; then
459     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
460         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
461             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
464 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
465 if test "$have_mkstemp" != yes ; then
466     AC_CHECK_FUNCS(chmod)
467     if test "$tmpdir_specified" = yes ; then
468         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
469     fi
470 else
471     AC_MSG_CHECKING(directory to use for temporary files)
472     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
473         then tmpdir=/tmp
474         else tmpdir="$enable_tmpdir"
475     fi
476     if test -d $tmpdir ; then
477         AC_MSG_RESULT($tmpdir)
478         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
479     else
480         AC_MSG_WARN($tmpdir does not exist)
481     fi
484 AC_CHECK_FUNCS(strerror opendir)
485 AC_CHECK_FUNCS(clock times, break)
486 AC_CHECK_FUNCS(remove, have_remove=yes,
487     CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink, [Remove is unlink])))
489 AC_CHECK_FUNCS(truncate, have_truncate=yes)
490 dnl === Cannot nest AC_CHECK_FUNCS() calls
491 if test "$have_truncate" != yes  ; then
492     AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes)
493     if test "$have_ftruncate" != yes ; then
494         AC_CHECK_FUNCS(chsize)
495     fi
498 AC_CHECK_FUNCS(setenv, have_setenv=yes)
499 dnl === Cannot nest AC_CHECK_FUNCS() calls
500 if test "$have_setenv" != yes ; then
501     AC_CHECK_FUNCS(putenv, have_putenv=yes)
502     if test "$have_putenv" = yes ; then
503         AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes)
504         if test "$have_putenv_prototype" = yes ; then
505             AC_MSG_CHECKING("putenv prototype")
506             AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[   ]*\(.*const.*\)[    ]*;],
507                 stdlib.h, AC_MSG_RESULT(correct),
508                 [
509                     AC_MSG_RESULT(no const)
510                     AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE,,[putenv has non constant prototype])
511                 ])
512         fi
513     fi
516 dnl -----------------------------
517 dnl Checks for FreeBSD Build
518 dnl -----------------------------
519 AC_MSG_CHECKING(if building on FreeBSD)
521 if test `uname -s` = "FreeBSD" ; then
522         AC_MSG_RESULT(yes)
523         FREEBSD_BUILD=-DFREEBSD
524         AC_SUBST(FREEBSD_BUILD)
525         AC_PATH_PROG(GMAKE, gmake, no)
526         if test "x$GMAKE" = "xno"; then
527                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
528         fi
529 else
530         AC_MSG_RESULT(no)
531         GMAKE="make"
534 AC_SUBST(GMAKE)
536 dnl Checks for missing prototypes
537 dnl -----------------------------
538 AC_MSG_NOTICE([checking for missing prototypes...])
540 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))])
542 if test "$have_remove" = yes ; then
543     CHECK_PROTO(remove, stdio.h)
544 else
545     CHECK_PROTO(unlink, unistd.h)
547 CHECK_PROTO(malloc, stdlib.h)
548 CHECK_PROTO(getenv, stdlib.h)
549 CHECK_PROTO(stat,   sys/stat.h)
550 CHECK_PROTO(lstat,  sys/stat.h)
551 if test "$have_fgetpos" = yes ; then
552     CHECK_PROTO(fgetpos, stdio.h)
554 if test "$have_truncate" = yes ; then
555     CHECK_PROTO(truncate, unistd.h)
557 if test "$have_ftruncate" = yes ; then
558     CHECK_PROTO(ftruncate, unistd.h)
561 dnl  **********************************************************
562 dnl  check if we have svn libraries to build subversion plugin
563 dnl  (stolen from kdevelop ;-)
564 dnl  **********************************************************
566 AC_MSG_CHECKING(for Subversion svn-config)
567 AC_ARG_WITH(subversion-dir,
568                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
569                 [
570                                 SVNCONFIG="$withval/bin/svn-config"
571                 ])
573 if test -z "$SVNCONFIG"; then
574                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
575                 if test -n "$_SVNCONFIG"; then
576                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
577                 fi
580 AC_SUBST(SVNCONFIG)
581 if test -x "$SVNCONFIG"; then
582                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
583                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
584                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
585                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
586                 AC_MSG_RESULT(yes)
587 else
588                 AC_MSG_RESULT(not found)
590                 dnl just a fallback to debian's config so that it works for me :)
591                 AC_ARG_WITH(svn-include,
592                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
593                                                                 [
594                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
595                                                                                 SVN_INCLUDES=$withval
596                                                                 fi
597                                                                 ])
598                 if test -z "$SVN_INCLUDES"; then
599                         SVN_INCLUDES="/usr/local/include /usr/include"
600                 fi
601                 AC_MSG_CHECKING([for Subversion headers])
602                 SVN_INCLUDE=""
603                 for VALUE in $SVN_INCLUDES ; do
604                                 if test -f $VALUE/subversion-1/svn_types.h ; then
605                                                 SVN_INCLUDE=$VALUE/subversion-1
606                                                 break
607                                 fi
608                                 if test -f $VALUE/svn_types.h ; then
609                                                 SVN_INCLUDE=$VALUE
610                                                 break
611                                 fi
612                 done
613                 if test $SVN_INCLUDE ; then
614                                 AC_MSG_RESULT([found])
615                 else
616                                 AC_MSG_RESULT([not found])
617                 fi
618                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
619                 AC_ARG_WITH(svn-lib,
620                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
621                                                 [
622                                                         if test "$withval" != "yes" -a "$withval" != ""; then
623                                                                 SVN_LIBS=$withval
624                                                         fi
625                                                 ])
626                 AC_MSG_CHECKING([for Subversion libraries])
627                 SVN_LIB=""
628                 for VALUE in $SVN_LIBS ; do
629                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
630                                                 SVN_LIB=$VALUE
631                                                 break
632                                 fi
633                 done
634                 if test $SVN_LIB ; then
635                                 AC_MSG_RESULT([found])
636                 else
637                                 AC_MSG_RESULT([not found])
638                 fi
641 dnl ******************************************************************
642 dnl Check for extra libs required by subversion.
643 dnl FIXME: This should actually be done by subversion and not by us.
644 dnl ******************************************************************
646 AC_ARG_ENABLE(plugin-subversion,
647   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
648   [ if test "$enableval" = "no"; then
649         user_disabled_subversion=1
650     fi ],
651   [ user_disabled_subversion=0 ] )
653 AC_MSG_CHECKING(if subversion support is disabled)
654 if test "$user_disabled_subversion" = 1; then
655         AC_MSG_RESULT(yes)
656         SVN_INCLUDE=""
657         SVN_LIB=""
658 else
659         AC_MSG_RESULT(no)
662 if test -n "$SVN_INCLUDE" ; then
663         dnl ------------------------------------
664         dnl APR. Required by subversion (devel)
665         dnl ------------------------------------
666         have_atr=no
667         PKG_CHECK_MODULES(APR,                            \
668                 apr-1, have_apr=yes, have_apr=no)
669         if test x"$have_apr" = "xno"; then
670                 SVN_INCLUDE=""
671         fi
673         dnl -----------------------------------------
674         dnl APR util. Required by subversion (devel)
675         dnl------------------------------------------
676         have_atr_util=no
677         PKG_CHECK_MODULES(APR_UTILS,                            \
678                 apr-util-1, have_apr_util=yes, have_apr_util=no)
679         if test x"$have_apr_util" = "xno"; then
680                 SVN_INCLUDE=""
681         fi
683         dnl -----------------------------------------
684         dnl NEON. Required by subversion (devel)
685         dnl------------------------------------------
686         have_neon=no
687         PKG_CHECK_MODULES(NEON,                            \
688                 neon, have_neon=yes, have_neon=no)
689         if test x"$have_neon" = "xno"; then
690                 SVN_INCLUDE=""
691         fi
693         dnl Make sure our SVN version is high enough
694         dnl Eww, eww, eww, this is dirty
695         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
696         AC_LANG([C])
697         dnl Temporarily set CFLAGS so that include dirs are found
698         CFLAGS_TMP=$CFLAGS
699         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
700         AC_COMPILE_IFELSE(
701                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
702                         [[
703                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
704                                 #       error "Version too low"
705                                 #endif
706                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
707         if test x"$have_svn_version" = "xno"; then
708                 AC_MSG_RESULT(no)
709                 SVN_INCLUDE=""
710         fi
711         CFLAGS=$CFLAGS_TMP
714 dnl ------------------------------------------
715 dnl Finally prepare subversion build flags
716 dnl ------------------------------------------
718 if test -n "$SVN_INCLUDE" ; then
719         SVN_INCLUDE="-I$SVN_INCLUDE"
720         if test x != "x$SVN_LIB" ; then
721             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
722         else
723             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
724         fi
725         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
728 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
729 AC_SUBST(SVN_INCLUDE)
730 AC_SUBST(SVN_LIB)
731 AC_SUBST(SVN_CFLAGS)
733 dnl ------------------------------------------
734 dnl Symbol-db shared memory checks
735 dnl ------------------------------------------
737 SYMBOL_DB_SHM="/dev/shm"
738 user_specified_shm=0
739 AC_MSG_CHECKING(for symbol-db shared memory)
740 AC_ARG_WITH(symbol-db-shm,
741                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
742                 [
743                                 user_specified_shm=1
744                                 SYMBOL_DB_SHM="$withval"
745                 ])
746 if test "$user_specified_shm" = 1; then
747         AC_MSG_RESULT(yes)
748 else
749         AC_MSG_RESULT(no)
752 AC_SUBST(SYMBOL_DB_SHM)
755 dnl Check for graphviz (class inheritance and profiler plugins)
756 AC_ARG_ENABLE(graphviz,
757         AS_HELP_STRING([--disable-graphviz],[Disable GraphViz support in Anjuta]),
758         [ if test "$enableval" = "no"; then
759                 user_disabled_graphviz=1
760           fi ],
761         [ user_disabled_graphviz=0 ])
763 AC_MSG_CHECKING(if GraphViz support is disabled)
764 if test "$user_disabled_graphviz" = 1; then
765         AC_MSG_RESULT(yes)
766         libgraphviz_found="no"
767 else
768         AC_MSG_RESULT(no)
769         PKG_CHECK_MODULES(GRAPHVIZ,
770                 [libgvc >= $LIBGRAPHVIZ_REQUIRED libgraph >= $LIBGRAPHVIZ_REQUIRED],
771                 [libgraphviz_found="yes"],
772                 [libgraphviz_found="no"])
775 AM_CONDITIONAL(HAVE_GRAPHVIZ, [test x$libgraphviz_found = xyes])
777 dnl Test using autotest
778 dnl -----------------------------
779 AC_CONFIG_TESTDIR(plugins/am-project/tests)
780 AM_MISSING_PROG([AUTOM4TE], [autom4te])
782 AC_CONFIG_FILES([
783 Makefile
784 po/Makefile.in
785 libanjuta/Makefile
786 libanjuta/interfaces/Makefile
787 libanjuta/libanjuta-3.0.pc
788 libanjuta/anjuta-version.h
789 src/Makefile
790 pixmaps/Makefile
791 pixmaps/16x16/Makefile
792 pixmaps/22x22/Makefile
793 pixmaps/24x24/Makefile
794 pixmaps/32x32/Makefile
795 pixmaps/48x48/Makefile
796 pixmaps/scalable/Makefile
797 data/Makefile
798 data/welcome.txt
799 doc/anjuta.1
800 doc/anjuta-launcher.1
801 doc/Makefile
802 scripts/Makefile
803 launcher/Makefile
804 plugins/Makefile
805 plugins/class-gen/Makefile
806 plugins/class-gen/templates/Makefile
807 plugins/code-analyzer/Makefile
808 plugins/patch/Makefile
809 plugins/document-manager/Makefile
810 plugins/document-manager/images/Makefile
811 plugins/message-view/Makefile
812 plugins/gdb/Makefile
813 plugins/gdb/images/Makefile
814 plugins/debug-manager/Makefile
815 plugins/debug-manager/images/Makefile
816 plugins/devhelp/Makefile
817 plugins/devhelp/images/Makefile
818 plugins/glade/Makefile
819 plugins/glade/images/Makefile
820 plugins/js-debugger/Makefile
821 plugins/file-manager/Makefile
822 plugins/file-loader/Makefile
823 plugins/file-wizard/Makefile
824 plugins/build-basic-autotools/Makefile
825 plugins/project-manager/Makefile
826 plugins/symbol-db/benchmark/Makefile
827 plugins/symbol-db/benchmark/symbol-db/Makefile
828 plugins/symbol-db/benchmark/libgda/Makefile
829 plugins/symbol-db/benchmark/sqlite/Makefile
830 plugins/symbol-db/images/Makefile
831 plugins/symbol-db/Makefile
832 plugins/symbol-db/anjuta-tags/Makefile
833 plugins/project-wizard/Makefile
834 plugins/snippets-manager/Makefile
835 plugins/cvs-plugin/Makefile
836 plugins/subversion/Makefile
837 plugins/git/Makefile
838 plugins/git/images/Makefile
839 plugins/sourceview/Makefile
840 plugins/terminal/Makefile
841 plugins/tools/Makefile
842 plugins/tools/scripts/Makefile
843 plugins/language-manager/Makefile
844 plugins/project-import/Makefile
845 plugins/project-wizard/templates/Makefile
846 plugins/project-wizard/templates/mkfile/Makefile
847 plugins/project-wizard/templates/mkfile/src/Makefile
848 plugins/project-wizard/templates/mkfile/po/Makefile
849 plugins/project-wizard/templates/minimal/Makefile
850 plugins/project-wizard/templates/js_minimal/Makefile
851 plugins/project-wizard/templates/js_minimal/src/Makefile
852 plugins/project-wizard/templates/terminal/Makefile
853 plugins/project-wizard/templates/terminal/src/Makefile
854 plugins/project-wizard/templates/terminal/po/Makefile
855 plugins/project-wizard/templates/cpp/Makefile
856 plugins/project-wizard/templates/cpp/src/Makefile
857 plugins/project-wizard/templates/cpp/po/Makefile
858 plugins/project-wizard/templates/gtk/Makefile
859 plugins/project-wizard/templates/gtk/src/Makefile
860 plugins/project-wizard/templates/gtk/po/Makefile
861 plugins/project-wizard/templates/gtkapplication/Makefile
862 plugins/project-wizard/templates/gtkapplication/src/Makefile
863 plugins/project-wizard/templates/gtkapplication/po/Makefile
864 plugins/project-wizard/templates/anjuta-plugin/Makefile
865 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
866 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
867 plugins/project-wizard/templates/gtkmm/Makefile
868 plugins/project-wizard/templates/gtkmm/src/Makefile
869 plugins/project-wizard/templates/gtkmm/po/Makefile
870 plugins/project-wizard/templates/gcj/Makefile
871 plugins/project-wizard/templates/gcj/src/Makefile
872 plugins/project-wizard/templates/java/Makefile
873 plugins/project-wizard/templates/java/src/Makefile
874 plugins/project-wizard/templates/java/po/Makefile
875 plugins/project-wizard/templates/python/Makefile
876 plugins/project-wizard/templates/python/src/Makefile
877 plugins/project-wizard/templates/python/po/Makefile
878 plugins/project-wizard/templates/pygtk/Makefile
879 plugins/project-wizard/templates/pygtk/src/Makefile
880 plugins/project-wizard/templates/pygtk/po/Makefile
881 plugins/project-wizard/templates/pygtk/data/Makefile
882 plugins/project-wizard/templates/vala-gtk/Makefile
883 plugins/project-wizard/templates/vala-gtk/src/Makefile
884 plugins/project-wizard/templates/wxwin/Makefile
885 plugins/project-wizard/templates/wxwin/src/Makefile
886 plugins/project-wizard/templates/wxwin/po/Makefile
887 plugins/project-wizard/templates/xlib/Makefile
888 plugins/project-wizard/templates/xlib/src/Makefile
889 plugins/project-wizard/templates/xlib/po/Makefile
890 plugins/project-wizard/templates/xlib-dock/Makefile
891 plugins/project-wizard/templates/xlib-dock/src/Makefile
892 plugins/project-wizard/templates/xlib-dock/po/Makefile
893 plugins/project-wizard/templates/sdl/Makefile
894 plugins/project-wizard/templates/sdl/src/Makefile
895 plugins/project-wizard/templates/sdl/po/Makefile
896 plugins/project-wizard/templates/licenses/Makefile
897 plugins/project-wizard/templates/library/Makefile
898 plugins/project-wizard/templates/library/src/Makefile
899 plugins/project-wizard/templates/library/po/Makefile
900 plugins/project-wizard/templates/directory/Makefile
901 plugins/project-wizard/templates/m4/Makefile
902 plugins/am-project/Makefile
903 plugins/am-project/tests/atlocal
904 plugins/am-project/tests/Makefile
905 plugins/mk-project/Makefile
906 plugins/dir-project/Makefile
907 plugins/language-support-cpp-java/Makefile
908 plugins/language-support-cpp-java/cxxparser/Makefile
909 plugins/run-program/Makefile
910 plugins/starter/Makefile
911 plugins/language-support-js/Makefile
912 plugins/language-support-vala/Makefile
913 plugins/language-support-python/Makefile
914 plugins/python-loader/Makefile
915 anjuta.desktop.in
916 manuals/Makefile
917 manuals/reference/Makefile
918 manuals/reference/libanjuta/Makefile
919 manuals/reference/libanjuta/version.xml
920 manuals/anjuta-manual/Makefile
921 manuals/anjuta-faqs/Makefile
922 manuals/anjuta-build-tutorial/Makefile
923 mime/Makefile
925 AC_OUTPUT
926 echo " "
927 echo "-------------------------------------------------------------------"
928 echo "Conditionally built plugins:"
929 echo "-------------------------------------------------------------------"
930 if [ test -n "$SVN_INCLUDE" ]; then
931         echo "Building subversion plugin: ............................YES"
932 else
933         echo "Building subversion plugin: ............................NO"
934                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
935                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
936                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
937                 echo "        Requires subversion (>= 1.5); http://subversion.org"
940 if [ test x$gladeui_found = xyes ]; then
941        echo "Building glade plugin: .................................YES"
942 else
943        echo "Building glade plugin: .................................NO"
944        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
947 if [ test x$devhelp_enabled = xyes ]; then
948        echo "Building devhelp plugin: ...............................YES"
949 else
950        echo "Building devhelp plugin: ...............................NO"
951        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
953 if [ test x$enable_vala = xyes ]; then
954         echo "Building Vala support: .................................YES"
955 else
956         echo "Building Vala support: .................................NO"
957         echo "        Requires libvala (>= $VALA_REQUIRED)"
959 if [ test x$libgraphviz_found = xyes ]; then
960         echo "Building class inheritance plugin: .....................YES"
961 else
962         echo "Building class inheritance plugin: .....................NO"
963         echo "        Requires graphviz (>= 2.6.0); http://graphviz.org"
965 echo "-------------------------------------------------------------------"
966 echo "AM_CFLAGS = $AM_CFLAGS"
967 echo "AM_CXXFLAGS = $AM_CXXFLAGS"