anjuta-utils: tidy header
[anjuta.git] / configure.ac
blob88ce89fb89e0350e16daefbe4ed510893cbba724
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, 5)
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 -------------------------------------------------------------
234 AC_ARG_ENABLE(plugin-sourceview,
235         AS_HELP_STRING([--disable-plugin-sourceview],[Disable gtksourceview based editor in Anjuta]),
236         [ if test "$enableval" = "no"; then
237                 user_disabled_sourceview=1
238           fi ],
239         [ user_disabled_sourceview=0 ])
241 AC_MSG_CHECKING(if sourceview plugin is disabled)
242 if test "$user_disabled_sourceview" = 1; then
243         AC_MSG_RESULT(yes)
244         sourceview="no"
245 else
246         AC_MSG_RESULT(no)
247         sourceview="yes"
248         PKG_CHECK_MODULES(PLUGIN_SOURCEVIEW,
249                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
252 AM_CONDITIONAL(HAVE_PLUGIN_SOURCEVIEW, [test x$sourceview = xyes])
254 dnl Check for vala
255 dnl -------------------------------------------------------------
257 AC_ARG_ENABLE(vala,
258         AC_HELP_STRING([--disable-vala],[Disable vala support]),
259         [ if test "$enableval" = "no"; then
260                 user_disabled_vala=1
261           fi ],
262         [ user_disabled_vala=0 ])
264 AC_MSG_CHECKING(if vala support is disabled)
265 if test "$user_disabled_vala" = 1; then
266         AC_MSG_RESULT(yes)
267         enable_vala="no"
268 else
269         AC_MSG_RESULT(no)
270         enable_vala="yes"
271         PKG_CHECK_MODULES(VALA,
272                 [libvala-0.12 >= $VALA_REQUIRED])
275 if test x$enable_vala = xyes; then
276         AC_PATH_PROGS(VALAC, [valac-0.12 valac], valac)
277         AC_SUBST(VALAC)
280 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
282 dnl Check for Python
283 dnl -------------------------------------------------------------
285 AM_PATH_PYTHON([],
286         [have_python="yes"],
287         [have_python="no"])
289 if test x$have_python = xyes; then
290         if test -x $PYTHON-config; then
291                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
292                 PYTHON_LIBS=`$PYTHON-config --libs`
293                 AC_SUBST(PYTHON_CFLAGS)
294                 AC_SUBST(PYTHON_LIBS)
295         else
296                 have_python="no"
297         fi
300 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
302 PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
303                 [libgda-4.0 >= $GDA_REQUIRED])
305 dnl Setup Anjuta Library flags
306 dnl --------------------------
307 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)"\"'
308 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
309 AC_SUBST(LIBANJUTA_CFLAGS)
310 AC_SUBST(LIBANJUTA_LIBS)
312 dnl Setup FooCanvas Library flags
313 dnl --------------------------
314 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
315 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
316 AC_SUBST(LIBFOOCANVAS_CFLAGS)
317 AC_SUBST(LIBFOOCANVAS_LIBS)
319 dnl Checks for Xft/XRender for foocanvas
321 AC_CHECK_LIB(Xrender, XRenderFindFormat,
322         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
323          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
324         [AC_SUBST(RENDER_LIBS, "")],
325         [-lXext])
327 dnl Setup Plugin directories
328 dnl ------------------------
329 anjuta_plugin_dir='$(libdir)/anjuta'
330 anjuta_data_dir='$(datadir)/anjuta'
331 anjuta_ui_dir='$(datadir)/anjuta/ui'
332 anjuta_glade_dir='$(datadir)/anjuta/glade'
333 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
334 AC_SUBST(anjuta_plugin_dir)
335 AC_SUBST(anjuta_data_dir)
336 AC_SUBST(anjuta_ui_dir)
337 AC_SUBST(anjuta_glade_dir)
338 AC_SUBST(anjuta_image_dir)
340 dnl ***************************************************************************
341 dnl Check for marshal and enum generators
342 dnl ***************************************************************************
343 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
344 AC_SUBST(GLIB_GENMARSHAL)
345 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
346 AC_SUBST(GLIB_MKENUMS)
348 dnl Set up Glade 3 catlog information
349 dnl ---------------------
350 GLADE_PLUGINS_PATH="`$PKG_CONFIG --variable=moduledir gladeui-1.0`"
351 AC_SUBST(GLADE_PLUGINS_PATH)
352 GLADE_CATALOG_PATH="`$PKG_CONFIG --variable=catalogdir gladeui-1.0`"
353 AC_SUBST(GLADE_CATALOG_PATH)
355 dnl ***************************************************************************
356 dnl Internatinalization
357 dnl ***************************************************************************
358 IT_PROG_INTLTOOL([0.40.1])
360 AM_GNU_GETTEXT([external])
361 AM_GNU_GETTEXT_VERSION([0.17])
363 GETTEXT_PACKAGE=anjuta
364 AC_SUBST(GETTEXT_PACKAGE)
365 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
367 BISON_I18N
369 dnl ***************************************************************************
370 dnl Check for gtk-doc.
371 dnl ***************************************************************************
372 GTK_DOC_CHECK([1.4])
374 dnl ***************************************************************************
375 dnl User manual
376 dnl ***************************************************************************
377 GNOME_DOC_INIT([0.18])
379 dnl Define convenience macros
380 dnl -------------------------
381 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
382 AC_DEFUN([CHECK_HEADER_DEFINE],
384         AC_MSG_CHECKING("if $1 is defined in $2")
385         AC_EGREP_CPP(yes,
386 [#include <$2>
387 #ifdef $1
388   yes
389 #endif
390 ], [
391         AC_MSG_RESULT(yes)
392         $3
393 ], [
394         AC_MSG_RESULT(no)
395         $4
396 ]) ])
398 dnl Checks for header files.
399 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
400 AC_CHECK_HEADERS(time.h types.h unistd.h)
401 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
403 dnl Checks for typedefs, structures, and compiler characteristics.
405 AC_CANONICAL_HOST
406 CYGWIN=no
407 MINGW32=no
408 case $host_os in
409   *cygwin* ) CYGWIN=yes;;
410   *mingw32* ) MINGW32=yes;;
411 esac
414 AC_C_CONST
415 AC_OBJEXT
416 AC_EXEEXT
418 AC_TYPE_SIZE_T
419 AC_TYPE_OFF_T
421 AC_MSG_CHECKING("for fpos_t")
422 AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),
424     AC_MSG_RESULT(no)
425     AC_DEFINE(fpos_t, long, [fpos_t is type long])
428 AC_MSG_CHECKING("for clock_t")
429 AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
431     AC_MSG_RESULT(no)
432     AC_DEFINE(clock_t, long, [clock_t is type long])
435 CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20, [L_tmpname is 20]))
437 CHECK_HEADER_DEFINE(INT_MAX, limits.h,,
438     CHECK_HEADER_DEFINE(MAXINT, limits.h,
439         AC_DEFINE(INT_MAX, MAXINT, [Maximum int size]), AC_DEFINE(INT_MAX, 32767, [Maximum int size])))
441 AC_MSG_CHECKING(if struct stat contains st_ino)
442 AC_LANG([C])
443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
444     struct stat st;
445     stat(".", &st);
446     if (st.st_ino > 0)
447         exit(0);
448 ]])],[have_st_ino=yes],[have_st_ino=no])
449 AC_MSG_RESULT($have_st_ino)
450 if test yes = "$have_st_ino"; then
451     AC_DEFINE(HAVE_STAT_ST_INO,,[Have stat st_ino])
455 dnl Check for bind in libsocket (needed on Solaris)
456 AC_CHECK_LIB(socket, bind)
458 dnl Check for function forkpty and related headers
459 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
460 AC_CHECK_HEADERS(libutil.h util.h pty.h)
462 dnl Checks for library functions.
463 AC_CHECK_FUNCS(fnmatch)
464 AC_CHECK_FUNCS(strstr)
465 AC_CHECK_FUNCS(stricmp)
466 AC_CHECK_FUNCS(strnicmp)
467 AC_CHECK_FUNCS(getline)
469 dnl for libegg/egg-recent-model.c
470 AC_CHECK_DECLS([lockf])
471 AC_CHECK_FUNCS([lockf])
473 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
475 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
476 if test "$have_fgetpos" != yes ; then
477     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
478         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
479             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
482 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
483 if test "$have_mkstemp" != yes ; then
484     AC_CHECK_FUNCS(chmod)
485     if test "$tmpdir_specified" = yes ; then
486         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
487     fi
488 else
489     AC_MSG_CHECKING(directory to use for temporary files)
490     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
491         then tmpdir=/tmp
492         else tmpdir="$enable_tmpdir"
493     fi
494     if test -d $tmpdir ; then
495         AC_MSG_RESULT($tmpdir)
496         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
497     else
498         AC_MSG_WARN($tmpdir does not exist)
499     fi
502 AC_CHECK_FUNCS(strerror opendir)
503 AC_CHECK_FUNCS(clock times, break)
504 AC_CHECK_FUNCS(remove, have_remove=yes,
505     CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink, [Remove is unlink])))
507 AC_CHECK_FUNCS(truncate, have_truncate=yes)
508 dnl === Cannot nest AC_CHECK_FUNCS() calls
509 if test "$have_truncate" != yes  ; then
510     AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes)
511     if test "$have_ftruncate" != yes ; then
512         AC_CHECK_FUNCS(chsize)
513     fi
516 AC_CHECK_FUNCS(setenv, have_setenv=yes)
517 dnl === Cannot nest AC_CHECK_FUNCS() calls
518 if test "$have_setenv" != yes ; then
519     AC_CHECK_FUNCS(putenv, have_putenv=yes)
520     if test "$have_putenv" = yes ; then
521         AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes)
522         if test "$have_putenv_prototype" = yes ; then
523             AC_MSG_CHECKING("putenv prototype")
524             AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[   ]*\(.*const.*\)[    ]*;],
525                 stdlib.h, AC_MSG_RESULT(correct),
526                 [
527                     AC_MSG_RESULT(no const)
528                     AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE,,[putenv has non constant prototype])
529                 ])
530         fi
531     fi
534 dnl -----------------------------
535 dnl Checks for FreeBSD Build
536 dnl -----------------------------
537 AC_MSG_CHECKING(if building on FreeBSD)
539 if test `uname -s` = "FreeBSD" ; then
540         AC_MSG_RESULT(yes)
541         FREEBSD_BUILD=-DFREEBSD
542         AC_SUBST(FREEBSD_BUILD)
543         AC_PATH_PROG(GMAKE, gmake, no)
544         if test "x$GMAKE" = "xno"; then
545                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
546         fi
547 else
548         AC_MSG_RESULT(no)
549         GMAKE="make"
552 AC_SUBST(GMAKE)
554 dnl Checks for missing prototypes
555 dnl -----------------------------
556 AC_MSG_NOTICE([checking for missing prototypes...])
558 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))])
560 if test "$have_remove" = yes ; then
561     CHECK_PROTO(remove, stdio.h)
562 else
563     CHECK_PROTO(unlink, unistd.h)
565 CHECK_PROTO(malloc, stdlib.h)
566 CHECK_PROTO(getenv, stdlib.h)
567 CHECK_PROTO(stat,   sys/stat.h)
568 CHECK_PROTO(lstat,  sys/stat.h)
569 if test "$have_fgetpos" = yes ; then
570     CHECK_PROTO(fgetpos, stdio.h)
572 if test "$have_truncate" = yes ; then
573     CHECK_PROTO(truncate, unistd.h)
575 if test "$have_ftruncate" = yes ; then
576     CHECK_PROTO(ftruncate, unistd.h)
579 dnl  **********************************************************
580 dnl  check if we have svn libraries to build subversion plugin
581 dnl  (stolen from kdevelop ;-)
582 dnl  **********************************************************
584 AC_MSG_CHECKING(for Subversion svn-config)
585 AC_ARG_WITH(subversion-dir,
586                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
587                 [
588                                 SVNCONFIG="$withval/bin/svn-config"
589                 ])
591 if test -z "$SVNCONFIG"; then
592                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
593                 if test -n "$_SVNCONFIG"; then
594                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
595                 fi
598 AC_SUBST(SVNCONFIG)
599 if test -x "$SVNCONFIG"; then
600                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
601                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
602                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
603                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
604                 AC_MSG_RESULT(yes)
605 else
606                 AC_MSG_RESULT(not found)
608                 dnl just a fallback to debian's config so that it works for me :)
609                 AC_ARG_WITH(svn-include,
610                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
611                                                                 [
612                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
613                                                                                 SVN_INCLUDES=$withval
614                                                                 fi
615                                                                 ])
616                 if test -z "$SVN_INCLUDES"; then
617                         SVN_INCLUDES="/usr/local/include /usr/include"
618                 fi
619                 AC_MSG_CHECKING([for Subversion headers])
620                 SVN_INCLUDE=""
621                 for VALUE in $SVN_INCLUDES ; do
622                                 if test -f $VALUE/subversion-1/svn_types.h ; then
623                                                 SVN_INCLUDE=$VALUE/subversion-1
624                                                 break
625                                 fi
626                                 if test -f $VALUE/svn_types.h ; then
627                                                 SVN_INCLUDE=$VALUE
628                                                 break
629                                 fi
630                 done
631                 if test $SVN_INCLUDE ; then
632                                 AC_MSG_RESULT([found])
633                 else
634                                 AC_MSG_RESULT([not found])
635                 fi
636                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
637                 AC_ARG_WITH(svn-lib,
638                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
639                                                 [
640                                                         if test "$withval" != "yes" -a "$withval" != ""; then
641                                                                 SVN_LIBS=$withval
642                                                         fi
643                                                 ])
644                 AC_MSG_CHECKING([for Subversion libraries])
645                 SVN_LIB=""
646                 for VALUE in $SVN_LIBS ; do
647                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
648                                                 SVN_LIB=$VALUE
649                                                 break
650                                 fi
651                 done
652                 if test $SVN_LIB ; then
653                                 AC_MSG_RESULT([found])
654                 else
655                                 AC_MSG_RESULT([not found])
656                 fi
659 dnl ******************************************************************
660 dnl Check for extra libs required by subversion.
661 dnl FIXME: This should actually be done by subversion and not by us.
662 dnl ******************************************************************
664 AC_ARG_ENABLE(plugin-subversion,
665   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
666   [ if test "$enableval" = "no"; then
667         user_disabled_subversion=1
668     fi ],
669   [ user_disabled_subversion=0 ] )
671 AC_MSG_CHECKING(if subversion support is disabled)
672 if test "$user_disabled_subversion" = 1; then
673         AC_MSG_RESULT(yes)
674         SVN_INCLUDE=""
675         SVN_LIB=""
676 else
677         AC_MSG_RESULT(no)
680 if test -n "$SVN_INCLUDE" ; then
681         dnl ------------------------------------
682         dnl APR. Required by subversion (devel)
683         dnl ------------------------------------
684         have_atr=no
685         PKG_CHECK_MODULES(APR,                            \
686                 apr-1, have_apr=yes, have_apr=no)
687         if test x"$have_apr" = "xno"; then
688                 SVN_INCLUDE=""
689         fi
691         dnl -----------------------------------------
692         dnl APR util. Required by subversion (devel)
693         dnl------------------------------------------
694         have_atr_util=no
695         PKG_CHECK_MODULES(APR_UTILS,                            \
696                 apr-util-1, have_apr_util=yes, have_apr_util=no)
697         if test x"$have_apr_util" = "xno"; then
698                 SVN_INCLUDE=""
699         fi
701         dnl -----------------------------------------
702         dnl NEON. Required by subversion (devel)
703         dnl------------------------------------------
704         have_neon=no
705         PKG_CHECK_MODULES(NEON,                            \
706                 neon, have_neon=yes, have_neon=no)
707         if test x"$have_neon" = "xno"; then
708                 SVN_INCLUDE=""
709         fi
711         dnl Make sure our SVN version is high enough
712         dnl Eww, eww, eww, this is dirty
713         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
714         AC_LANG([C])
715         dnl Temporarily set CFLAGS so that include dirs are found
716         CFLAGS_TMP=$CFLAGS
717         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
718         AC_COMPILE_IFELSE(
719                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
720                         [[
721                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
722                                 #       error "Version too low"
723                                 #endif
724                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
725         if test x"$have_svn_version" = "xno"; then
726                 AC_MSG_RESULT(no)
727                 SVN_INCLUDE=""
728         fi
729         CFLAGS=$CFLAGS_TMP
732 dnl ------------------------------------------
733 dnl Finally prepare subversion build flags
734 dnl ------------------------------------------
736 if test -n "$SVN_INCLUDE" ; then
737         SVN_INCLUDE="-I$SVN_INCLUDE"
738         if test x != "x$SVN_LIB" ; then
739             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
740         else
741             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
742         fi
743         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
746 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
747 AC_SUBST(SVN_INCLUDE)
748 AC_SUBST(SVN_LIB)
749 AC_SUBST(SVN_CFLAGS)
751 dnl ------------------------------------------
752 dnl Symbol-db shared memory checks
753 dnl ------------------------------------------
755 SYMBOL_DB_SHM="/dev/shm"
756 user_specified_shm=0
757 AC_MSG_CHECKING(for symbol-db shared memory)
758 AC_ARG_WITH(symbol-db-shm,
759                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
760                 [
761                                 user_specified_shm=1
762                                 SYMBOL_DB_SHM="$withval"
763                 ])
764 if test "$user_specified_shm" = 1; then
765         AC_MSG_RESULT(yes)
766 else
767         AC_MSG_RESULT(no)
770 AC_SUBST(SYMBOL_DB_SHM)
773 dnl Check for graphviz (class inheritance and profiler plugins)
774 AC_ARG_ENABLE(graphviz,
775         AS_HELP_STRING([--disable-graphviz],[Disable GraphViz support in Anjuta]),
776         [ if test "$enableval" = "no"; then
777                 user_disabled_graphviz=1
778           fi ],
779         [ user_disabled_graphviz=0 ])
781 AC_MSG_CHECKING(if GraphViz support is disabled)
782 if test "$user_disabled_graphviz" = 1; then
783         AC_MSG_RESULT(yes)
784         libgraphviz_found="no"
785 else
786         AC_MSG_RESULT(no)
787         PKG_CHECK_MODULES(GRAPHVIZ,
788                 [libgvc >= $LIBGRAPHVIZ_REQUIRED libgraph >= $LIBGRAPHVIZ_REQUIRED],
789                 [libgraphviz_found="yes"],
790                 [libgraphviz_found="no"])
793 AM_CONDITIONAL(HAVE_GRAPHVIZ, [test x$libgraphviz_found = xyes])
795 dnl Test using autotest
796 dnl -----------------------------
797 AC_CONFIG_TESTDIR(plugins/am-project/tests)
798 AM_MISSING_PROG([AUTOM4TE], [autom4te])
800 AC_CONFIG_FILES([
801 Makefile
802 po/Makefile.in
803 libanjuta/Makefile
804 libanjuta/libanjuta-3.0.pc
805 libanjuta/anjuta-version.h
806 libanjuta/interfaces/Makefile
807 src/Makefile
808 pixmaps/Makefile
809 pixmaps/16x16/Makefile
810 pixmaps/22x22/Makefile
811 pixmaps/24x24/Makefile
812 pixmaps/32x32/Makefile
813 pixmaps/48x48/Makefile
814 pixmaps/scalable/Makefile
815 data/Makefile
816 data/welcome.txt
817 doc/anjuta.1
818 doc/anjuta-launcher.1
819 doc/Makefile
820 scripts/Makefile
821 launcher/Makefile
822 plugins/Makefile
823 plugins/class-gen/Makefile
824 plugins/class-gen/templates/Makefile
825 plugins/code-analyzer/Makefile
826 plugins/patch/Makefile
827 plugins/document-manager/Makefile
828 plugins/document-manager/images/Makefile
829 plugins/search/Makefile
830 plugins/message-view/Makefile
831 plugins/gdb/Makefile
832 plugins/gdb/images/Makefile
833 plugins/debug-manager/Makefile
834 plugins/debug-manager/images/Makefile
835 plugins/devhelp/Makefile
836 plugins/devhelp/images/Makefile
837 plugins/glade/Makefile
838 plugins/glade/images/Makefile
839 plugins/js-debugger/Makefile
840 plugins/file-manager/Makefile
841 plugins/file-loader/Makefile
842 plugins/file-wizard/Makefile
843 plugins/build-basic-autotools/Makefile
844 plugins/project-manager/Makefile
845 plugins/symbol-db/benchmark/Makefile
846 plugins/symbol-db/benchmark/symbol-db/Makefile
847 plugins/symbol-db/benchmark/libgda/Makefile
848 plugins/symbol-db/benchmark/sqlite/Makefile
849 plugins/symbol-db/images/Makefile
850 plugins/symbol-db/Makefile
851 plugins/symbol-db/anjuta-tags/Makefile
852 plugins/project-wizard/Makefile
853 plugins/snippets-manager/Makefile
854 plugins/cvs-plugin/Makefile
855 plugins/subversion/Makefile
856 plugins/git/Makefile
857 plugins/git/images/Makefile
858 plugins/sourceview/Makefile
859 plugins/terminal/Makefile
860 plugins/tools/Makefile
861 plugins/tools/scripts/Makefile
862 plugins/language-manager/Makefile
863 plugins/project-import/Makefile
864 plugins/project-wizard/templates/Makefile
865 plugins/project-wizard/templates/mkfile/Makefile
866 plugins/project-wizard/templates/mkfile/src/Makefile
867 plugins/project-wizard/templates/mkfile/po/Makefile
868 plugins/project-wizard/templates/minimal/Makefile
869 plugins/project-wizard/templates/js_minimal/Makefile
870 plugins/project-wizard/templates/js_minimal/src/Makefile
871 plugins/project-wizard/templates/terminal/Makefile
872 plugins/project-wizard/templates/terminal/src/Makefile
873 plugins/project-wizard/templates/terminal/po/Makefile
874 plugins/project-wizard/templates/cpp/Makefile
875 plugins/project-wizard/templates/cpp/src/Makefile
876 plugins/project-wizard/templates/cpp/po/Makefile
877 plugins/project-wizard/templates/gtk/Makefile
878 plugins/project-wizard/templates/gtk/src/Makefile
879 plugins/project-wizard/templates/gtk/po/Makefile
880 plugins/project-wizard/templates/gtkapplication/Makefile
881 plugins/project-wizard/templates/gtkapplication/src/Makefile
882 plugins/project-wizard/templates/gtkapplication/po/Makefile
883 plugins/project-wizard/templates/anjuta-plugin/Makefile
884 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
885 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
886 plugins/project-wizard/templates/gtkmm/Makefile
887 plugins/project-wizard/templates/gtkmm/src/Makefile
888 plugins/project-wizard/templates/gtkmm/po/Makefile
889 plugins/project-wizard/templates/gcj/Makefile
890 plugins/project-wizard/templates/gcj/src/Makefile
891 plugins/project-wizard/templates/java/Makefile
892 plugins/project-wizard/templates/java/src/Makefile
893 plugins/project-wizard/templates/java/po/Makefile
894 plugins/project-wizard/templates/python/Makefile
895 plugins/project-wizard/templates/python/src/Makefile
896 plugins/project-wizard/templates/python/po/Makefile
897 plugins/project-wizard/templates/pygtk/Makefile
898 plugins/project-wizard/templates/pygtk/src/Makefile
899 plugins/project-wizard/templates/pygtk/po/Makefile
900 plugins/project-wizard/templates/pygtk/data/Makefile
901 plugins/project-wizard/templates/vala-gtk/Makefile
902 plugins/project-wizard/templates/vala-gtk/src/Makefile
903 plugins/project-wizard/templates/wxwin/Makefile
904 plugins/project-wizard/templates/wxwin/src/Makefile
905 plugins/project-wizard/templates/wxwin/po/Makefile
906 plugins/project-wizard/templates/xlib/Makefile
907 plugins/project-wizard/templates/xlib/src/Makefile
908 plugins/project-wizard/templates/xlib/po/Makefile
909 plugins/project-wizard/templates/xlib-dock/Makefile
910 plugins/project-wizard/templates/xlib-dock/src/Makefile
911 plugins/project-wizard/templates/xlib-dock/po/Makefile
912 plugins/project-wizard/templates/sdl/Makefile
913 plugins/project-wizard/templates/sdl/src/Makefile
914 plugins/project-wizard/templates/sdl/po/Makefile
915 plugins/project-wizard/templates/licenses/Makefile
916 plugins/project-wizard/templates/library/Makefile
917 plugins/project-wizard/templates/library/src/Makefile
918 plugins/project-wizard/templates/library/po/Makefile
919 plugins/project-wizard/templates/directory/Makefile
920 plugins/project-wizard/templates/m4/Makefile
921 plugins/am-project/Makefile
922 plugins/am-project/tests/atlocal
923 plugins/am-project/tests/Makefile
924 plugins/dir-project/Makefile
925 plugins/language-support-cpp-java/Makefile
926 plugins/language-support-cpp-java/cxxparser/Makefile
927 plugins/run-program/Makefile
928 plugins/starter/Makefile
929 plugins/language-support-js/Makefile
930 plugins/language-support-vala/Makefile
931 plugins/language-support-python/Makefile
932 plugins/python-loader/Makefile
933 anjuta.desktop.in
934 manuals/Makefile
935 manuals/reference/Makefile
936 manuals/reference/libanjuta/Makefile
937 manuals/reference/libanjuta/version.xml
938 manuals/anjuta-manual/Makefile
939 manuals/anjuta-faqs/Makefile
940 manuals/anjuta-build-tutorial/Makefile
941 mime/Makefile
943 AC_OUTPUT
944 echo " "
945 echo "-------------------------------------------------------------------"
946 echo "Conditionally built plugins:"
947 echo "-------------------------------------------------------------------"
948 if [ test -n "$SVN_INCLUDE" ]; then
949         echo "Building subversion plugin: ............................YES"
950 else
951         echo "Building subversion plugin: ............................NO"
952                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
953                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
954                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
955                 echo "        Requires subversion (>= 1.5); http://subversion.org"
958 if [ test x$gladeui_found = xyes ]; then
959        echo "Building glade plugin: .................................YES"
960 else
961        echo "Building glade plugin: .................................NO"
962        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
965 if [ test x$devhelp_enabled = xyes ]; then
966        echo "Building devhelp plugin: ...............................YES"
967 else
968        echo "Building devhelp plugin: ...............................NO"
969        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
972 if [ test x$sourceview = xyes ]; then
973         echo "Building GtkSourceView based editor: ...................YES"
974 else
975         echo "Building GtkSourceView based editor: ...................NO"
977 if [ test x$enable_vala = xyes ]; then
978         echo "Building Vala support: .................................YES"
979 else
980         echo "Building Vala support: .................................NO"
981         echo "        Requires libvala (>= $VALA_REQUIRED)"
983 if [ test x$libgraphviz_found = xyes ]; then
984         echo "Building class inheritance plugin: .....................YES"
985 else
986         echo "Building class inheritance plugin: .....................NO"
987         echo "        Requires graphviz (>= 2.6.0); http://graphviz.org"
989 echo "-------------------------------------------------------------------"
990 echo "AM_CFLAGS = $AM_CFLAGS"
991 echo "AM_CXXFLAGS = $AM_CXXFLAGS"