build-basic-autotools:bgo#688293 - build-basic-autotools: Fix invalid read
[anjuta.git] / configure.ac
blobf01dc87ef32b3aeeed806eb2003f5029b4dc5045
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, 7)
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.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 VTE_REQUIRED=0.27.6
41 LIBXML_REQUIRED=2.4.23
42 GDL_REQUIRED=3.5.5
43 LIBWNCK_REQUIRED=2.12
45 dnl GtkSourceView
46 GTKSOURCEVIEW_REQUIRED=3.0.0
48 dnl Devhelp
49 LIBDEVHELP_REQUIRED=3.4.2
51 dnl Glade
52 GLADEUI_REQUIRED=3.12.0
54 dnl Introspection
55 GI_REQUIRED=0.9.5
57 dnl Subversion plugin
58 NEON_REQUIRED=0.28.2
59 SVN_MAJOR=1
60 SVN_MINOR=5
61 SVN_PATCH=0
62 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
64 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip])
65 AM_MAINTAINER_MODE([enable])
67 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
69 dnl Check for C Compiler
70 AC_PROG_CC
71 AC_PROG_CPP
72 AC_PROG_LEX
73 if test "$LEX" != "flex"; then
74         AC_MSG_ERROR(flex is required)
76 AC_PROG_YACC
77 if test "$YACC" != "bison -y"; then
78         AC_MSG_ERROR(bison is required)
80 AC_LANG([C])
81 AC_LANG([C++])
82 AC_PROG_CXX
83 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],,
84    AC_MSG_ERROR([C++ Compiler required to compile Anjuta]))
85 AM_PROG_CC_C_O
87 GNOME_COMPILE_WARNINGS([maximum])
88 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
89 AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
91 dnl Enable debugging mode
92 AC_ARG_ENABLE(debug,
93   AS_HELP_STRING([--enable-debug],[Enable debug messages]),
94   [if test "x$enableval" = "xyes"; then
95       AM_CFLAGS="$AM_CFLAGS -DDEBUG"
96   fi]
97   AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG")
98 AC_SUBST(AM_CFLAGS)
99 AC_SUBST(AM_CXXFLAGS)
101 ANJUTA_LDFLAGS="-no-undefined"
102 ANJUTA_PLUGIN_LDFLAGS="-module -avoid-version -no-undefined"
103 AC_SUBST(ANJUTA_LDFLAGS)
104 AC_SUBST(ANJUTA_PLUGIN_LDFLAGS)
106 dnl GSettings
107 GLIB_GSETTINGS
109 dnl Disable deprecated APIs
110 dnl if test x$MAINT = x; then
111 dnl     DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
112 dnl     AC_SUBST(DEPRECATED_FLAGS)
113 dnl fi
115 dnl Check for pkg-config
116 PKG_PROG_PKG_CONFIG([0.22])
118 dnl Enable versioned user preferences directory
119 AC_ARG_WITH(pref-suffix,
120   AS_HELP_STRING([--with-pref-suffix=VALUE],[Suffix to add to user preferences dir.]),
121   PREF_SUFFIX="$withval")
123 AC_SUBST(PREF_SUFFIX)
124 AC_DEFINE_UNQUOTED(PREF_SUFFIX,
125       "${PREF_SUFFIX}",
126           [Suffix to add to preferences directory])
128 # Initialize libtool
129 LT_PREREQ([2.2])
130 LT_INIT([disable-static])
132 dnl ***************************************************************************
133 dnl Check for GObject-Introspection
134 dnl ***************************************************************************
135 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [GOBJECT_INTROSPECTION_CHECK([0.6.7])],
136 [AM_CONDITIONAL(HAVE_INTROSPECTION, false)])
138 dnl ***************************************************************************
139 dnl Set gjsdir
140 dnl ***************************************************************************
141 gjsdir=`pkg-config --variable=jsdir gjs-1.0`
142 AC_SUBST(gjsdir)
144 dnl Check base modules
146 PKG_CHECK_MODULES([ANJUTA],
147    [gthread-2.0 >= $GTHREAD_REQUIRED
148         glib-2.0 >= $GLIB_REQUIRED
149         gio-2.0 >= $GLIB_REQUIRED
150         gmodule-2.0 >= $GLIB_REQUIRED
151         gtk+-3.0 >= $GTK_REQUIRED
152         gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
154 PKG_CHECK_MODULES([XML],
155    [libxml-2.0 >= $LIBXML_REQUIRED])
157 PKG_CHECK_MODULES([GDL],
158    [gdl-3.0 >= $GDL_REQUIRED])
160 PKG_CHECK_MODULES([GDA],
161    [libgda-5.0 >= $GDA5_REQUIRED],,
162    [PKG_CHECK_MODULES([GDA],
163       [libgda-4.0 >= $GDA4_REQUIRED])])
164         
165 PKG_CHECK_MODULES([VTE],
166    [vte-2.90 >= $VTE_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 Devhelp
177 dnl -----------------
179 AC_ARG_ENABLE(plugin-devhelp,
180   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
181   [ if test "$enableval" = "no"; then
182        user_disabled_devhelp=1
183     fi ],
184   [ user_disabled_devhelp=0 ] )
186 AC_MSG_CHECKING(if devhelp plugin is disabled)
187 if test "$user_disabled_devhelp" = 1; then
188         AC_MSG_RESULT(yes)
189         devhelp_enabled="no"
190 else
191         AC_MSG_RESULT(no)
192         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
193                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
194                                 [
195                                     devhelp_enabled=yes
196                                 ], [
197                                     devhelp_enabled=no
198                                 ])
201 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
203 dnl Check for Glade3
204 dnl ---------------------
206 AC_ARG_ENABLE(plugin-glade,
207   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
208   [ if test "$enableval" = "no"; then
209        user_disabled_glade=1
210     fi ],
211   [ user_disabled_glade=0 ] )
213 AC_MSG_CHECKING(if glade plugin is disabled)
214 if test "$user_disabled_glade" = 1; then
215         AC_MSG_RESULT(yes)
216         gladeui_found="no"
217 else
218         AC_MSG_RESULT(no)
219         gladeui_version=0
220         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
221             [
222                 gladeui_found=yes
223             ], [
224                 gladeui_found=no
225             ])
228 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
230 dnl Check for gtksourceview
231 dnl -------------------------------------------------------------
232 PKG_CHECK_MODULES(SOURCEVIEW,
233                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
235 dnl Check for vala
236 dnl -------------------------------------------------------------
238 AC_ARG_ENABLE(vala,
239         AS_HELP_STRING([--disable-vala],[Disable vala support]),
240         [ if test "$enableval" = "no"; then
241                 user_disabled_vala=1
242           fi ],
243         [ user_disabled_vala=0 ])
245 AC_MSG_CHECKING(if vala support is disabled)
246 if test "$user_disabled_vala" = 1; then
247         AC_MSG_RESULT(yes)
248         enable_vala="no"
249 else
250         AC_MSG_RESULT(no)
251         AC_MSG_CHECKING(if libvala is available)
252         PKG_CHECK_EXISTS([ libvala-0.18 ],
253                          [ valaver="-0.18" ],
254                          [ PKG_CHECK_EXISTS([ libvala-0.16 ],
255                                             [ valaver="-0.16" ],
256                                             [ valaver="" ])
257                          ])
258         if test "x$valaver" != "x"; then
259                 AC_MSG_RESULT(yes)
260                 enable_vala="yes"
261                 LIBVALA="libvala${valaver}"
262                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
263         else
264                 AC_MSG_RESULT(no)
265                 enable_vala="no"
266                 VALA_REQUIRED=0.16.0
267         fi
268         AC_SUBST(LIBVALA)
271 if test x$enable_vala = xyes; then
272         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
273         AC_SUBST(VALAC)
276 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
278 dnl Check for Python
279 dnl -------------------------------------------------------------
281 AM_PATH_PYTHON([],
282         [have_python="yes"],
283         [have_python="no"])
285 if test x$have_python = xyes; then
286         if test -x $PYTHON-config; then
287                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
288                 PYTHON_LIBS=`$PYTHON-config --libs`
289                 AC_SUBST(PYTHON_CFLAGS)
290                 AC_SUBST(PYTHON_LIBS)
291         elif test -x $PYTHON$PYTHON_VERSION-config; then
292                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
293                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
294                 AC_SUBST(PYTHON_CFLAGS)
295                 AC_SUBST(PYTHON_LIBS)           
296         else
297                 have_python="no"
298                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
299         fi
302 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
304 dnl Disable packagekit support
305 dnl -----------------------------------
306 AC_ARG_ENABLE(packagekit,
307   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
308   [enable_packagekit=yes])
309 if test "x$enable_packagekit" != "xno"; then
310   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
313 dnl Setup Anjuta Library flags
314 dnl --------------------------
315 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)"\"'
316 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
317 AC_SUBST(LIBANJUTA_CFLAGS)
318 AC_SUBST(LIBANJUTA_LIBS)
320 dnl Setup FooCanvas Library flags
321 dnl --------------------------
322 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
323 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
324 AC_SUBST(LIBFOOCANVAS_CFLAGS)
325 AC_SUBST(LIBFOOCANVAS_LIBS)
327 dnl Checks for Xft/XRender for foocanvas
329 AC_CHECK_LIB(Xrender, XRenderFindFormat,
330         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
331          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
332         [AC_SUBST(RENDER_LIBS, "")],
333         [-lXext])
335 dnl Setup Plugin directories
336 dnl ------------------------
337 anjuta_plugin_dir='$(libdir)/anjuta'
338 anjuta_data_dir='$(datadir)/anjuta'
339 anjuta_ui_dir='$(datadir)/anjuta/ui'
340 anjuta_glade_dir='$(datadir)/anjuta/glade'
341 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
342 AC_SUBST(anjuta_plugin_dir)
343 AC_SUBST(anjuta_data_dir)
344 AC_SUBST(anjuta_ui_dir)
345 AC_SUBST(anjuta_glade_dir)
346 AC_SUBST(anjuta_image_dir)
348 dnl ***************************************************************************
349 dnl Check for marshal and enum generators
350 dnl ***************************************************************************
351 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
352 AC_SUBST(GLIB_GENMARSHAL)
353 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
354 AC_SUBST(GLIB_MKENUMS)
356 dnl Set up Glade 3 catlog information
357 dnl ---------------------
358 GLADE_PLUGINS_PATH="`$PKG_CONFIG --variable=moduledir gladeui-1.0`"
359 AC_SUBST(GLADE_PLUGINS_PATH)
360 GLADE_CATALOG_PATH="`$PKG_CONFIG --variable=catalogdir gladeui-1.0`"
361 AC_SUBST(GLADE_CATALOG_PATH)
363 dnl ***************************************************************************
364 dnl Internatinalization
365 dnl ***************************************************************************
366 IT_PROG_INTLTOOL([0.40.1])
368 AM_GNU_GETTEXT([external])
369 AM_GNU_GETTEXT_VERSION([0.17])
371 GETTEXT_PACKAGE=anjuta
372 AC_SUBST(GETTEXT_PACKAGE)
373 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
375 BISON_I18N
377 dnl ***************************************************************************
378 dnl Check for gtk-doc.
379 dnl ***************************************************************************
380 GTK_DOC_CHECK([1.4])
382 dnl ***************************************************************************
383 dnl User manual
384 dnl ***************************************************************************
385 YELP_HELP_INIT
387 dnl Define convenience macros
388 dnl -------------------------
389 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
390 AC_DEFUN([CHECK_HEADER_DEFINE],
392         AC_MSG_CHECKING("if $1 is defined in $2")
393         AC_EGREP_CPP(yes,
394 [#include <$2>
395 #ifdef $1
396   yes
397 #endif
398 ], [
399         AC_MSG_RESULT(yes)
400         $3
401 ], [
402         AC_MSG_RESULT(no)
403         $4
404 ]) ])
406 dnl Checks for header files.
407 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
408 AC_CHECK_HEADERS(time.h types.h unistd.h)
409 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
411 dnl Checks for typedefs, structures, and compiler characteristics.
413 AC_CANONICAL_HOST
414 CYGWIN=no
415 MINGW32=no
416 case $host_os in
417   *cygwin* ) CYGWIN=yes;;
418   *mingw32* ) MINGW32=yes;;
419 esac
422 dnl Check for bind in libsocket (needed on Solaris)
423 AC_CHECK_LIB(socket, bind)
425 dnl Check for function forkpty and related headers
426 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
427 AC_CHECK_HEADERS(libutil.h util.h pty.h)
429 dnl Checks for library functions.
430 AC_CHECK_FUNCS(fnmatch)
431 AC_CHECK_FUNCS(strstr)
432 AC_CHECK_FUNCS(stricmp)
433 AC_CHECK_FUNCS(strnicmp)
434 AC_CHECK_FUNCS(getline)
436 dnl for libegg/egg-recent-model.c
437 AC_CHECK_DECLS([lockf])
438 AC_CHECK_FUNCS([lockf])
440 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
442 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
443 if test "$have_fgetpos" != yes ; then
444     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
445         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
446             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
449 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
450 if test "$have_mkstemp" != yes ; then
451     AC_CHECK_FUNCS(chmod)
452     if test "$tmpdir_specified" = yes ; then
453         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
454     fi
455 else
456     AC_MSG_CHECKING(directory to use for temporary files)
457     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
458         then tmpdir=/tmp
459         else tmpdir="$enable_tmpdir"
460     fi
461     if test -d $tmpdir ; then
462         AC_MSG_RESULT($tmpdir)
463         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
464     else
465         AC_MSG_WARN($tmpdir does not exist)
466     fi
469 dnl -----------------------------
470 dnl Checks for FreeBSD Build
471 dnl -----------------------------
472 AC_MSG_CHECKING(if building on FreeBSD)
474 if test `uname -s` = "FreeBSD" ; then
475         AC_MSG_RESULT(yes)
476         FREEBSD_BUILD=-DFREEBSD
477         AC_SUBST(FREEBSD_BUILD)
478         AC_PATH_PROG(GMAKE, gmake, no)
479         if test "x$GMAKE" = "xno"; then
480                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
481         fi
482 else
483         AC_MSG_RESULT(no)
484         GMAKE="make"
487 AC_SUBST(GMAKE)
489 dnl Checks for missing prototypes
490 dnl -----------------------------
491 AC_MSG_NOTICE([checking for missing prototypes...])
493 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))])
495 if test "$have_remove" = yes ; then
496     CHECK_PROTO(remove, stdio.h)
497 else
498     CHECK_PROTO(unlink, unistd.h)
500 CHECK_PROTO(malloc, stdlib.h)
501 CHECK_PROTO(getenv, stdlib.h)
502 CHECK_PROTO(stat,   sys/stat.h)
503 CHECK_PROTO(lstat,  sys/stat.h)
504 if test "$have_fgetpos" = yes ; then
505     CHECK_PROTO(fgetpos, stdio.h)
507 if test "$have_truncate" = yes ; then
508     CHECK_PROTO(truncate, unistd.h)
510 if test "$have_ftruncate" = yes ; then
511     CHECK_PROTO(ftruncate, unistd.h)
514 dnl  **********************************************************
515 dnl  check if we have svn libraries to build subversion plugin
516 dnl  (stolen from kdevelop ;-)
517 dnl  **********************************************************
519 AC_MSG_CHECKING(for Subversion svn-config)
520 AC_ARG_WITH(subversion-dir,
521                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
522                 [
523                                 SVNCONFIG="$withval/bin/svn-config"
524                 ])
526 if test -z "$SVNCONFIG"; then
527                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
528                 if test -n "$_SVNCONFIG"; then
529                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
530                 fi
533 AC_SUBST(SVNCONFIG)
534 if test -x "$SVNCONFIG"; then
535                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
536                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
537                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
538                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
539                 AC_MSG_RESULT(yes)
540 else
541                 AC_MSG_RESULT(not found)
543                 dnl just a fallback to debian's config so that it works for me :)
544                 AC_ARG_WITH(svn-include,
545                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
546                                                                 [
547                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
548                                                                                 SVN_INCLUDES=$withval
549                                                                 fi
550                                                                 ])
551                 if test -z "$SVN_INCLUDES"; then
552                         SVN_INCLUDES="/usr/local/include /usr/include"
553                 fi
554                 AC_MSG_CHECKING([for Subversion headers])
555                 SVN_INCLUDE=""
556                 for VALUE in $SVN_INCLUDES ; do
557                                 if test -f $VALUE/subversion-1/svn_types.h ; then
558                                                 SVN_INCLUDE=$VALUE/subversion-1
559                                                 break
560                                 fi
561                                 if test -f $VALUE/svn_types.h ; then
562                                                 SVN_INCLUDE=$VALUE
563                                                 break
564                                 fi
565                 done
566                 if test $SVN_INCLUDE ; then
567                                 AC_MSG_RESULT([found])
568                 else
569                                 AC_MSG_RESULT([not found])
570                 fi
571                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
572                 AC_ARG_WITH(svn-lib,
573                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
574                                                 [
575                                                         if test "$withval" != "yes" -a "$withval" != ""; then
576                                                                 SVN_LIBS=$withval
577                                                         fi
578                                                 ])
579                 AC_MSG_CHECKING([for Subversion libraries])
580                 SVN_LIB=""
581                 for VALUE in $SVN_LIBS ; do
582                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
583                                                 SVN_LIB=$VALUE
584                                                 break
585                                 fi
586                 done
587                 if test $SVN_LIB ; then
588                                 AC_MSG_RESULT([found])
589                 else
590                                 AC_MSG_RESULT([not found])
591                 fi
594 dnl ******************************************************************
595 dnl Check for extra libs required by subversion.
596 dnl FIXME: This should actually be done by subversion and not by us.
597 dnl ******************************************************************
599 AC_ARG_ENABLE(plugin-subversion,
600   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
601   [ if test "$enableval" = "no"; then
602         user_disabled_subversion=1
603     fi ],
604   [ user_disabled_subversion=0 ] )
606 AC_MSG_CHECKING(if subversion support is disabled)
607 if test "$user_disabled_subversion" = 1; then
608         AC_MSG_RESULT(yes)
609         SVN_INCLUDE=""
610         SVN_LIB=""
611 else
612         AC_MSG_RESULT(no)
615 if test -n "$SVN_INCLUDE" ; then
616         dnl ------------------------------------
617         dnl APR. Required by subversion (devel)
618         dnl ------------------------------------
619         have_atr=no
620         PKG_CHECK_MODULES(APR,                            \
621                 apr-1, have_apr=yes, have_apr=no)
622         if test x"$have_apr" = "xno"; then
623                 SVN_INCLUDE=""
624         fi
626         dnl -----------------------------------------
627         dnl APR util. Required by subversion (devel)
628         dnl------------------------------------------
629         have_atr_util=no
630         PKG_CHECK_MODULES(APR_UTILS,                            \
631                 apr-util-1, have_apr_util=yes, have_apr_util=no)
632         if test x"$have_apr_util" = "xno"; then
633                 SVN_INCLUDE=""
634         fi
636         dnl -----------------------------------------
637         dnl NEON. Required by subversion (devel)
638         dnl------------------------------------------
639         have_neon=no
640         PKG_CHECK_MODULES(NEON,                            \
641                 neon, have_neon=yes, have_neon=no)
642         if test x"$have_neon" = "xno"; then
643                 SVN_INCLUDE=""
644         fi
646         dnl Make sure our SVN version is high enough
647         dnl Eww, eww, eww, this is dirty
648         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
649         AC_LANG([C])
650         dnl Temporarily set CFLAGS so that include dirs are found
651         CFLAGS_TMP=$CFLAGS
652         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
653         AC_COMPILE_IFELSE(
654                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
655                         [[
656                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
657                                 #       error "Version too low"
658                                 #endif
659                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
660         if test x"$have_svn_version" = "xno"; then
661                 AC_MSG_RESULT(no)
662                 SVN_INCLUDE=""
663         fi
664         CFLAGS=$CFLAGS_TMP
667 dnl ------------------------------------------
668 dnl Finally prepare subversion build flags
669 dnl ------------------------------------------
671 if test -n "$SVN_INCLUDE" ; then
672         SVN_INCLUDE="-I$SVN_INCLUDE"
673         if test x != "x$SVN_LIB" ; then
674             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
675         else
676             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
677         fi
678         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
681 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
682 AC_SUBST(SVN_INCLUDE)
683 AC_SUBST(SVN_LIB)
684 AC_SUBST(SVN_CFLAGS)
686 dnl ------------------------------------------
687 dnl Symbol-db shared memory checks
688 dnl ------------------------------------------
690 SYMBOL_DB_SHM="/dev/shm"
691 user_specified_shm=0
692 AC_MSG_CHECKING(for symbol-db shared memory)
693 AC_ARG_WITH(symbol-db-shm,
694                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
695                 [
696                                 user_specified_shm=1
697                                 SYMBOL_DB_SHM="$withval"
698                 ])
699 if test "$user_specified_shm" = 1; then
700         AC_MSG_RESULT(yes)
701 else
702         AC_MSG_RESULT(no)
705 AC_SUBST(SYMBOL_DB_SHM)
707 dnl Test using autotest
708 dnl -----------------------------
709 AC_CONFIG_TESTDIR(plugins/am-project/tests)
710 AM_MISSING_PROG([AUTOM4TE], [autom4te])
712 AC_CONFIG_FILES([
713 Makefile
714 po/Makefile.in
715 libanjuta/Makefile
716 libanjuta/tests/Makefile
717 libanjuta/interfaces/Makefile
718 libanjuta/libanjuta-3.0.pc
719 libanjuta/anjuta-version.h
720 src/Makefile
721 pixmaps/Makefile
722 pixmaps/16x16/Makefile
723 pixmaps/22x22/Makefile
724 pixmaps/24x24/Makefile
725 pixmaps/32x32/Makefile
726 pixmaps/48x48/Makefile
727 pixmaps/scalable/Makefile
728 data/Makefile
729 data/welcome.txt
730 data/templates/Makefile
731 doc/anjuta.1
732 doc/anjuta-launcher.1
733 doc/Makefile
734 scripts/Makefile
735 launcher/Makefile
736 plugins/Makefile
737 plugins/class-gen/Makefile
738 plugins/class-gen/templates/Makefile
739 plugins/patch/Makefile
740 plugins/document-manager/Makefile
741 plugins/document-manager/images/Makefile
742 plugins/message-view/Makefile
743 plugins/gdb/Makefile
744 plugins/gdb/images/Makefile
745 plugins/debug-manager/Makefile
746 plugins/debug-manager/images/Makefile
747 plugins/devhelp/Makefile
748 plugins/devhelp/images/Makefile
749 plugins/glade/Makefile
750 plugins/glade/images/Makefile
751 plugins/js-debugger/Makefile
752 plugins/file-manager/Makefile
753 plugins/file-loader/Makefile
754 plugins/file-wizard/Makefile
755 plugins/build-basic-autotools/Makefile
756 plugins/project-manager/Makefile
757 plugins/symbol-db/benchmark/Makefile
758 plugins/symbol-db/benchmark/symbol-db/Makefile
759 plugins/symbol-db/benchmark/libgda/Makefile
760 plugins/symbol-db/benchmark/sqlite/Makefile
761 plugins/symbol-db/images/Makefile
762 plugins/symbol-db/Makefile
763 plugins/symbol-db/anjuta-tags/Makefile
764 plugins/project-wizard/Makefile
765 plugins/snippets-manager/Makefile
766 plugins/cvs-plugin/Makefile
767 plugins/subversion/Makefile
768 plugins/git/Makefile
769 plugins/git/images/Makefile
770 plugins/sourceview/Makefile
771 plugins/terminal/Makefile
772 plugins/tools/Makefile
773 plugins/tools/scripts/Makefile
774 plugins/language-manager/Makefile
775 plugins/project-import/Makefile
776 plugins/project-wizard/templates/Makefile
777 plugins/project-wizard/templates/mkfile/Makefile
778 plugins/project-wizard/templates/mkfile/src/Makefile
779 plugins/project-wizard/templates/mkfile/po/Makefile
780 plugins/project-wizard/templates/minimal/Makefile
781 plugins/project-wizard/templates/js_minimal/Makefile
782 plugins/project-wizard/templates/js_minimal/src/Makefile
783 plugins/project-wizard/templates/terminal/Makefile
784 plugins/project-wizard/templates/terminal/src/Makefile
785 plugins/project-wizard/templates/terminal/po/Makefile
786 plugins/project-wizard/templates/cpp/Makefile
787 plugins/project-wizard/templates/cpp/src/Makefile
788 plugins/project-wizard/templates/cpp/po/Makefile
789 plugins/project-wizard/templates/gtk/Makefile
790 plugins/project-wizard/templates/gtk/src/Makefile
791 plugins/project-wizard/templates/gtk/po/Makefile
792 plugins/project-wizard/templates/gtkapplication/Makefile
793 plugins/project-wizard/templates/gtkapplication/src/Makefile
794 plugins/project-wizard/templates/gtkapplication/po/Makefile
795 plugins/project-wizard/templates/anjuta-plugin/Makefile
796 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
797 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
798 plugins/project-wizard/templates/gtkmm/Makefile
799 plugins/project-wizard/templates/gtkmm/src/Makefile
800 plugins/project-wizard/templates/gtkmm/po/Makefile
801 plugins/project-wizard/templates/gcj/Makefile
802 plugins/project-wizard/templates/gcj/src/Makefile
803 plugins/project-wizard/templates/java/Makefile
804 plugins/project-wizard/templates/java/src/Makefile
805 plugins/project-wizard/templates/java/po/Makefile
806 plugins/project-wizard/templates/python/Makefile
807 plugins/project-wizard/templates/python/src/Makefile
808 plugins/project-wizard/templates/python/po/Makefile
809 plugins/project-wizard/templates/pygtk/Makefile
810 plugins/project-wizard/templates/pygtk/src/Makefile
811 plugins/project-wizard/templates/pygtk/po/Makefile
812 plugins/project-wizard/templates/vala-gtk/Makefile
813 plugins/project-wizard/templates/vala-gtk/src/Makefile
814 plugins/project-wizard/templates/wxwin/Makefile
815 plugins/project-wizard/templates/wxwin/src/Makefile
816 plugins/project-wizard/templates/wxwin/po/Makefile
817 plugins/project-wizard/templates/xlib/Makefile
818 plugins/project-wizard/templates/xlib/src/Makefile
819 plugins/project-wizard/templates/xlib/po/Makefile
820 plugins/project-wizard/templates/xlib-dock/Makefile
821 plugins/project-wizard/templates/xlib-dock/src/Makefile
822 plugins/project-wizard/templates/xlib-dock/po/Makefile
823 plugins/project-wizard/templates/sdl/Makefile
824 plugins/project-wizard/templates/sdl/src/Makefile
825 plugins/project-wizard/templates/sdl/po/Makefile
826 plugins/project-wizard/templates/licenses/Makefile
827 plugins/project-wizard/templates/library/Makefile
828 plugins/project-wizard/templates/library/src/Makefile
829 plugins/project-wizard/templates/library/po/Makefile
830 plugins/project-wizard/templates/directory/Makefile
831 plugins/project-wizard/templates/m4/Makefile
832 plugins/project-wizard/templates/gnome-shell-extension/Makefile
833 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
834 plugins/am-project/Makefile
835 plugins/am-project/tests/atlocal
836 plugins/am-project/tests/Makefile
837 plugins/mk-project/Makefile
838 plugins/dir-project/Makefile
839 plugins/language-support-cpp-java/Makefile
840 plugins/run-program/Makefile
841 plugins/starter/Makefile
842 plugins/indentation-c-style/Makefile
843 plugins/indentation-python-style/Makefile
844 plugins/language-support-js/Makefile
845 plugins/language-support-vala/Makefile
846 plugins/language-support-python/Makefile
847 plugins/parser-cxx/Makefile
848 plugins/parser-cxx/cxxparser/Makefile
849 plugins/python-loader/Makefile
850 plugins/jhbuild/Makefile
851 anjuta.desktop.in
852 manuals/Makefile
853 manuals/reference/Makefile
854 manuals/reference/libanjuta/Makefile
855 manuals/reference/libanjuta/version.xml
856 manuals/anjuta-manual/Makefile
857 manuals/anjuta-faqs/Makefile
858 manuals/anjuta-build-tutorial/Makefile
859 mime/Makefile
861 AC_OUTPUT
862 echo " "
863 echo "-------------------------------------------------------------------"
864 echo "Conditionally built plugins:"
865 echo "-------------------------------------------------------------------"
866 if [ test -n "$SVN_INCLUDE" ]; then
867         echo "Building subversion plugin: ............................YES"
868 else
869         echo "Building subversion plugin: ............................NO"
870                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
871                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
872                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
873                 echo "        Requires subversion (>= 1.5); http://subversion.org"
876 if [ test x$gladeui_found = xyes ]; then
877        echo "Building glade plugin: .................................YES"
878 else
879        echo "Building glade plugin: .................................NO"
880        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
883 if [ test x$devhelp_enabled = xyes ]; then
884        echo "Building devhelp plugin: ...............................YES"
885 else
886        echo "Building devhelp plugin: ...............................NO"
887        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
889 if [ test x$enable_vala = xyes ]; then
890         echo "Building Vala support: .................................YES"
891 else
892         echo "Building Vala support: .................................NO"
893         echo "        Requires libvala (>= $VALA_REQUIRED)"
895 if [ test x$have_python = xyes]; then
896         echo "Building python plugin loaeder: ........................YES"
897 else
898         echo "Building python plugin loaeder: ........................NO"
899         echo "        Requires python"
901 echo "-------------------------------------------------------------------"
902 echo "AM_CFLAGS = $AM_CFLAGS"
903 echo "AM_CXXFLAGS = $AM_CXXFLAGS"