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