symbol-db: code cleaning: removed dyn queries.
[anjuta.git] / configure.in
blob066acd438c8bad0ab9731acbf6a6cb96d95a47ae
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.59)
5 m4_define(anjuta_major_version,  2)
6 m4_define(anjuta_minor_version, 31)
7 m4_define(anjuta_micro_version,  3)
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, anjuta_version, http://bugzilla.gnome.org/enter_bug.cgi?product=anjuta)
12 AC_CONFIG_SRCDIR(src/main.c)
14 AC_DEFINE(ANJUTA_MAJOR_VERSION, anjuta_major_version, [Anjuta major version])
15 AC_SUBST(ANJUTA_MAJOR_VERSION, anjuta_major_version)
16 AC_DEFINE(ANJUTA_MINOR_VERSION, anjuta_minor_version, [Anjuta minor version])
17 AC_SUBST(ANJUTA_MINOR_VERSION, anjuta_minor_version)
18 AC_DEFINE(ANJUTA_MICRO_VERSION, anjuta_micro_version, [Anjuta micro version])
19 AC_SUBST(ANJUTA_MICRO_VERSION, anjuta_micro_version)
20 AC_DEFINE(ANJUTA_VERSION, anjuta_version, [Anjuta version])
21 AC_SUBST(ANJUTA_VERSION)
23 ANJUTA_VERSION=anjuta_version
24 AC_SUBST(ANJUTA_VERSION)
26 GLIB_REQUIRED=2.18.0
27 GDK_PIXBUF_REQUIRED=2.0.0
28 GTK_REQUIRED=2.20.0
29 PANGO_REQUIRED=0.23
30 GCONF_REQUIRED=2.12.0
31 VTE_REQUIRED=0.9.0
32 VTE_NEW_REQUIRED=0.13.1
33 LIBXML_REQUIRED=2.4.23
34 LIBDEVHELP_REQUIRED=0.22
35 GDL_REQUIRED=2.27.1
36 GLADEUI_REQUIRED=3.7.1
37 NEON_REQUIRED=0.28.2
38 SVN_MAJOR=1
39 SVN_MINOR=5
40 SVN_PATCH=0
41 SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
42 GTKSOURCEVIEW_REQUIRED=2.9.7
43 LIBWNCK_REQUIRED=2.12
44 GDA_REQUIRED=4.1.6
45 UNIQUE_REQUIRED=1.0.0
46 VALA_REQUIRED=0.7.8
47 LIBGRAPHVIZ_REQUIRED=1.0
49 AC_SUBST(GLIB_REQUIRED)
50 AC_SUBST(GDK_PIXBUF_REQUIRED)
51 AC_SUBST(GTK_REQUIRED)
52 AC_SUBST(PANGO_REQUIRED)
53 AC_SUBST(VTE_REQUIRED)
54 AC_SUBST(LIBXML_REQUIRED)
55 AC_SUBST(PANGO_REQUIRED)
56 AC_SUBST(VTE_NEW_REQUIRED)
57 AC_SUBST(LIBDEVHELP_REQUIRED)
58 AC_SUBST(GDL_REQUIRED)
59 AC_SUBST(GLADEUI_REQUIRED)
60 AC_SUBST(NEON_REQUIRED)
61 AC_SUBST(SUBVERSION_REQUIRED)
62 AC_SUBST(GTKSOURCEVIEW_REQUIRED)
63 AC_SUBST(LIBWNCK_REQUIRED)
64 AC_SUBST(GDA_REQUIRED)
65 AC_SUBST(UNIQUE_REQUIRED)
66 AC_SUBST(LIBGRAPHVIZ_REQUIRED)
68 AM_INIT_AUTOMAKE([1.11 dist-bzip2 no-dist-gzip])
69 AM_SILENT_RULES([yes])
70 AC_CONFIG_HEADERS(config.h)
71 AC_DISABLE_STATIC
72 AM_MAINTAINER_MODE
73 GNOME_DOC_INIT
75 #Check for C Compiler
76 AC_PROG_CC
77 AC_PROG_CPP
78 AC_LANG_C
79 AC_PROG_CXX
80 AM_PROG_CC_C_O
82 GNOME_COMPILE_WARNINGS(maximum)
83 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
84 AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
86 dnl Enable debugging mode
87 AC_ARG_ENABLE(debug,
88   AC_HELP_STRING([--enable-debug],[Enable debug messages]),
89   AM_CFLAGS="$AM_CFLAGS -DDEBUG"
90   AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG")
91 AC_SUBST(AM_CFLAGS)
92 AC_SUBST(AM_CXXFLAGS)
94 ANJUTA_LDFLAGS="-no-undefined"
95 ANJUTA_PLUGIN_LDFLAGS="-module -avoid-version -no-undefined"
96 AC_SUBST(ANJUTA_LDFLAGS)
97 AC_SUBST(ANJUTA_PLUGIN_LDFLAGS)
99 dnl Disable deprecated APIs
100 dnl if test x$MAINT = x; then
101 dnl     DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
102 dnl     AC_SUBST(DEPRECATED_FLAGS)
103 dnl fi
105 dnl Enable versioned user preferences directory
106 AC_ARG_WITH(pref-suffix,
107   AC_HELP_STRING([--with-pref-suffix=VALUE],[Suffix to add to user preferences dir.]),
108   PREF_SUFFIX="$withval")
110 AC_SUBST(PREF_SUFFIX)
111 AC_DEFINE_UNQUOTED(PREF_SUFFIX,
112       "${PREF_SUFFIX}",
113           [Suffix to add to preferences directory])
115 AM_DISABLE_STATIC
116 AM_PROG_LIBTOOL
118 AC_TYPE_SIGNAL
120 dnl ***************************************************************************
121 dnl Check for GConf stuff to handle schema installation
122 dnl ***************************************************************************
123 AC_PATH_PROG(GCONFTOOL, gconftool-2)
124 AM_GCONF_SOURCE_2
126 dnl ***************************************************************************
127 dnl Set gjsdir && girdir
128 dnl ***************************************************************************
129 girdir=`pkg-config --variable=girdir gobject-introspection-1.0`
130 gjsdir=`pkg-config --variable=jsdir gjs-1.0`
131 AC_SUBST(girdir)
132 AC_SUBST(gjsdir)
134 dnl ***************************************************************************
135 dnl Check for pkgconfig
136 dnl ***************************************************************************
137 AC_PATH_PROG(PKG_CONFIG, pkg-config,no)
138 if test x$PKG_CONFIG = xno; then
139   AC_MSG_ERROR(Please install the pkg-config package from http://www.freedesktop.org/software/pkgconfig/)
142 dnl pkg checks are split into separate packages instead of single package
143 dnl because different plugins have different requirements.
145 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED unique-1.0 >= $UNIQUE_REQUIRED)
147 PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
149 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
151 PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED)
153 PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED)
155 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= $GCONF_REQUIRED)
157 PKG_CHECK_MODULES(VTE, vte >= $VTE_REQUIRED)
159 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED)
161 PKG_CHECK_MODULES(GDL, gdl-1.0 >= $GDL_REQUIRED)
163 PKG_CHECK_MODULES(LIBXSLT, libxslt)
165 dnl Check for autogen
166 dnl -----------------
167 AC_PATH_PROG(AUTOGEN_PATH, autogen,no)
168 if test x$AUTOGEN_PATH = xno; then
169    AC_MSG_ERROR([Couldn't find autogen, please install the autogen package. You can get it from http://autogen.sourceforge.net/])
172 dnl Check for perl required by gbf-am/mkfile
173 dnl ----------------------------------------
174 # Automake backend requirements
175 # Also needed by Makefile backend
176 AC_PATH_PROG(PERL, perl)
177 if test -z "$PERL"; then
178    AC_MSG_ERROR([perl not found])
180 $PERL -e 'require 5.005;' || {
181    AC_MSG_ERROR([perl 5.005 or better is required])
184 # Check for perl Locale::gettext module
185 if test "x$PERL" != x; then
186         AC_MSG_CHECKING(for perl module Locale::gettext)
187         $PERL "-MLocale::gettext" -e exit > /dev/null 2>&1
188         if test $? -ne 0; then
189                 AC_MSG_ERROR([not found, you should installed perl-gettext package for your distribution]);
190         else
191         AC_MSG_RESULT(ok);
192         fi
195 dnl Check for Devhelp
196 dnl -----------------
198 AC_ARG_ENABLE(plugin-devhelp,
199   AC_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
200   [ if test "$enableval" = "no"; then
201        user_disabled_devhelp=1
202     fi ],
203   [ user_disabled_devhelp=0 ] )
205 AC_MSG_CHECKING(if devhelp plugin is disabled)
206 if test "$user_disabled_devhelp" = 1; then
207         AC_MSG_RESULT(yes)
208         devhelp_enabled="no"
209 else
210         AC_MSG_RESULT(no)
211         PKG_CHECK_MODULES(PLUGIN_DEVHELP, 
212                                 [libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0],
213                                 [
214                                     devhelp_enabled=yes
215                                 ], [
216                                     devhelp_enabled=no
217                                 ])
220 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
222 dnl Check for Glade3
223 dnl ---------------------
225 AC_ARG_ENABLE(plugin-glade,
226   AC_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
227   [ if test "$enableval" = "no"; then
228        user_disabled_glade=1
229     fi ],
230   [ user_disabled_glade=0 ] )
232 AC_MSG_CHECKING(if glade plugin is disabled)
233 if test "$user_disabled_glade" = 1; then
234         AC_MSG_RESULT(yes)
235         gladeui_found="no"
236 else
237         AC_MSG_RESULT(no)
238         gladeui_version=0
239         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-1.0 >= $GLADEUI_REQUIRED,
240             [
241                 gladeui_found=yes
242             ], [
243                 gladeui_found=no
244             ])
247 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
249 dnl Check for gtksourceview
250 dnl -------------------------------------------------------------
252 AC_ARG_ENABLE(plugin-sourceview,
253         AC_HELP_STRING([--disable-plugin-sourceview],[Disable gtksourceview based editor in Anjuta]), 
254         [ if test "$enableval" = "no"; then
255                 user_disabled_sourceview=1
256           fi ],
257         [ user_disabled_sourceview=0 ])
259 AC_MSG_CHECKING(if sourceview plugin is disabled)
260 if test "$user_disabled_sourceview" = 1; then
261         AC_MSG_RESULT(yes)
262         sourceview="no"
263 else
264         AC_MSG_RESULT(no)
265         
266         PKG_CHECK_MODULES(PLUGIN_SOURCEVIEW,
267                 [gtksourceview-2.0 >= $GTKSOURCEVIEW_REQUIRED],
268                 [sourceview="yes"],
269                 [sourceview="no"])
272 AM_CONDITIONAL(HAVE_PLUGIN_SOURCEVIEW, [test x$sourceview = xyes])
274 dnl Check for vala
275 dnl -------------------------------------------------------------
277 PKG_CHECK_MODULES(VALA,
278         [vala-1.0 >= $VALA_REQUIRED],
279         [enable_vala="yes"],
280         [enable_vala="no"])
282 if test x$enable_vala = xyes; then
283         AC_PATH_PROG(VALAC, valac, valac)
284         AC_SUBST(VALAC)
287 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
289 PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
290                 [libgda-4.0 >= $GDA_REQUIRED])
292 dnl Setup Anjuta Library flags
293 dnl --------------------------
294 LIBANJUTA_CFLAGS='$(GLIB_CFLAGS) $(GTK_CFLAGS) $(GCONF_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)"\"'
295 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta.la'
296 AC_SUBST(LIBANJUTA_CFLAGS)
297 AC_SUBST(LIBANJUTA_LIBS)
299 dnl Setup FooCanvas Library flags
300 dnl --------------------------
301 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
302 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
303 AC_SUBST(LIBFOOCANVAS_CFLAGS)
304 AC_SUBST(LIBFOOCANVAS_LIBS)
306 dnl Checks for Xft/XRender for foocanvas
308 AC_CHECK_LIB(Xrender, XRenderFindFormat, 
309         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
310          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
311         [AC_SUBST(RENDER_LIBS, "")],
312         [-lXext])
314 dnl Setup Plugin directories
315 dnl ------------------------
316 anjuta_plugin_dir='$(libdir)/anjuta'
317 anjuta_data_dir='$(datadir)/anjuta'
318 anjuta_ui_dir='$(datadir)/anjuta/ui'
319 anjuta_glade_dir='$(datadir)/anjuta/glade'
320 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
321 AC_SUBST(anjuta_plugin_dir)
322 AC_SUBST(anjuta_data_dir)
323 AC_SUBST(anjuta_ui_dir)
324 AC_SUBST(anjuta_glade_dir)
325 AC_SUBST(anjuta_image_dir)
327 dnl ***************************************************************************
328 dnl Check for old vte version
329 dnl ***************************************************************************
330 PKG_CHECK_MODULES(VTE, vte >= $VTE_NEW_REQUIRED, OLD_VTE=0, OLD_VTE=1)
331 AC_SUBST(OLD_VTE)
332 AC_DEFINE_UNQUOTED(OLD_VTE, $OLD_VTE, [Old version of vte])
334 dnl ***************************************************************************
335 dnl Check for marshal and enum generators
336 dnl ***************************************************************************
337 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
338 AC_SUBST(GLIB_GENMARSHAL)
339 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
340 AC_SUBST(GLIB_MKENUMS)
342 dnl Set up Glade 3 catlog information
343 dnl ---------------------
344 GLADE_PLUGINS_PATH="`$PKG_CONFIG --variable=moduledir gladeui-1.0`"
345 AC_SUBST(GLADE_PLUGINS_PATH)
346 GLADE_CATALOG_PATH="`$PKG_CONFIG --variable=catalogdir gladeui-1.0`"
347 AC_SUBST(GLADE_CATALOG_PATH)
349 dnl ***************************************************************************
350 dnl Internatinalization
351 dnl ***************************************************************************
352 GETTEXT_PACKAGE=anjuta
353 AC_SUBST(GETTEXT_PACKAGE)
354 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
355 AM_GLIB_GNU_GETTEXT
356 IT_PROG_INTLTOOL([0.40.1])
358 dnl ***************************************************************************
359 dnl Check for gtk-doc.
360 dnl ***************************************************************************
361 GTK_DOC_CHECK([1.4])
363 dnl Define convenience macros
364 dnl -------------------------
365 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
366 AC_DEFUN([CHECK_HEADER_DEFINE],
368         AC_MSG_CHECKING("if $1 is defined in $2")
369         AC_EGREP_CPP(yes,
370 [#include <$2>
371 #ifdef $1
372   yes
373 #endif
374 ], [
375         AC_MSG_RESULT(yes)
376         $3
377 ], [
378         AC_MSG_RESULT(no)
379         $4
380 ]) ])
382 dnl Checks for header files.
383 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
384 AC_CHECK_HEADERS(time.h types.h unistd.h)
385 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
387 dnl Checks for typedefs, structures, and compiler characteristics.
389 dnl Disable cygwin check until someone fixes that stupid autoconf warnings.
390 dnl AC_CYGWIN
391 dnl AC_MINGW
393 AC_C_CONST
394 AC_OBJEXT
395 AC_EXEEXT
397 AC_TYPE_SIZE_T
398 AC_TYPE_OFF_T
400 AC_MSG_CHECKING("for fpos_t")
401 AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),
403     AC_MSG_RESULT(no)
404     AC_DEFINE(fpos_t, long, [fpos_t is type long])
407 AC_MSG_CHECKING("for clock_t")
408 AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
410     AC_MSG_RESULT(no)
411     AC_DEFINE(clock_t, long, [clock_t is type long])
414 CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20, [L_tmpname is 20]))
416 CHECK_HEADER_DEFINE(INT_MAX, limits.h,,
417     CHECK_HEADER_DEFINE(MAXINT, limits.h,
418         AC_DEFINE(INT_MAX, MAXINT, [Maximum int size]), AC_DEFINE(INT_MAX, 32767, [Maximum int size])))
420 AC_MSG_CHECKING(if struct stat contains st_ino)
421 AC_TRY_COMPILE([#include <sys/stat.h>], [
422     struct stat st;
423     stat(".", &st);
424     if (st.st_ino > 0)
425         exit(0);
426 ], have_st_ino=yes, have_st_ino=no)
427 AC_MSG_RESULT($have_st_ino)
428 if test yes = "$have_st_ino"; then
429     AC_DEFINE(HAVE_STAT_ST_INO,,[Have stat st_ino])
433 dnl Check for bind in libsocket (needed on Solaris)
434 AC_CHECK_LIB(socket, bind)
436 dnl Check for function forkpty and related headers
437 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
438 AC_CHECK_HEADERS(libutil.h util.h pty.h)
440 dnl Checks for library functions.
441 AC_CHECK_FUNCS(fnmatch)
442 AC_CHECK_FUNCS(strstr)
443 AC_CHECK_FUNCS(stricmp)
444 AC_CHECK_FUNCS(strnicmp)
445 AC_CHECK_FUNCS(getline)
447 dnl for libegg/egg-recent-model.c
448 AC_CHECK_DECLS([lockf])
449 AC_CHECK_FUNCS([lockf])
451 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
453 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
454 if test "$have_fgetpos" != yes ; then
455     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
456         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
457             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
460 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
461 if test "$have_mkstemp" != yes ; then
462     AC_CHECK_FUNCS(chmod)
463     if test "$tmpdir_specified" = yes ; then
464         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
465     fi
466 else
467     AC_MSG_CHECKING(directory to use for temporary files)
468     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
469         then tmpdir=/tmp
470         else tmpdir="$enable_tmpdir"
471     fi
472     if test -d $tmpdir ; then
473         AC_MSG_RESULT($tmpdir)
474         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
475     else
476         AC_MSG_WARN($tmpdir does not exist)
477     fi
480 AC_CHECK_FUNCS(strerror opendir)
481 AC_CHECK_FUNCS(clock times, break)
482 AC_CHECK_FUNCS(remove, have_remove=yes,
483     CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink, [Remove is unlink])))
485 AC_CHECK_FUNCS(truncate, have_truncate=yes)
486 dnl === Cannot nest AC_CHECK_FUNCS() calls
487 if test "$have_truncate" != yes  ; then
488     AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes)
489     if test "$have_ftruncate" != yes ; then
490         AC_CHECK_FUNCS(chsize)
491     fi
494 AC_CHECK_FUNCS(setenv, have_setenv=yes)
495 dnl === Cannot nest AC_CHECK_FUNCS() calls
496 if test "$have_setenv" != yes ; then
497     AC_CHECK_FUNCS(putenv, have_putenv=yes)
498     if test "$have_putenv" = yes ; then
499         AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes)
500         if test "$have_putenv_prototype" = yes ; then
501             AC_MSG_CHECKING("putenv prototype")
502             AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[   ]*\(.*const.*\)[    ]*;],
503                 stdlib.h, AC_MSG_RESULT(correct),
504                 [
505                     AC_MSG_RESULT(no const)
506                     AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE,,[putenv has non constant prototype])
507                 ])
508         fi
509     fi
513 dnl if test yes = "$CYGWIN"; then with_posix_regex=no; fi
514 if test no != "$with_posix_regex"; then
515     AC_CHECK_FUNCS(regcomp)
516     AC_MSG_CHECKING(if regcomp works)
517     AC_TRY_RUN([
518 #include <sys/types.h>
519 #include <regex.h>
520 main() {
521     regex_t patbuf;
522     exit (regcomp (&patbuf, "/hello/", 0) != 0);
523 }],regcomp_works=yes,regcomp_works=no,AC_DEFINE(CHECK_REGCOMP,,[Check regcomp]))
524     AC_MSG_RESULT($regcomp_works)
525     if test yes != "$regcomp_works"; then
526         AC_DEFINE(REGCOMP_BROKEN,,[Regcomp is broken])
527     fi
530 dnl -----------------------------
531 dnl Checks for FreeBSD Build
532 dnl -----------------------------
533 AC_MSG_CHECKING(if building on FreeBSD)
535 if test `uname -s` = "FreeBSD" ; then
536         AC_MSG_RESULT(yes)
537         FREEBSD_BUILD=-DFREEBSD
538         AC_SUBST(FREEBSD_BUILD)
539         AC_PATH_PROG(GMAKE, gmake, no)
540         if test "x$GMAKE" = "xno"; then
541                 AC_ERROR(You need gmake installed to build Anjuta!)
542         fi
543 else
544         AC_MSG_RESULT(no)
545         GMAKE="make"
548 AC_SUBST(GMAKE)
550 dnl Checks for missing prototypes
551 dnl -----------------------------
552 AC_CHECKING("for missing prototypes")
554 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))])
556 if test "$have_remove" = yes ; then
557     CHECK_PROTO(remove, stdio.h)
558 else
559     CHECK_PROTO(unlink, unistd.h)
561 CHECK_PROTO(malloc, stdlib.h)
562 CHECK_PROTO(getenv, stdlib.h)
563 CHECK_PROTO(stat,   sys/stat.h)
564 CHECK_PROTO(lstat,  sys/stat.h)
565 if test "$have_fgetpos" = yes ; then
566     CHECK_PROTO(fgetpos, stdio.h)
568 if test "$have_truncate" = yes ; then
569     CHECK_PROTO(truncate, unistd.h)
571 if test "$have_ftruncate" = yes ; then
572     CHECK_PROTO(ftruncate, unistd.h)
575 dnl  **********************************************************
576 dnl  check if we have svn libraries to build subversion plugin
577 dnl  (stolen from kdevelop ;-)
578 dnl  **********************************************************
580 AC_MSG_CHECKING(for Subversion svn-config)
581 AC_ARG_WITH(subversion-dir,
582                 AC_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
583                 [
584                                 SVNCONFIG="$withval/bin/svn-config"
585                 ])
587 if test -z "$SVNCONFIG"; then
588                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
589                 if test -n "$_SVNCONFIG"; then
590                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
591                 fi
594 AC_SUBST(SVNCONFIG)
595 if test -x "$SVNCONFIG"; then
596                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
597                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
598                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
599                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
600                 AC_MSG_RESULT(yes)
601 else
602                 AC_MSG_RESULT(not found)
603                 
604                 dnl just a fallback to debian's config so that it works for me :)
605                 AC_ARG_WITH(svn-include,
606                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
607                                                                 [
608                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
609                                                                                 SVN_INCLUDES=$withval
610                                                                 fi
611                                                                 ])
612                 if test -z "$SVN_INCLUDES"; then
613                         SVN_INCLUDES="/usr/local/include /usr/include"
614                 fi
615                 AC_MSG_CHECKING([for Subversion headers])
616                 SVN_INCLUDE=""
617                 for VALUE in $SVN_INCLUDES ; do
618                                 if test -f $VALUE/subversion-1/svn_types.h ; then
619                                                 SVN_INCLUDE=$VALUE/subversion-1
620                                                 break
621                                 fi
622                                 if test -f $VALUE/svn_types.h ; then
623                                                 SVN_INCLUDE=$VALUE
624                                                 break
625                                 fi
626                 done
627                 if test $SVN_INCLUDE ; then
628                                 AC_MSG_RESULT([found])
629                 else
630                                 AC_MSG_RESULT([not found])
631                 fi
632                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
633                 AC_ARG_WITH(svn-lib,
634                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
635                                                 [
636                                                         if test "$withval" != "yes" -a "$withval" != ""; then
637                                                                 SVN_LIBS=$withval
638                                                         fi
639                                                 ])
640                 AC_MSG_CHECKING([for Subversion libraries])
641                 SVN_LIB=""
642                 for VALUE in $SVN_LIBS ; do
643                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
644                                                 SVN_LIB=$VALUE
645                                                 break
646                                 fi
647                 done
648                 if test $SVN_LIB ; then
649                                 AC_MSG_RESULT([found])
650                 else
651                                 AC_MSG_RESULT([not found])
652                 fi
655 dnl ******************************************************************
656 dnl Check for extra libs required by subversion.
657 dnl FIXME: This should actually be done by subversion and not by us.
658 dnl ******************************************************************
660 AC_ARG_ENABLE(plugin-subversion,
661   AC_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
662   [ if test "$enableval" = "no"; then
663         user_disabled_subversion=1
664     fi ],
665   [ user_disabled_subversion=0 ] )
667 AC_MSG_CHECKING(if subversion support is disabled)
668 if test "$user_disabled_subversion" = 1; then
669         AC_MSG_RESULT(yes)
670         SVN_INCLUDE=""
671         SVN_LIB=""
672 else
673         AC_MSG_RESULT(no)
676 if test -n "$SVN_INCLUDE" ; then
677         dnl ------------------------------------
678         dnl APR. Required by subversion (devel)
679         dnl ------------------------------------
680         have_atr=no
681         PKG_CHECK_MODULES(APR,                            \
682                 apr-1, have_apr=yes, have_apr=no)
683         if test x"$have_apr" = "xno"; then
684                 SVN_INCLUDE=""
685         fi
686         
687         dnl -----------------------------------------
688         dnl APR util. Required by subversion (devel)
689         dnl------------------------------------------
690         have_atr_util=no
691         PKG_CHECK_MODULES(APR_UTILS,                            \
692                 apr-util-1, have_apr_util=yes, have_apr_util=no)
693         if test x"$have_apr_util" = "xno"; then
694                 SVN_INCLUDE=""
695         fi
696         
697         dnl -----------------------------------------
698         dnl NEON. Required by subversion (devel)
699         dnl------------------------------------------
700         have_neon=no
701         PKG_CHECK_MODULES(NEON,                            \
702                 neon, have_neon=yes, have_neon=no)
703         if test x"$have_neon" = "xno"; then
704                 SVN_INCLUDE=""
705         fi
707         dnl Make sure our SVN version is high enough
708         dnl Eww, eww, eww, this is dirty
709         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
710         AC_LANG(C)
711         dnl Temporarily set CFLAGS so that include dirs are found
712         CFLAGS_TMP=$CFLAGS
713         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
714         AC_COMPILE_IFELSE(
715                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
716                         [[
717                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
718                                 #       error "Version too low"
719                                 #endif
720                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
721         if test x"$have_svn_version" = "xno"; then
722                 AC_MSG_RESULT(no)
723                 SVN_INCLUDE=""
724         fi
725         CFLAGS=$CFLAGS_TMP
728 dnl ------------------------------------------
729 dnl Finally prepare subversion build flags
730 dnl ------------------------------------------
732 if test -n "$SVN_INCLUDE" ; then
733         SVN_INCLUDE="-I$SVN_INCLUDE"
734         if test x != "x$SVN_LIB" ; then
735             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
736         else
737             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS -lsvn_client-1 -lsvn_subr-1"
738         fi
739         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS"
742 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
743 AC_SUBST(SVN_INCLUDE)
744 AC_SUBST(SVN_LIB)
745 AC_SUBST(SVN_CFLAGS)
747 dnl ------------------------------------------
748 dnl Symbol-db shared memory checks
749 dnl ------------------------------------------
751 SYMBOL_DB_SHM="/dev/shm"
752 user_specified_shm=0
753 AC_MSG_CHECKING(for symbol-db shared memory)
754 AC_ARG_WITH(symbol-db-shm,
755                 AC_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
756                 [
757                                 user_specified_shm=1
758                                 SYMBOL_DB_SHM="$withval"
759                 ])
760 if test "$user_specified_shm" = 1; then
761         AC_MSG_RESULT(yes)
762 else
763         AC_MSG_RESULT(no)
766 AC_SUBST(SYMBOL_DB_SHM)
769 dnl Check for graphviz (class inheritance and profiler plugins)
770 dnl --------------------------------------------------------------------------
771 dnl FIXME: For some strange reason graphviz-devel rpm install the *.pc files
772 dnl in /usr/lib/graphviz/pkgconfig, instead of usual /usr/lib/pkgconfig. This
773 dnl makes pkgconfig check fail if we don't add the above path in
774 dnl PKG_CONFIG_PATH. We have added both /usr/lib/graphviz/pkgconfig and
775 dnl /usr/local/lib/pkgconfig paths. If graphviz is installed in other prefix
776 dnl (other than /usr or /usr/local or the current installation prefix),
777 dnl following pkgconfig check will fail.
778 dnl --------------------------------------------------------------------------
779 AC_ARG_ENABLE(graphviz,
780         AC_HELP_STRING([--disable-graphviz],[Disable GraphViz support in Anjuta]), 
781         [ if test "$enableval" = "no"; then
782                 user_disabled_graphviz=1
783           fi ],
784         [ user_disabled_graphviz=0 ])
786 AC_MSG_CHECKING(if GraphViz support is disabled)
787 if test "$user_disabled_graphviz" = 1; then
788         AC_MSG_RESULT(yes)
789         libgraphviz_found="no"
790 else
791         AC_MSG_RESULT(no)
792         
793         dnl Set pkgconfig path
794         ANJUTA_PKG_CONFIG_PATH_SAVE="${PKG_CONFIG_PATH}"
795         PKG_CONFIG_PATH="/usr/lib/graphviz/pkgconfig:$PKG_CONFIG_PATH"
796         PKG_CONFIG_PATH="/usr/local/lib/graphviz/pkgconfig:$PKG_CONFIG_PATH"
797         PKG_CONFIG_PATH="/usr/lib64/graphviz/pkgconfig:$PKG_CONFIG_PATH"
798         PKG_CONFIG_PATH="/usr/local/lib64/graphviz/pkgconfig:$PKG_CONFIG_PATH"
799         
800         anjuta_save_prefix="$prefix"
801         test "x$prefix" = xNONE && prefix=$ac_default_prefix
802         graphviz_pkgconfig=`eval echo ${libdir}/graphviz/pkgconfig`
803         PKG_CONFIG_PATH="$graphviz_pkgconfig:$PKG_CONFIG_PATH"
804         prefix="$anjuta_save_prefix"
806         export PKG_CONFIG_PATH
807         PKG_CHECK_MODULES(GRAPHVIZ,
808                 [libgvc >= $LIBGRAPHVIZ_REQUIRED libgraph >= $LIBGRAPHVIZ_REQUIRED], 
809                 [libgraphviz_found="yes"],
810                 [libgraphviz_found="no"])
811         
812         dnl Restore pkgconfig path
813         PKG_CONFIG_PATH="${ANJUTA_PKG_CONFIG_PATH_SAVE}"
814         export PKG_CONFIG_PATH
817 AM_CONDITIONAL(HAVE_GRAPHVIZ, [test x$libgraphviz_found = xyes])
819 dnl --------- help outputs -----------
820 dnl manuals/C/Makefile
821 dnl manuals/C/anjuta-tutorial/Makefile
822 dnl manuals/C/anjuta-advanced-tutorial/Makefile
823 dnl manuals/C/anjuta-faqs/Makefile
824 dnl manuals/C/anjuta-manual/Makefile
825 dnl manuals/de/Makefile
826 dnl manuals/de/anjuta-tutorial/Makefile
827 dnl manuals/ja/Makefile
828 dnl manuals/ja/anjuta-faqs/Makefile
829 dnl manuals/ja/anjuta-manual/Makefile
831 AC_OUTPUT([
832 Makefile
833 po/Makefile.in
834 libfoocanvas/Makefile
835 libanjuta/Makefile
836 libanjuta/libanjuta-1.0.pc
837 libanjuta/anjuta-version.h
838 libanjuta/interfaces/Makefile
839 src/Makefile
840 pixmaps/Makefile
841 pixmaps/16x16/Makefile
842 pixmaps/22x22/Makefile
843 pixmaps/24x24/Makefile
844 pixmaps/32x32/Makefile
845 pixmaps/48x48/Makefile
846 pixmaps/scalable/Makefile
847 data/Makefile
848 data/welcome.txt
849 doc/anjuta.1
850 doc/anjuta-launcher.1
851 doc/Makefile
852 scripts/Makefile
853 launcher/Makefile
854 plugins/Makefile
855 plugins/gtodo/Makefile
856 plugins/class-gen/Makefile
857 plugins/class-gen/templates/Makefile
858 plugins/class-inheritance/Makefile
859 plugins/patch/Makefile
860 plugins/document-manager/Makefile
861 plugins/document-manager/images/Makefile
862 plugins/search/Makefile
863 plugins/message-view/Makefile
864 plugins/gdb/Makefile
865 plugins/gdb/images/Makefile
866 plugins/debug-manager/Makefile
867 plugins/debug-manager/images/Makefile
868 plugins/devhelp/Makefile
869 plugins/glade/Makefile
870 plugins/js-debugger/Makefile
871 plugins/file-manager/Makefile
872 plugins/file-loader/Makefile
873 plugins/file-wizard/Makefile
874 plugins/terminal/Makefile
875 plugins/build-basic-autotools/Makefile
876 plugins/project-manager/Makefile
877 plugins/gbf-am/Makefile
878 plugins/gbf-am/gbf-am-parse
879 plugins/gbf-am/GBF/Makefile
880 plugins/gbf-mkfile/Makefile
881 plugins/gbf-mkfile/gbf-mkfile-parse
882 plugins/gbf-mkfile/GBF/Makefile
883 plugins/symbol-db/benchmark/Makefile
884 plugins/symbol-db/images/Makefile
885 plugins/symbol-db/Makefile
886 plugins/symbol-db/anjuta-tags/Makefile
887 plugins/project-wizard/Makefile
888 plugins/macro/Makefile
889 plugins/cvs-plugin/Makefile
890 plugins/subversion/Makefile
891 plugins/git/Makefile
892 plugins/sourceview/Makefile
893 plugins/tools/Makefile
894 plugins/tools/scripts/Makefile
895 plugins/language-manager/Makefile
896 plugins/project-import/Makefile
897 plugins/project-wizard/templates/Makefile
898 plugins/project-wizard/templates/mkfile/Makefile
899 plugins/project-wizard/templates/mkfile/src/Makefile
900 plugins/project-wizard/templates/mkfile/po/Makefile
901 plugins/project-wizard/templates/minimal/Makefile
902 plugins/project-wizard/templates/js_minimal/Makefile
903 plugins/project-wizard/templates/js_minimal/src/Makefile
904 plugins/project-wizard/templates/terminal/Makefile
905 plugins/project-wizard/templates/terminal/src/Makefile
906 plugins/project-wizard/templates/terminal/po/Makefile
907 plugins/project-wizard/templates/cpp/Makefile
908 plugins/project-wizard/templates/cpp/src/Makefile
909 plugins/project-wizard/templates/cpp/po/Makefile
910 plugins/project-wizard/templates/gtk/Makefile
911 plugins/project-wizard/templates/gtk/src/Makefile
912 plugins/project-wizard/templates/gtk/po/Makefile
913 plugins/project-wizard/templates/anjuta-plugin/Makefile
914 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
915 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
916 plugins/project-wizard/templates/gtkmm/Makefile
917 plugins/project-wizard/templates/gtkmm/src/Makefile
918 plugins/project-wizard/templates/gtkmm/po/Makefile
919 plugins/project-wizard/templates/gcj/Makefile
920 plugins/project-wizard/templates/gcj/src/Makefile
921 plugins/project-wizard/templates/java/Makefile
922 plugins/project-wizard/templates/java/src/Makefile
923 plugins/project-wizard/templates/java/po/Makefile
924 plugins/project-wizard/templates/python/Makefile
925 plugins/project-wizard/templates/python/src/Makefile
926 plugins/project-wizard/templates/python/po/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/licenses/Makefile
940 plugins/project-wizard/templates/gnome-applet/Makefile
941 plugins/project-wizard/templates/gnome-applet/src/Makefile
942 plugins/project-wizard/templates/gnome-applet/po/Makefile
943 plugins/project-wizard/templates/library/Makefile
944 plugins/project-wizard/templates/library/src/Makefile
945 plugins/project-wizard/templates/library/po/Makefile
946 plugins/project-wizard/templates/directory/Makefile
947 plugins/project-wizard/templates/m4/Makefile
948 plugins/dir-project/Makefile
949 plugins/language-support-cpp-java/Makefile
950 plugins/language-support-cpp-java/cxxparser/Makefile
951 plugins/run-program/Makefile
952 plugins/starter/Makefile
953 plugins/language-support-js/Makefile
954 plugins/language-support-vala/Makefile
955 anjuta.desktop.in
956 manuals/Makefile
957 manuals/reference/Makefile
958 manuals/reference/libanjuta/Makefile
959 manuals/reference/libanjuta/version.xml
960 manuals/anjuta-manual/Makefile
961 manuals/anjuta-faqs/Makefile
962 manuals/anjuta-build-tutorial/Makefile
963 mime/Makefile
965 chmod +x ${ac_top_build_dir}plugins/gbf-am/gbf-am-parse
966 chmod +x ${ac_top_build_dir}plugins/gbf-mkfile/gbf-mkfile-parse
967 echo " "
968 echo "-------------------------------------------------------------------"
969 echo "Conditionally built plugins:"
970 echo "-------------------------------------------------------------------"
971 if [ test -n "$SVN_INCLUDE" ]; then
972         echo "Building subversion plugin: ............................YES"
973 else
974         echo "Building subversion plugin: ............................NO"
975                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
976                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
977                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
978                 echo "        Requires subversion (>= 1.5); http://subversion.org"
981 if [ test x$gladeui_found = xyes ]; then
982        echo "Building glade plugin: .................................YES"
983 else
984        echo "Building glade plugin: .................................NO"
985        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
988 if [ test x$devhelp_enabled = xyes ]; then
989        echo "Building devhelp plugin: ...............................YES"
990 else
991        echo "Building devhelp plugin: ...............................NO"
992        echo "        Requires devhelp >= 0.22"
995 if [ test x$sourceview = xyes ]; then
996         echo "Building GtkSourceView based editor: ...................YES"
997 else
998         echo "Building GtkSourceView based editor: ...................NO"
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$libgraphviz_found = xyes ]; then
1007         echo "Building class inheritance plugin: .....................YES"
1008 else
1009         echo "Building class inheritance plugin: .....................NO"
1010         echo "        Requires graphviz (>= 2.6.0); http://graphviz.org"
1012 echo "-------------------------------------------------------------------"
1013 echo "AM_CFLAGS = $AM_CFLAGS"
1014 echo "AM_CXXFLAGS = $AM_CXXFLAGS"