Updated Spanish translation
[anjuta.git] / configure.ac
blobfc05c9daab836cb2eb814e7cbb4f5bc8b97dd4fc
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.65)
5 m4_define(anjuta_major_version,  3)
6 m4_define(anjuta_minor_version,  9)
7 m4_define(anjuta_micro_version,  3)
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 LIBGD_GTK_REQUIRED=3.7.10
37 GTHREAD_REQUIRED=2.22.0
38 GDK_PIXBUF_REQUIRED=2.0.0
39 GDA4_REQUIRED=4.2.0
40 GDA5_REQUIRED=5.0.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 SVN_MAJOR=1
63 SVN_MINOR=5
64 SVN_PATCH=0
65 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
67 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip])
68 AM_MAINTAINER_MODE([enable])
70 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
72 dnl Check for C Compiler
73 AC_PROG_CC
74 AC_PROG_CPP
75 AC_PROG_LEX
76 if test "$LEX" != "flex"; then
77         AC_MSG_ERROR(flex is required)
79 AC_PROG_YACC
80 if test "$YACC" != "bison -y"; then
81         AC_MSG_ERROR(bison is required)
83 AC_LANG([C])
84 AC_LANG([C++])
85 AC_PROG_CXX
86 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],,
87    AC_MSG_ERROR([C++ Compiler required to compile Anjuta]))
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         gmodule-2.0 >= $GLIB_REQUIRED
154         gtk+-3.0 >= $GTK_REQUIRED
155         gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
157 PKG_CHECK_MODULES([XML],
158    [libxml-2.0 >= $LIBXML_REQUIRED])
160 PKG_CHECK_MODULES([GDL],
161    [gdl-3.0 >= $GDL_REQUIRED])
163 PKG_CHECK_MODULES([GDA],
164    [libgda-5.0 >= $GDA5_REQUIRED],,
165    [PKG_CHECK_MODULES([GDA],
166       [libgda-4.0 >= $GDA4_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/])
177 dnl Check for libgd
178 dnl ---------------
180 AC_ARG_ENABLE(libgd,
181   AS_HELP_STRING([--disable-libgd], [Do not use libgd which needs a more recent version of Gtk+]),,
182   [enable_libgd=yes])
184 if test "x$enable_libgd" = "xyes"; then
185         AC_MSG_CHECKING(if libgd is used)
186         PKG_CHECK_EXISTS([gtk+-3.0 >= $LIBGD_GTK_REQUIRED],
187             [ libgd_enabled=yes ],
188             [ libgd_enabled=no ])
189         AC_MSG_RESULT($libgd_enabled)
190 else
191         libgd_enabled=no
194 if test "x$libgd_enabled" = "xyes"; then
195         LIBGD_INIT([
196           revealer
197           static
198         ])
200         LOCAL_LIBGD_CFLAGS='-I$(top_srcdir)/libgd'
201         LOCAL_LIBGD_LIBS='$(top_builddir)/libgd/libgd.la'
202         AC_SUBST(LOCAL_LIBGD_CFLAGS)
203         AC_SUBST(LOCAL_LIBGD_LIBS)
204         AC_DEFINE([HAVE_LIBGD], [1], [Define to 1 if libgd is available])
205 else
206         dnl LIBGD_INIT contains AM_CONDITIONAL so it has to be run but remove
207         dnl the check of Gtk+ version because we will not use libgd.
208         pushdef([PKG_CHECK_MODULES], [])
209         LIBGD_INIT([])
210         popdef([PKG_CHECK_MODULES])
213 AM_CONDITIONAL(HAVE_LIBGD, [test x$libgd_enabled = xyes])
216 dnl Check for Terminal
217 dnl ---------------------
219 AC_ARG_ENABLE(plugin-terminal,
220   AS_HELP_STRING([--disable-plugin-terminal],[Disable terminal plugin support in Anjuta.]),
221   [ if test "$enableval" = "no"; then
222        user_disabled_terminal=1
223     fi ],
224   [ user_disabled_terminal=0 ] )
226 AC_MSG_CHECKING(if terminal plugin is disabled)
227 if test "$user_disabled_terminal" = 1; then
228         AC_MSG_RESULT(yes)
229         terminal_enabled="no"
230 else
231         AC_MSG_RESULT(no)
232         PKG_CHECK_MODULES(PLUGIN_TERMINAL, [vte-2.90 >= $VTE_REQUIRED],
233             [
234                 terminal_enabled=yes
235             ], [
236                 terminal_enabled=no
237             ])
240 AM_CONDITIONAL(HAVE_PLUGIN_TERMINAL, [test x$terminal_enabled = xyes])
242 dnl Check for Devhelp
243 dnl -----------------
245 AC_ARG_ENABLE(plugin-devhelp,
246   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
247   [ if test "$enableval" = "no"; then
248        user_disabled_devhelp=1
249     fi ],
250   [ user_disabled_devhelp=0 ] )
252 AC_MSG_CHECKING(if devhelp plugin is disabled)
253 if test "$user_disabled_devhelp" = 1; then
254         AC_MSG_RESULT(yes)
255         devhelp_enabled="no"
256 else
257         AC_MSG_RESULT(no)
258         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
259                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
260                                 [
261                                     devhelp_enabled=yes
262                                 ], [
263                                     devhelp_enabled=no
264                                 ])
267 if test "x$devhelp_enabled" = "xyes"; then
268         case "$PLUGIN_DEVHELP_LIBS" in
269                 *webkit2gtk-3.0*)
270                         AC_DEFINE([HAVE_WEBKIT2], [1], [Defined if devhelp is built against webkitgtk2])
271                         ;;
272                 esac
274 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
276 dnl Check for Glade3
277 dnl ---------------------
279 AC_ARG_ENABLE(plugin-glade,
280   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
281   [ if test "$enableval" = "no"; then
282        user_disabled_glade=1
283     fi ],
284   [ user_disabled_glade=0 ] )
286 AC_MSG_CHECKING(if glade plugin is disabled)
287 if test "$user_disabled_glade" = 1; then
288         AC_MSG_RESULT(yes)
289         gladeui_found="no"
290 else
291         AC_MSG_RESULT(no)
292         gladeui_version=0
293         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
294             [
295                 gladeui_found=yes
296             ], [
297                 gladeui_found=no
298             ])
301 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
303 dnl Glade catalog
304 dnl ---------------------
306 AC_ARG_ENABLE(glade-catalog,
307   AS_HELP_STRING([--enable-glade-catalog], [Enable glade catalog. Glade UI libraries must be installed]),
308   [ user_enabled_glade_catalog=1 ],
309   [ user_enabled_glade_catalog=0 ])
311 glade_catalog_enabled="no"
313 AC_MSG_CHECKING(if glade catalog is enabled)
314 if test "$gladeui_found" = "yes"; then
315   if test "$user_enabled_glade_catalog" = 1; then
316     AC_MSG_RESULT(yes)
317     glade_catalog_enabled="yes"
318     GLADE_CATALOG_PATH=`pkg-config --variable=catalogdir gladeui-2.0`
319     GLADE_PLUGINS_PATH=`pkg-config --variable=moduledir gladeui-2.0`
321     AC_SUBST(GLADE_CATALOG_PATH)
322     AC_SUBST(GLADE_PLUGINS_PATH)
323   else
324     AC_MSG_RESULT(no) 
325   fi
326 else
327   AC_MSG_RESULT(no)
330 AM_CONDITIONAL(ENABLE_GLADE_CATALOG, [test x$glade_catalog_enabled = xyes])
332 dnl Check for gtksourceview
333 dnl -------------------------------------------------------------
334 PKG_CHECK_MODULES(SOURCEVIEW,
335                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
337 dnl Check for vala
338 dnl -------------------------------------------------------------
340 AC_ARG_ENABLE(vala,
341         AS_HELP_STRING([--disable-vala],[Disable vala support]),
342         [ if test "$enableval" = "no"; then
343                 user_disabled_vala=1
344           fi ],
345         [ user_disabled_vala=0 ])
347 AC_MSG_CHECKING(if vala support is disabled)
348 if test "$user_disabled_vala" = 1; then
349         AC_MSG_RESULT(yes)
350         enable_vala="no"
351 else
352         AC_MSG_RESULT(no)
353         AC_MSG_CHECKING(if libvala is available)
354         PKG_CHECK_EXISTS([ libvala-0.20 ],
355                          [ valaver="-0.20" ],
356                          [ PKG_CHECK_EXISTS([ libvala-0.18 ],
357                                             [ valaver="-0.18" ],
358                                             [ valaver="" ])
359                          ])
360         if test "x$valaver" != "x"; then
361                 AC_MSG_RESULT(yes)
362                 enable_vala="yes"
363                 LIBVALA="libvala${valaver}"
364                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
365         else
366                 AC_MSG_RESULT(no)
367                 enable_vala="no"
368                 VALA_REQUIRED=0.18.0
369         fi
370         AC_SUBST(LIBVALA)
373 if test x$enable_vala = xyes; then
374         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
375         AC_SUBST(VALAC)
378 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
380 dnl Check for Python
381 dnl -------------------------------------------------------------
383 AM_PATH_PYTHON([],
384         [have_python="yes"],
385         [have_python="no"])
387 if test x$have_python = xyes; then
388         if test -x $PYTHON-config; then
389                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
390                 PYTHON_LIBS=`$PYTHON-config --libs`
391                 AC_SUBST(PYTHON_CFLAGS)
392                 AC_SUBST(PYTHON_LIBS)
393         elif test -x $PYTHON$PYTHON_VERSION-config; then
394                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
395                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
396                 AC_SUBST(PYTHON_CFLAGS)
397                 AC_SUBST(PYTHON_LIBS)           
398         else
399                 have_python="no"
400                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
401         fi
404 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
406 dnl Disable packagekit support
407 dnl -----------------------------------
408 AC_ARG_ENABLE(packagekit,
409   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
410   [enable_packagekit=yes])
411 if test "x$enable_packagekit" != "xno"; then
412   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
415 dnl Setup Anjuta Library flags
416 dnl --------------------------
417 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)"\"'
418 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
419 AC_SUBST(LIBANJUTA_CFLAGS)
420 AC_SUBST(LIBANJUTA_LIBS)
422 dnl Setup FooCanvas Library flags
423 dnl --------------------------
424 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
425 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
426 AC_SUBST(LIBFOOCANVAS_CFLAGS)
427 AC_SUBST(LIBFOOCANVAS_LIBS)
429 dnl Checks for Xft/XRender for foocanvas
431 AC_CHECK_LIB(Xrender, XRenderFindFormat,
432         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
433          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
434         [AC_SUBST(RENDER_LIBS, "")],
435         [-lXext])
437 dnl Setup Plugin directories
438 dnl ------------------------
439 anjuta_plugin_dir='$(libdir)/anjuta'
440 anjuta_data_dir='$(datadir)/anjuta'
441 anjuta_ui_dir='$(datadir)/anjuta/ui'
442 anjuta_glade_dir='$(datadir)/anjuta/glade'
443 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
444 AC_SUBST(anjuta_plugin_dir)
445 AC_SUBST(anjuta_data_dir)
446 AC_SUBST(anjuta_ui_dir)
447 AC_SUBST(anjuta_glade_dir)
448 AC_SUBST(anjuta_image_dir)
450 dnl ***************************************************************************
451 dnl Check for marshal and enum generators
452 dnl ***************************************************************************
453 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
454 AC_SUBST(GLIB_GENMARSHAL)
455 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
456 AC_SUBST(GLIB_MKENUMS)
458 dnl ***************************************************************************
459 dnl Internatinalization
460 dnl ***************************************************************************
461 IT_PROG_INTLTOOL([0.40.1])
463 AM_GNU_GETTEXT([external])
464 AM_GNU_GETTEXT_VERSION([0.17])
466 GETTEXT_PACKAGE=anjuta
467 AC_SUBST(GETTEXT_PACKAGE)
468 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
470 BISON_I18N
472 dnl ***************************************************************************
473 dnl Check for gtk-doc.
474 dnl ***************************************************************************
475 GTK_DOC_CHECK([1.4])
477 dnl ***************************************************************************
478 dnl User manual
479 dnl ***************************************************************************
480 YELP_HELP_INIT
482 dnl Define convenience macros
483 dnl -------------------------
484 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
485 AC_DEFUN([CHECK_HEADER_DEFINE],
487         AC_MSG_CHECKING("if $1 is defined in $2")
488         AC_EGREP_CPP(yes,
489 [#include <$2>
490 #ifdef $1
491   yes
492 #endif
493 ], [
494         AC_MSG_RESULT(yes)
495         $3
496 ], [
497         AC_MSG_RESULT(no)
498         $4
499 ]) ])
501 dnl Checks for header files.
502 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
503 AC_CHECK_HEADERS(time.h types.h unistd.h)
504 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
506 dnl Checks for typedefs, structures, and compiler characteristics.
508 AC_CANONICAL_HOST
509 CYGWIN=no
510 MINGW32=no
511 case $host_os in
512   *cygwin* ) CYGWIN=yes;;
513   *mingw32* ) MINGW32=yes;;
514 esac
517 dnl Check for bind in libsocket (needed on Solaris)
518 AC_CHECK_LIB(socket, bind)
520 dnl Check for function forkpty and related headers
521 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
522 AC_CHECK_HEADERS(libutil.h util.h pty.h)
524 dnl Checks for library functions.
525 AC_CHECK_FUNCS(fnmatch)
526 AC_CHECK_FUNCS(strstr)
527 AC_CHECK_FUNCS(stricmp)
528 AC_CHECK_FUNCS(strnicmp)
529 AC_CHECK_FUNCS(getline)
531 dnl for libegg/egg-recent-model.c
532 AC_CHECK_DECLS([lockf])
533 AC_CHECK_FUNCS([lockf])
535 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
537 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
538 if test "$have_fgetpos" != yes ; then
539     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
540         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
541             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
544 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
545 if test "$have_mkstemp" != yes ; then
546     AC_CHECK_FUNCS(chmod)
547     if test "$tmpdir_specified" = yes ; then
548         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
549     fi
550 else
551     AC_MSG_CHECKING(directory to use for temporary files)
552     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
553         then tmpdir=/tmp
554         else tmpdir="$enable_tmpdir"
555     fi
556     if test -d $tmpdir ; then
557         AC_MSG_RESULT($tmpdir)
558         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
559     else
560         AC_MSG_WARN($tmpdir does not exist)
561     fi
564 dnl -----------------------------
565 dnl Checks for FreeBSD Build
566 dnl -----------------------------
567 AC_MSG_CHECKING(if building on FreeBSD)
569 if test `uname -s` = "FreeBSD" ; then
570         AC_MSG_RESULT(yes)
571         FREEBSD_BUILD=-DFREEBSD
572         AC_SUBST(FREEBSD_BUILD)
573         AC_PATH_PROG(GMAKE, gmake, no)
574         if test "x$GMAKE" = "xno"; then
575                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
576         fi
577 else
578         AC_MSG_RESULT(no)
579         GMAKE="make"
582 AC_SUBST(GMAKE)
584 dnl Checks for missing prototypes
585 dnl -----------------------------
586 AC_MSG_NOTICE([checking for missing prototypes...])
588 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))])
590 if test "$have_remove" = yes ; then
591     CHECK_PROTO(remove, stdio.h)
592 else
593     CHECK_PROTO(unlink, unistd.h)
595 CHECK_PROTO(malloc, stdlib.h)
596 CHECK_PROTO(getenv, stdlib.h)
597 CHECK_PROTO(stat,   sys/stat.h)
598 CHECK_PROTO(lstat,  sys/stat.h)
599 if test "$have_fgetpos" = yes ; then
600     CHECK_PROTO(fgetpos, stdio.h)
602 if test "$have_truncate" = yes ; then
603     CHECK_PROTO(truncate, unistd.h)
605 if test "$have_ftruncate" = yes ; then
606     CHECK_PROTO(ftruncate, unistd.h)
609 dnl  **********************************************************
610 dnl  check if we have svn libraries to build subversion plugin
611 dnl  (stolen from kdevelop ;-)
612 dnl  **********************************************************
614 AC_MSG_CHECKING(for Subversion svn-config)
615 AC_ARG_WITH(subversion-dir,
616                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
617                 [
618                                 SVNCONFIG="$withval/bin/svn-config"
619                 ])
621 if test -z "$SVNCONFIG"; then
622                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
623                 if test -n "$_SVNCONFIG"; then
624                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
625                 fi
628 AC_SUBST(SVNCONFIG)
629 if test -x "$SVNCONFIG"; then
630                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
631                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
632                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
633                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
634                 AC_MSG_RESULT(yes)
635 else
636                 AC_MSG_RESULT(not found)
638                 dnl just a fallback to debian's config so that it works for me :)
639                 AC_ARG_WITH(svn-include,
640                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
641                                                                 [
642                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
643                                                                                 SVN_INCLUDES=$withval
644                                                                 fi
645                                                                 ])
646                 if test -z "$SVN_INCLUDES"; then
647                         SVN_INCLUDES="/usr/local/include /usr/include"
648                 fi
649                 AC_MSG_CHECKING([for Subversion headers])
650                 SVN_INCLUDE=""
651                 for VALUE in $SVN_INCLUDES ; do
652                                 if test -f $VALUE/subversion-1/svn_types.h ; then
653                                                 SVN_INCLUDE=$VALUE/subversion-1
654                                                 break
655                                 fi
656                                 if test -f $VALUE/svn_types.h ; then
657                                                 SVN_INCLUDE=$VALUE
658                                                 break
659                                 fi
660                 done
661                 if test $SVN_INCLUDE ; then
662                                 AC_MSG_RESULT([found])
663                 else
664                                 AC_MSG_RESULT([not found])
665                 fi
666                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
667                 AC_ARG_WITH(svn-lib,
668                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
669                                                 [
670                                                         if test "$withval" != "yes" -a "$withval" != ""; then
671                                                                 SVN_LIBS=$withval
672                                                         fi
673                                                 ])
674                 AC_MSG_CHECKING([for Subversion libraries])
675                 SVN_LIB=""
676                 for VALUE in $SVN_LIBS ; do
677                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
678                                                 SVN_LIB=$VALUE
679                                                 break
680                                 fi
681                 done
682                 if test $SVN_LIB ; then
683                                 AC_MSG_RESULT([found])
684                 else
685                                 AC_MSG_RESULT([not found])
686                 fi
689 dnl ******************************************************************
690 dnl Check for extra libs required by subversion.
691 dnl FIXME: This should actually be done by subversion and not by us.
692 dnl ******************************************************************
694 AC_ARG_ENABLE(plugin-subversion,
695   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
696   [ if test "$enableval" = "no"; then
697         user_disabled_subversion=1
698     fi ],
699   [ user_disabled_subversion=0 ] )
701 AC_MSG_CHECKING(if subversion support is disabled)
702 if test "$user_disabled_subversion" = 1; then
703         AC_MSG_RESULT(yes)
704         SVN_INCLUDE=""
705         SVN_LIB=""
706 else
707         AC_MSG_RESULT(no)
710 if test -n "$SVN_INCLUDE" ; then
711         dnl ------------------------------------
712         dnl APR. Required by subversion (devel)
713         dnl ------------------------------------
714         have_atr=no
715         PKG_CHECK_MODULES(APR,                            \
716                 apr-1, have_apr=yes, have_apr=no)
717         if test x"$have_apr" = "xno"; then
718                 SVN_INCLUDE=""
719         fi
721         dnl -----------------------------------------
722         dnl APR util. Required by subversion (devel)
723         dnl------------------------------------------
724         have_atr_util=no
725         PKG_CHECK_MODULES(APR_UTILS,                            \
726                 apr-util-1, have_apr_util=yes, have_apr_util=no)
727         if test x"$have_apr_util" = "xno"; then
728                 SVN_INCLUDE=""
729         fi
731         dnl -----------------------------------------
732         dnl NEON. Required by subversion (devel)
733         dnl------------------------------------------
734         have_neon=no
735         PKG_CHECK_MODULES(NEON,                            \
736                 neon, have_neon=yes, have_neon=no)
737         if test x"$have_neon" = "xno"; then
738                 SVN_INCLUDE=""
739         fi
741         dnl Make sure our SVN version is high enough
742         dnl Eww, eww, eww, this is dirty
743         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
744         AC_LANG([C])
745         dnl Temporarily set CFLAGS so that include dirs are found
746         CFLAGS_TMP=$CFLAGS
747         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
748         AC_COMPILE_IFELSE(
749                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
750                         [[
751                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
752                                 #       error "Version too low"
753                                 #endif
754                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
755         if test x"$have_svn_version" = "xno"; then
756                 AC_MSG_RESULT(no)
757                 SVN_INCLUDE=""
758         fi
759         CFLAGS=$CFLAGS_TMP
762 dnl ------------------------------------------
763 dnl Finally prepare subversion build flags
764 dnl ------------------------------------------
766 if test -n "$SVN_INCLUDE" ; then
767         SVN_INCLUDE="-I$SVN_INCLUDE"
768         if test x != "x$SVN_LIB" ; then
769             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
770         else
771             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
772         fi
773         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
776 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
777 AC_SUBST(SVN_INCLUDE)
778 AC_SUBST(SVN_LIB)
779 AC_SUBST(SVN_CFLAGS)
781 dnl ------------------------------------------
782 dnl Symbol-db shared memory checks
783 dnl ------------------------------------------
785 SYMBOL_DB_SHM="/dev/shm"
786 user_specified_shm=0
787 AC_MSG_CHECKING(for symbol-db shared memory)
788 AC_ARG_WITH(symbol-db-shm,
789                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
790                 [
791                                 user_specified_shm=1
792                                 SYMBOL_DB_SHM="$withval"
793                 ])
794 if test "$user_specified_shm" = 1; then
795         AC_MSG_RESULT(yes)
796 else
797         AC_MSG_RESULT(no)
800 AC_SUBST(SYMBOL_DB_SHM)
802 dnl Test using autotest
803 dnl -----------------------------
804 AC_CONFIG_TESTDIR(plugins/am-project/tests)
805 AM_MISSING_PROG([AUTOM4TE], [autom4te])
807 AC_CONFIG_FILES([
808 Makefile
809 po/Makefile.in
810 libanjuta/Makefile
811 libanjuta/tests/Makefile
812 libanjuta/interfaces/Makefile
813 libanjuta/libanjuta-3.0.pc
814 libanjuta/anjuta-version.h
815 libgd/Makefile
816 src/Makefile
817 pixmaps/Makefile
818 pixmaps/16x16/Makefile
819 pixmaps/22x22/Makefile
820 pixmaps/24x24/Makefile
821 pixmaps/32x32/Makefile
822 pixmaps/48x48/Makefile
823 pixmaps/scalable/Makefile
824 data/Makefile
825 data/welcome.txt
826 data/templates/Makefile
827 doc/anjuta.1
828 doc/anjuta-launcher.1
829 doc/Makefile
830 scripts/Makefile
831 launcher/Makefile
832 plugins/Makefile
833 plugins/class-gen/Makefile
834 plugins/class-gen/templates/Makefile
835 plugins/patch/Makefile
836 plugins/document-manager/Makefile
837 plugins/document-manager/images/Makefile
838 plugins/message-view/Makefile
839 plugins/gdb/Makefile
840 plugins/gdb/images/Makefile
841 plugins/debug-manager/Makefile
842 plugins/debug-manager/images/Makefile
843 plugins/devhelp/Makefile
844 plugins/devhelp/images/Makefile
845 plugins/glade/Makefile
846 plugins/glade/images/Makefile
847 plugins/js-debugger/Makefile
848 plugins/file-manager/Makefile
849 plugins/file-loader/Makefile
850 plugins/file-wizard/Makefile
851 plugins/build-basic-autotools/Makefile
852 plugins/project-manager/Makefile
853 plugins/symbol-db/benchmark/Makefile
854 plugins/symbol-db/benchmark/symbol-db/Makefile
855 plugins/symbol-db/benchmark/libgda/Makefile
856 plugins/symbol-db/benchmark/sqlite/Makefile
857 plugins/symbol-db/images/Makefile
858 plugins/symbol-db/Makefile
859 plugins/symbol-db/anjuta-tags/Makefile
860 plugins/project-wizard/Makefile
861 plugins/snippets-manager/Makefile
862 plugins/cvs-plugin/Makefile
863 plugins/subversion/Makefile
864 plugins/git/Makefile
865 plugins/git/images/Makefile
866 plugins/sourceview/Makefile
867 plugins/terminal/Makefile
868 plugins/tools/Makefile
869 plugins/tools/scripts/Makefile
870 plugins/language-manager/Makefile
871 plugins/project-import/Makefile
872 plugins/project-wizard/templates/Makefile
873 plugins/project-wizard/templates/mkfile/Makefile
874 plugins/project-wizard/templates/mkfile/src/Makefile
875 plugins/project-wizard/templates/mkfile/po/Makefile
876 plugins/project-wizard/templates/minimal/Makefile
877 plugins/project-wizard/templates/js_minimal/Makefile
878 plugins/project-wizard/templates/js_minimal/src/Makefile
879 plugins/project-wizard/templates/terminal/Makefile
880 plugins/project-wizard/templates/terminal/src/Makefile
881 plugins/project-wizard/templates/terminal/po/Makefile
882 plugins/project-wizard/templates/cpp/Makefile
883 plugins/project-wizard/templates/cpp/src/Makefile
884 plugins/project-wizard/templates/cpp/po/Makefile
885 plugins/project-wizard/templates/gtk/Makefile
886 plugins/project-wizard/templates/gtk/src/Makefile
887 plugins/project-wizard/templates/gtk/po/Makefile
888 plugins/project-wizard/templates/gtkapplication/Makefile
889 plugins/project-wizard/templates/gtkapplication/src/Makefile
890 plugins/project-wizard/templates/gtkapplication/po/Makefile
891 plugins/project-wizard/templates/anjuta-plugin/Makefile
892 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
893 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
894 plugins/project-wizard/templates/gtkmm/Makefile
895 plugins/project-wizard/templates/gtkmm/src/Makefile
896 plugins/project-wizard/templates/gtkmm/po/Makefile
897 plugins/project-wizard/templates/gcj/Makefile
898 plugins/project-wizard/templates/gcj/src/Makefile
899 plugins/project-wizard/templates/java/Makefile
900 plugins/project-wizard/templates/java/src/Makefile
901 plugins/project-wizard/templates/java/po/Makefile
902 plugins/project-wizard/templates/python/Makefile
903 plugins/project-wizard/templates/python/src/Makefile
904 plugins/project-wizard/templates/python/po/Makefile
905 plugins/project-wizard/templates/pygtk/Makefile
906 plugins/project-wizard/templates/pygtk/src/Makefile
907 plugins/project-wizard/templates/pygtk/po/Makefile
908 plugins/project-wizard/templates/vala-gtk/Makefile
909 plugins/project-wizard/templates/vala-gtk/src/Makefile
910 plugins/project-wizard/templates/wxwin/Makefile
911 plugins/project-wizard/templates/wxwin/src/Makefile
912 plugins/project-wizard/templates/wxwin/po/Makefile
913 plugins/project-wizard/templates/xlib/Makefile
914 plugins/project-wizard/templates/xlib/src/Makefile
915 plugins/project-wizard/templates/xlib/po/Makefile
916 plugins/project-wizard/templates/xlib-dock/Makefile
917 plugins/project-wizard/templates/xlib-dock/src/Makefile
918 plugins/project-wizard/templates/xlib-dock/po/Makefile
919 plugins/project-wizard/templates/sdl/Makefile
920 plugins/project-wizard/templates/sdl/src/Makefile
921 plugins/project-wizard/templates/sdl/po/Makefile
922 plugins/project-wizard/templates/library/Makefile
923 plugins/project-wizard/templates/library/src/Makefile
924 plugins/project-wizard/templates/library/po/Makefile
925 plugins/project-wizard/templates/directory/Makefile
926 plugins/project-wizard/templates/m4/Makefile
927 plugins/project-wizard/templates/gnome-shell-extension/Makefile
928 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
929 plugins/am-project/Makefile
930 plugins/am-project/tests/atlocal
931 plugins/am-project/tests/Makefile
932 plugins/mk-project/Makefile
933 plugins/dir-project/Makefile
934 plugins/language-support-cpp-java/Makefile
935 plugins/run-program/Makefile
936 plugins/starter/Makefile
937 plugins/indentation-c-style/Makefile
938 plugins/indentation-python-style/Makefile
939 plugins/language-support-js/Makefile
940 plugins/language-support-vala/Makefile
941 plugins/language-support-python/Makefile
942 plugins/parser-cxx/Makefile
943 plugins/parser-cxx/cxxparser/Makefile
944 plugins/python-loader/Makefile
945 plugins/jhbuild/Makefile
946 plugins/quick-open/Makefile
947 anjuta.desktop.in
948 manuals/Makefile
949 manuals/reference/Makefile
950 manuals/reference/libanjuta/Makefile
951 manuals/reference/libanjuta/version.xml
952 manuals/anjuta-manual/Makefile
953 manuals/anjuta-faqs/Makefile
954 manuals/anjuta-build-tutorial/Makefile
955 mime/Makefile
957 AC_OUTPUT
958 echo " "
959 echo "-------------------------------------------------------------------"
960 echo "Conditionally built plugins:"
961 echo "-------------------------------------------------------------------"
962 if [ test -n "$SVN_INCLUDE" ]; then
963         echo "Building subversion plugin: ............................YES"
964 else
965         echo "Building subversion plugin: ............................NO"
966                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
967                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
968                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
969                 echo "        Requires subversion (>= 1.5); http://subversion.org"
972 if [ test x$gladeui_found = xyes ]; then
973        echo "Building glade plugin: .................................YES"
974 else
975        echo "Building glade plugin: .................................NO"
976        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
979 if [ test x$devhelp_enabled = xyes ]; then
980        echo "Building devhelp plugin: ...............................YES"
981 else
982        echo "Building devhelp plugin: ...............................NO"
983        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
986 if [ test x$terminal_enabled = xyes ]; then
987        echo "Building terminal plugin: ..............................YES"
988 else
989        echo "Building terminal plugin: ..............................NO"
990        echo "        Requires vte-2.90 (>= $VTE_REQUIRED)"
993 if [ test x$libgd_enabled = xyes ]; then
994         echo "Building using libgd: ..................................YES"
995 else
996         echo "Building using libgd: ..................................NO"
997         echo "        Requires gtk+ (>= $LIBGD_GTK_REQUIRED)"
1000 if [ test x$enable_vala = xyes ]; then
1001         echo "Building Vala support: .................................YES"
1002 else
1003         echo "Building Vala support: .................................NO"
1004         echo "        Requires libvala (>= $VALA_REQUIRED)"
1006 if [ test x$have_python = xyes]; then
1007         echo "Building python plugin loaeder: ........................YES"
1008 else
1009         echo "Building python plugin loaeder: ........................NO"
1010         echo "        Requires python"
1012 echo "-------------------------------------------------------------------"
1013 echo "AM_CFLAGS = $AM_CFLAGS"
1014 echo "AM_CXXFLAGS = $AM_CXXFLAGS"