bgo#770822 - "Search for example code" points to discontinued webpage
[anjuta.git] / configure.ac
blob6a64c5301e9100bf77dd9a1f6abe4c3cdced4e83
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,  22)
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 LIBXML_REQUIRED=2.4.23
41 GDL_REQUIRED=3.5.5
42 LIBWNCK_REQUIRED=2.12
44 dnl GtkSourceView
45 GTKSOURCEVIEW_REQUIRED=3.0.0
47 dnl Terminal
48 VTE_REQUIRED=0.27.6
50 dnl Devhelp
51 LIBDEVHELP_REQUIRED=3.7.4
53 dnl Glade
54 GLADEUI_REQUIRED=3.12.0
56 dnl Introspection
57 GI_REQUIRED=0.9.5
59 dnl Subversion plugin
60 NEON_REQUIRED=0.28.2
61 SERF_REQUIRED=1.2.0
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 tar-ustar])
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([yes])
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/])
176 dnl Check for Terminal
177 dnl ---------------------
179 AC_ARG_ENABLE(plugin-terminal,
180   AS_HELP_STRING([--disable-plugin-terminal],[Disable terminal plugin support in Anjuta.]),
181   [ if test "$enableval" = "no"; then
182        user_disabled_terminal=1
183     fi ],
184   [ user_disabled_terminal=0 ] )
186 AC_MSG_CHECKING(if terminal plugin is disabled)
187 if test "$user_disabled_terminal" = 1; then
188         AC_MSG_RESULT(yes)
189         terminal_enabled="no"
190 else
191         AC_MSG_RESULT(no)
192         PKG_CHECK_EXISTS([vte-2.91 >= $VTE_REQUIRED],
193                  [vte_2_91_enabled=yes],
194                  [vte_2_91_enabled=no])
195         if test $vte_2_91_enabled = yes; then
196                 PKG_CHECK_MODULES(PLUGIN_TERMINAL, [vte-2.91 >= $VTE_REQUIRED],
197                         [terminal_enabled=yes],
198                         [terminal_enabled=no])
199                 AC_DEFINE(HAVE_VTE_2_91,1,[libvte 2.91 support])
200         else
201                 PKG_CHECK_MODULES(PLUGIN_TERMINAL, [vte-2.90 >= $VTE_REQUIRED],
202                         [terminal_enabled=yes],
203                         [terminal_enabled=no])
204                 AC_DEFINE(HAVE_VTE_2_90,1,[libvte 2.90 support])
205         fi
208 AM_CONDITIONAL(HAVE_PLUGIN_TERMINAL, [test x$terminal_enabled = xyes])
210 dnl Check for Devhelp
211 dnl -----------------
213 AC_ARG_ENABLE(plugin-devhelp,
214   AS_HELP_STRING([--disable-plugin-devhelp],[Disable devhelp plugin support in Anjuta.]),
215   [ if test "$enableval" = "no"; then
216        user_disabled_devhelp=1
217     fi ],
218   [ user_disabled_devhelp=0 ] )
220 AC_MSG_CHECKING(if devhelp plugin is disabled)
221 if test "$user_disabled_devhelp" = 1; then
222         AC_MSG_RESULT(yes)
223         devhelp_enabled="no"
224 else
225         AC_MSG_RESULT(no)
226         PKG_CHECK_MODULES(PLUGIN_DEVHELP,
227                                 [libdevhelp-3.0 >= $LIBDEVHELP_REQUIRED],
228                                 [
229                                     devhelp_enabled=yes
230                                 ], [
231                                     devhelp_enabled=no
232                                 ])
235 if test "x$devhelp_enabled" = "xyes"; then
236         case "$PLUGIN_DEVHELP_LIBS" in
237                 *webkit2gtk-3.0*)
238                         AC_DEFINE([HAVE_WEBKIT2], [1], [Defined if devhelp is built against webkitgtk2])
239                         ;;
240                 *webkit2gtk-4.0*)
241                         AC_DEFINE([HAVE_WEBKIT2], [1], [Defined if devhelp is built against webkitgtk2])
242                         ;;
243                 esac
245 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
247 dnl Check for Glade3
248 dnl ---------------------
250 AC_ARG_ENABLE(plugin-glade,
251   AS_HELP_STRING([--disable-plugin-glade],[Disable glade plugin support in Anjuta.]),
252   [ if test "$enableval" = "no"; then
253        user_disabled_glade=1
254     fi ],
255   [ user_disabled_glade=0 ] )
257 AC_MSG_CHECKING(if glade plugin is disabled)
258 if test "$user_disabled_glade" = 1; then
259         AC_MSG_RESULT(yes)
260         gladeui_found="no"
261 else
262         AC_MSG_RESULT(no)
263         gladeui_version=0
264         PKG_CHECK_MODULES(PLUGIN_GLADE, gladeui-2.0 >= $GLADEUI_REQUIRED,
265             [
266                 gladeui_found=yes
267             ], [
268                 gladeui_found=no
269             ])
272 AM_CONDITIONAL(HAVE_PLUGIN_GLADE, [test x$gladeui_found = xyes])
274 dnl Glade catalog
275 dnl ---------------------
277 AC_ARG_ENABLE(glade-catalog,
278   AS_HELP_STRING([--enable-glade-catalog], [Enable glade catalog. Glade UI libraries must be installed]),
279   [ user_enabled_glade_catalog=1 ],
280   [ user_enabled_glade_catalog=0 ])
282 glade_catalog_enabled="no"
284 AC_MSG_CHECKING(if glade catalog is enabled)
285 if test "$gladeui_found" = "yes"; then
286   if test "$user_enabled_glade_catalog" = 1; then
287     AC_MSG_RESULT(yes)
288     glade_catalog_enabled="yes"
289     GLADE_CATALOG_PATH=`pkg-config --variable=catalogdir gladeui-2.0`
290     GLADE_PLUGINS_PATH=`pkg-config --variable=moduledir gladeui-2.0`
292     AC_SUBST(GLADE_CATALOG_PATH)
293     AC_SUBST(GLADE_PLUGINS_PATH)
294   else
295     AC_MSG_RESULT(no) 
296   fi
297 else
298   AC_MSG_RESULT(no)
301 AM_CONDITIONAL(ENABLE_GLADE_CATALOG, [test x$glade_catalog_enabled = xyes])
303 dnl Check for gtksourceview
304 dnl -------------------------------------------------------------
305 PKG_CHECK_MODULES(SOURCEVIEW,
306                 [gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED])
309 dnl Check for libsqlite3 used in symbol-db benchmarks
310 dnl -------------------------------------------------------------
311 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite3_found=yes, sqlite3_found=no)
312 AM_CONDITIONAL(HAVE_SQLITE, [test x$sqlite3_found = xyes])
315 dnl Check for vala
316 dnl -------------------------------------------------------------
318 AC_ARG_ENABLE(vala,
319         AS_HELP_STRING([--disable-vala],[Disable vala support]),
320         [ if test "$enableval" = "no"; then
321                 user_disabled_vala=1
322           fi ],
323         [ user_disabled_vala=0 ])
325 AC_MSG_CHECKING(if vala support is disabled)
326 if test "$user_disabled_vala" = 1; then
327         AC_MSG_RESULT(yes)
328         enable_vala="no"
329 else
330         AC_MSG_RESULT(no)
331         AC_MSG_CHECKING(if libvala is available)
332         m4_foreach([VERSION], [[0.18], [0.20], [0.22], [0.24], [0.26], [0.28], [0.30], [0.32],[0.34]],
333                 [PKG_CHECK_EXISTS([ libvala-VERSION ],
334                          [ valaver="-VERSION" ])
335                          ])
336         if test "x$valaver" != "x"; then
337                 AC_MSG_RESULT(yes)
338                 enable_vala="yes"
339                 LIBVALA="libvala${valaver}"
340                 PKG_CHECK_MODULES([VALA], ${LIBVALA})
341         else
342                 AC_MSG_RESULT(no)
343                 enable_vala="no"
344                 VALA_REQUIRED=0.18.0
345         fi
346         AC_SUBST(LIBVALA)
349 if test x$enable_vala = xyes; then
350         AC_PATH_PROGS(VALAC, [valac${valaver} valac], valac)
351         AC_SUBST(VALAC)
354 AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])
356 dnl Check for Python
357 dnl -------------------------------------------------------------
359 AM_PATH_PYTHON([],
360         [have_python="yes"],
361         [have_python="no"])
363 if test x$have_python = xyes; then
364         if test -x $PYTHON-config; then
365                 PYTHON_CFLAGS=`$PYTHON-config --cflags`
366                 PYTHON_LIBS=`$PYTHON-config --libs`
367                 AC_SUBST(PYTHON_CFLAGS)
368                 AC_SUBST(PYTHON_LIBS)
369         elif test -x $PYTHON$PYTHON_VERSION-config; then
370                 PYTHON_CFLAGS=`$PYTHON$PYTHON_VERSION-config --cflags`
371                 PYTHON_LIBS=`$PYTHON$PYTHON_VERSION-config --libs`
372                 AC_SUBST(PYTHON_CFLAGS)
373                 AC_SUBST(PYTHON_LIBS)           
374         else
375                 have_python="no"
376                 echo "$PYTHON-config or $PYTHON$PYTHON_VERSION-config not found - disabling python"
377         fi
380 AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
382 dnl Disable packagekit support
383 dnl -----------------------------------
384 AC_ARG_ENABLE(packagekit,
385   [AC_HELP_STRING([--disable-packagekit],[build without PackageKit support])],,
386   [enable_packagekit=yes])
387 if test "x$enable_packagekit" != "xno"; then
388   AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable PackageKit installer])
391 dnl Setup Anjuta Library flags
392 dnl --------------------------
393 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)"\"'
394 LIBANJUTA_LIBS='$(top_builddir)/libanjuta/libanjuta-3.la'
395 AC_SUBST(LIBANJUTA_CFLAGS)
396 AC_SUBST(LIBANJUTA_LIBS)
398 dnl Setup FooCanvas Library flags
399 dnl --------------------------
400 LIBFOOCANVAS_CFLAGS='-I$(top_srcdir)'
401 LIBFOOCANVAS_LIBS='$(top_builddir)/libfoocanvas/libanjuta-foocanvas.la'
402 AC_SUBST(LIBFOOCANVAS_CFLAGS)
403 AC_SUBST(LIBFOOCANVAS_LIBS)
405 dnl Checks for Xft/XRender for foocanvas
407 AC_CHECK_LIB(Xrender, XRenderFindFormat,
408         [AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
409          AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])],
410         [AC_SUBST(RENDER_LIBS, "")],
411         [-lXext])
413 dnl Setup Plugin directories
414 dnl ------------------------
415 anjuta_plugin_dir='$(libdir)/anjuta'
416 anjuta_data_dir='$(datadir)/anjuta'
417 anjuta_ui_dir='$(datadir)/anjuta/ui'
418 anjuta_glade_dir='$(datadir)/anjuta/glade'
419 anjuta_image_dir='$(datadir)/pixmaps/anjuta'
420 AC_SUBST(anjuta_plugin_dir)
421 AC_SUBST(anjuta_data_dir)
422 AC_SUBST(anjuta_ui_dir)
423 AC_SUBST(anjuta_glade_dir)
424 AC_SUBST(anjuta_image_dir)
426 dnl ***************************************************************************
427 dnl Check for marshal and enum generators
428 dnl ***************************************************************************
429 GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
430 AC_SUBST(GLIB_GENMARSHAL)
431 GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
432 AC_SUBST(GLIB_MKENUMS)
434 dnl ***************************************************************************
435 dnl Internatinalization
436 dnl ***************************************************************************
437 IT_PROG_INTLTOOL([0.40.1])
439 AM_GNU_GETTEXT([external])
440 AM_GNU_GETTEXT_VERSION([0.17])
442 GETTEXT_PACKAGE=anjuta
443 AC_SUBST(GETTEXT_PACKAGE)
444 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
446 BISON_I18N
448 dnl ***************************************************************************
449 dnl Check for gtk-doc.
450 dnl ***************************************************************************
451 GTK_DOC_CHECK([1.4])
453 dnl ***************************************************************************
454 dnl User manual
455 dnl ***************************************************************************
456 YELP_HELP_INIT
458 dnl Define convenience macros
459 dnl -------------------------
460 dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
461 AC_DEFUN([CHECK_HEADER_DEFINE],
463         AC_MSG_CHECKING("if $1 is defined in $2")
464         AC_EGREP_CPP(yes,
465 [#include <$2>
466 #ifdef $1
467   yes
468 #endif
469 ], [
470         AC_MSG_RESULT(yes)
471         $3
472 ], [
473         AC_MSG_RESULT(no)
474         $4
475 ]) ])
477 dnl Checks for header files.
478 AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h stdint.h)
479 AC_CHECK_HEADERS(time.h types.h unistd.h)
480 AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
482 dnl Checks for typedefs, structures, and compiler characteristics.
484 AC_CANONICAL_HOST
485 CYGWIN=no
486 MINGW32=no
487 MACOSX=no
488 case $host_os in
489   *cygwin* ) CYGWIN=yes;;
490   *mingw32* ) MINGW32=yes;;
491   *darwin* ) MACOSX=yes;;
492 esac
495 dnl Check for bind in libsocket (needed on Solaris)
496 AC_CHECK_LIB(socket, bind)
498 dnl Check for function forkpty and related headers
499 AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
500 AC_CHECK_HEADERS(libutil.h util.h pty.h)
502 dnl Checks for library functions.
503 AC_CHECK_FUNCS(fnmatch)
504 AC_CHECK_FUNCS(strstr)
505 AC_CHECK_FUNCS(stricmp)
506 AC_CHECK_FUNCS(strnicmp)
507 AC_CHECK_FUNCS(getline)
509 dnl for libegg/egg-recent-model.c
510 AC_CHECK_DECLS([lockf])
511 AC_CHECK_FUNCS([lockf])
513 AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
515 dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
516 if test "$have_fgetpos" != yes ; then
517     CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
518         CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
519             AC_DEFINE(SEEK_SET, 0, [Seek set 0])))
522 AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
523 if test "$have_mkstemp" != yes ; then
524     AC_CHECK_FUNCS(chmod)
525     if test "$tmpdir_specified" = yes ; then
526         AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
527     fi
528 else
529     AC_MSG_CHECKING(directory to use for temporary files)
530     if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
531         then tmpdir=/tmp
532         else tmpdir="$enable_tmpdir"
533     fi
534     if test -d $tmpdir ; then
535         AC_MSG_RESULT($tmpdir)
536         AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [Directory for temporary files])
537     else
538         AC_MSG_WARN($tmpdir does not exist)
539     fi
542 dnl -----------------------------
543 dnl Checks for FreeBSD Build
544 dnl -----------------------------
545 AC_MSG_CHECKING(if building on FreeBSD)
547 if test `uname -s` = "FreeBSD" ; then
548         AC_MSG_RESULT(yes)
549         FREEBSD_BUILD=-DFREEBSD
550         AC_SUBST(FREEBSD_BUILD)
551         AC_PATH_PROG(GMAKE, gmake, no)
552         if test "x$GMAKE" = "xno"; then
553                 AC_MSG_ERROR(You need gmake installed to build Anjuta!)
554         fi
555 else
556         AC_MSG_RESULT(no)
557         GMAKE="make"
560 AC_SUBST(GMAKE)
562 dnl Checks for missing prototypes
563 dnl -----------------------------
564 AC_MSG_NOTICE([checking for missing prototypes...])
566 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))])
568 if test "$have_remove" = yes ; then
569     CHECK_PROTO(remove, stdio.h)
570 else
571     CHECK_PROTO(unlink, unistd.h)
573 CHECK_PROTO(malloc, stdlib.h)
574 CHECK_PROTO(getenv, stdlib.h)
575 CHECK_PROTO(stat,   sys/stat.h)
576 CHECK_PROTO(lstat,  sys/stat.h)
577 if test "$have_fgetpos" = yes ; then
578     CHECK_PROTO(fgetpos, stdio.h)
580 if test "$have_truncate" = yes ; then
581     CHECK_PROTO(truncate, unistd.h)
583 if test "$have_ftruncate" = yes ; then
584     CHECK_PROTO(ftruncate, unistd.h)
587 dnl  **********************************************************
588 dnl  check if we have svn libraries to build subversion plugin
589 dnl  (stolen from kdevelop ;-)
590 dnl  **********************************************************
592 AC_MSG_CHECKING(for Subversion svn-config)
593 AC_ARG_WITH(subversion-dir,
594                 AS_HELP_STRING([--with-subversion-dir=DIR],[Where Subversion is installed ]),
595                 [
596                                 SVNCONFIG="$withval/bin/svn-config"
597                 ])
599 if test -z "$SVNCONFIG"; then
600                 _SVNCONFIG="`svn-config --prefix 2> /dev/null`"
601                 if test -n "$_SVNCONFIG"; then
602                                 SVNCONFIG="$_SVNCONFIG/bin/svn-config"
603                 fi
606 AC_SUBST(SVNCONFIG)
607 if test -x "$SVNCONFIG"; then
608                 SVNLD="`$SVNCONFIG --ldflags 2> /dev/null`"
609                 SVN_LIB="`$SVNCONFIG --libs --cflags 2> /dev/null` -lsvn_client-1 -lsvn_subr-1"
610                 dnl ugly hack for subversion svn-config problems in 0.14.x, to be removed when svn-config is fixed
611                 SVN_INCLUDE="`$SVNCONFIG --includes 2> /dev/null` -I$_SVNCONFIG/include/subversion-1/"
612                 AC_MSG_RESULT(yes)
613 else
614                 AC_MSG_RESULT(not found)
616                 dnl just a fallback to debian's config so that it works for me :)
617                 AC_ARG_WITH(svn-include,
618                                                                 [[  --with-svn-include=DIR   Use the given path to the subversion headers.]],
619                                                                 [
620                                                                 if test "$withval" != "yes" -a "$withval" != ""; then
621                                                                                 SVN_INCLUDES=$withval
622                                                                 fi
623                                                                 ])
624                 if test -z "$SVN_INCLUDES"; then
625                         SVN_INCLUDES="/usr/local/include /usr/include"
626                 fi
627                 AC_MSG_CHECKING([for Subversion headers])
628                 SVN_INCLUDE=""
629                 for VALUE in $SVN_INCLUDES ; do
630                                 if test -f $VALUE/subversion-1/svn_types.h ; then
631                                                 SVN_INCLUDE=$VALUE/subversion-1
632                                                 break
633                                 fi
634                                 if test -f $VALUE/svn_types.h ; then
635                                                 SVN_INCLUDE=$VALUE
636                                                 break
637                                 fi
638                 done
639                 if test $SVN_INCLUDE ; then
640                                 AC_MSG_RESULT([found])
641                 else
642                                 AC_MSG_RESULT([not found])
643                 fi
644                 SVN_LIBS="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
645                 AC_ARG_WITH(svn-lib,
646                                                 [[  --with-svn-lib=DIR  Use the given path to the subversion libraries.]],
647                                                 [
648                                                         if test "$withval" != "yes" -a "$withval" != ""; then
649                                                                 SVN_LIBS=$withval
650                                                         fi
651                                                 ])
652                 AC_MSG_CHECKING([for Subversion libraries])
653                 SVN_LIB=""
654                 for VALUE in $SVN_LIBS ; do
655                                 if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
656                                                 SVN_LIB=$VALUE
657                                                 break
658                                 fi
659                 done
660                 if test $SVN_LIB ; then
661                                 AC_MSG_RESULT([found])
662                 else
663                                 AC_MSG_RESULT([not found])
664                 fi
667 dnl ******************************************************************
668 dnl Check for extra libs required by subversion.
669 dnl FIXME: This should actually be done by subversion and not by us.
670 dnl        See http://subversion.tigris.org/issues/show_bug.cgi?id=4435
671 dnl ******************************************************************
673 AC_ARG_ENABLE(plugin-subversion,
674   AS_HELP_STRING([--disable-plugin-subversion],[Disable subversion support in Anjuta.]),
675   [ if test "$enableval" = "no"; then
676         user_disabled_subversion=1
677     fi ],
678   [ user_disabled_subversion=0 ] )
680 AC_ARG_ENABLE(neon,
681         AS_HELP_STRING([--disable-neon],[Disable neon support in Subversion plugin]),
682         [ if test "$enableval" = "no"; then
683                 user_disabled_neon=1
684           fi ],
685         [ user_disabled_neon=0 ])
687 AC_ARG_ENABLE(serf,
688         AS_HELP_STRING([--disable-serf],[Disable serf support in Subversion plugin]),
689         [ if test "$enableval" = "no"; then
690                 user_disabled_serf=1
691           fi ],
692         [ user_disabled_serf=0 ])
694 AC_MSG_CHECKING(if subversion support is disabled)
695 if test "$user_disabled_subversion" = 1; then
696         AC_MSG_RESULT(yes)
697         SVN_INCLUDE=""
698         SVN_LIB=""
699 else
700         AC_MSG_RESULT(no)
703 if test -n "$SVN_INCLUDE" ; then
704         dnl ------------------------------------
705         dnl APR. Required by subversion (devel)
706         dnl ------------------------------------
707         have_atr=no
708         PKG_CHECK_MODULES(APR,                            \
709                 apr-1, have_apr=yes, have_apr=no)
710         if test x"$have_apr" = "xno"; then
711                 SVN_INCLUDE=""
712         fi
714         dnl -----------------------------------------
715         dnl APR util. Required by subversion (devel)
716         dnl------------------------------------------
717         have_atr_util=no
718         PKG_CHECK_MODULES(APR_UTILS,                            \
719                 apr-util-1, have_apr_util=yes, have_apr_util=no)
720         if test x"$have_apr_util" = "xno"; then
721                 SVN_INCLUDE=""
722         fi
724         dnl ----------------------------------------------------------
725         dnl NEON/SERF. Required by subversion (devel) for HTTP support
726         dnl-----------------------------------------------------------
727         # Subversion <= 1.7 relies on neon (recommended) or serf.
728         # Subversion 1.8 dropped neon support and uses serf to talk
729         # to HTTP servers.
730         #
731         # Subversion can be built without HTTP client support so neon and
732         # serf aren't hard requirements. But if present on the system
733         # it is reasonable to assume that Subversion is linked to them.
734         if test "$user_disabled_neon" = 0; then
735                 have_neon=no
736                 PKG_CHECK_MODULES(NEON,                            \
737                         neon, have_neon=yes, have_neon=no)
738         fi
739         if test "$user_disabled_serf" = 0; then
740                 have_serf=no
741                 PKG_CHECK_MODULES(SERF,                            \
742                         serf-1, have_serf=yes, have_serf=no)
743         fi
745         dnl Make sure our SVN version is high enough
746         dnl Eww, eww, eww, this is dirty
747         AC_MSG_CHECKING([for subversion >= $SUBVERSION_REQUIRED])
748         AC_LANG([C])
749         dnl Temporarily set CFLAGS so that include dirs are found
750         CFLAGS_TMP=$CFLAGS
751         CFLAGS="-I$SVN_INCLUDE $APR_CFLAGS"
752         AC_COMPILE_IFELSE(
753                 [AC_LANG_PROGRAM([[#include <svn_version.h>]],
754                         [[
755                                 #if (SVN_VER_MAJOR < $SVN_MAJOR) || (SVN_VER_MINOR < $SVN_MINOR) || (SVN_VER_PATCH < $SVN_PATCH)
756                                 #       error "Version too low"
757                                 #endif
758                         ]])], AC_MSG_RESULT(yes), have_svn_version=no)
759         if test x"$have_svn_version" = "xno"; then
760                 AC_MSG_RESULT(no)
761                 SVN_INCLUDE=""
762         fi
763         CFLAGS=$CFLAGS_TMP
766 dnl ------------------------------------------
767 dnl Finally prepare subversion build flags
768 dnl ------------------------------------------
770 if test -n "$SVN_INCLUDE" ; then
771         SVN_INCLUDE="-I$SVN_INCLUDE"
772         if test x != "x$SVN_LIB" ; then
773             SVN_LIB="-L$SVN_LIB $APR_LIBS $APR_UTILS_LIBS $NEON_LIBS $SERF_LIBS -lsvn_client-1 -lsvn_subr-1"
774         else
775             SVN_LIB="$APR_LIBS $APR_UTILS_LIBS $NEON_LIBS $SERF_LIBS -lsvn_client-1 -lsvn_subr-1"
776         fi
777         SVN_CFLAGS="$APR_CFLAGS $APR_UTILS_CFLAGS $NEON_CFLAGS $SERF_CFLAGS"
780 AM_CONDITIONAL(BUILD_SVN, [test -n "$SVN_INCLUDE"])
781 AC_SUBST(SVN_INCLUDE)
782 AC_SUBST(SVN_LIB)
783 AC_SUBST(SVN_CFLAGS)
785 dnl ------------------------------------------
786 dnl Symbol-db shared memory checks
787 dnl ------------------------------------------
789 SYMBOL_DB_SHM="/dev/shm"
790 user_specified_shm=0
791 AC_MSG_CHECKING(for symbol-db shared memory)
792 AC_ARG_WITH(symbol-db-shm,
793                 AS_HELP_STRING([--with-symbol-db-shm=DIR],[Where shared memory is placed ]),
794                 [
795                                 user_specified_shm=1
796                                 SYMBOL_DB_SHM="$withval"
797                 ])
798 if test "$user_specified_shm" = 1; then
799         AC_MSG_RESULT(yes)
800 else
801         AC_MSG_RESULT(no)
804 AC_SUBST(SYMBOL_DB_SHM)
806 dnl On Linux, need librt for shm_open/shm_unlink
807 bck_LIBS="$LIBS"
808 AC_SEARCH_LIBS(shm_open, rt, [SHM_LIBS="$LIBS"], [AC_MSG_ERROR([Failed to find library with shm_open()])])
809 AC_SUBST(SHM_LIBS)
810 LIBS="$bck_LIBS"
812 dnl Test using autotest
813 dnl -----------------------------
814 AC_CONFIG_TESTDIR(plugins/am-project/tests)
815 AM_MISSING_PROG([AUTOM4TE], [autom4te])
817 AC_CONFIG_FILES([
818 Makefile
819 po/Makefile.in
820 libanjuta/Makefile
821 libanjuta/tests/Makefile
822 libanjuta/interfaces/Makefile
823 libanjuta/libanjuta-3.0.pc
824 libanjuta/anjuta-version.h
825 src/Makefile
826 pixmaps/Makefile
827 pixmaps/hicolor/Makefile
828 pixmaps/hicolor/16x16/Makefile
829 pixmaps/hicolor/22x22/Makefile
830 pixmaps/hicolor/24x24/Makefile
831 pixmaps/hicolor/32x32/Makefile
832 pixmaps/hicolor/48x48/Makefile
833 pixmaps/hicolor/scalable/Makefile
834 pixmaps/hicolor/symbolic/Makefile
835 data/Makefile
836 data/welcome.txt
837 data/templates/Makefile
838 doc/anjuta.1
839 doc/anjuta-launcher.1
840 doc/Makefile
841 scripts/Makefile
842 launcher/Makefile
843 plugins/Makefile
844 plugins/class-gen/Makefile
845 plugins/class-gen/templates/Makefile
846 plugins/patch/Makefile
847 plugins/document-manager/Makefile
848 plugins/document-manager/images/Makefile
849 plugins/message-view/Makefile
850 plugins/gdb/Makefile
851 plugins/gdb/images/Makefile
852 plugins/debug-manager/Makefile
853 plugins/debug-manager/images/Makefile
854 plugins/devhelp/Makefile
855 plugins/devhelp/images/Makefile
856 plugins/glade/Makefile
857 plugins/glade/images/Makefile
858 plugins/js-debugger/Makefile
859 plugins/file-manager/Makefile
860 plugins/file-loader/Makefile
861 plugins/file-wizard/Makefile
862 plugins/build-basic-autotools/Makefile
863 plugins/project-manager/Makefile
864 plugins/symbol-db/benchmark/Makefile
865 plugins/symbol-db/benchmark/symbol-db/Makefile
866 plugins/symbol-db/benchmark/libgda/Makefile
867 plugins/symbol-db/benchmark/sqlite/Makefile
868 plugins/symbol-db/images/Makefile
869 plugins/symbol-db/Makefile
870 plugins/symbol-db/anjuta-tags/Makefile
871 plugins/project-wizard/Makefile
872 plugins/snippets-manager/Makefile
873 plugins/cvs-plugin/Makefile
874 plugins/subversion/Makefile
875 plugins/git/Makefile
876 plugins/git/images/Makefile
877 plugins/git/tests/Makefile
878 plugins/sourceview/Makefile
879 plugins/terminal/Makefile
880 plugins/tools/Makefile
881 plugins/tools/scripts/Makefile
882 plugins/language-manager/Makefile
883 plugins/project-import/Makefile
884 plugins/project-wizard/templates/Makefile
885 plugins/project-wizard/templates/mkfile/Makefile
886 plugins/project-wizard/templates/mkfile/src/Makefile
887 plugins/project-wizard/templates/mkfile/po/Makefile
888 plugins/project-wizard/templates/minimal/Makefile
889 plugins/project-wizard/templates/js_minimal/Makefile
890 plugins/project-wizard/templates/js_minimal/src/Makefile
891 plugins/project-wizard/templates/terminal/Makefile
892 plugins/project-wizard/templates/terminal/src/Makefile
893 plugins/project-wizard/templates/terminal/po/Makefile
894 plugins/project-wizard/templates/cpp/Makefile
895 plugins/project-wizard/templates/cpp/src/Makefile
896 plugins/project-wizard/templates/cpp/po/Makefile
897 plugins/project-wizard/templates/gtk/Makefile
898 plugins/project-wizard/templates/gtk/src/Makefile
899 plugins/project-wizard/templates/gtk/po/Makefile
900 plugins/project-wizard/templates/gtkapplication/Makefile
901 plugins/project-wizard/templates/gtkapplication/src/Makefile
902 plugins/project-wizard/templates/gtkapplication/po/Makefile
903 plugins/project-wizard/templates/anjuta-plugin/Makefile
904 plugins/project-wizard/templates/anjuta-plugin/src/Makefile
905 plugins/project-wizard/templates/anjuta-plugin/po/Makefile
906 plugins/project-wizard/templates/gtkmm/Makefile
907 plugins/project-wizard/templates/gtkmm/src/Makefile
908 plugins/project-wizard/templates/gtkmm/po/Makefile
909 plugins/project-wizard/templates/gcj/Makefile
910 plugins/project-wizard/templates/gcj/src/Makefile
911 plugins/project-wizard/templates/java/Makefile
912 plugins/project-wizard/templates/java/src/Makefile
913 plugins/project-wizard/templates/java/po/Makefile
914 plugins/project-wizard/templates/python/Makefile
915 plugins/project-wizard/templates/python/src/Makefile
916 plugins/project-wizard/templates/python/po/Makefile
917 plugins/project-wizard/templates/pygtk/Makefile
918 plugins/project-wizard/templates/pygtk/src/Makefile
919 plugins/project-wizard/templates/pygtk/po/Makefile
920 plugins/project-wizard/templates/vala-gtk/Makefile
921 plugins/project-wizard/templates/vala-gtk/src/Makefile
922 plugins/project-wizard/templates/wxwin/Makefile
923 plugins/project-wizard/templates/wxwin/src/Makefile
924 plugins/project-wizard/templates/wxwin/po/Makefile
925 plugins/project-wizard/templates/xlib/Makefile
926 plugins/project-wizard/templates/xlib/src/Makefile
927 plugins/project-wizard/templates/xlib/po/Makefile
928 plugins/project-wizard/templates/xlib-dock/Makefile
929 plugins/project-wizard/templates/xlib-dock/src/Makefile
930 plugins/project-wizard/templates/xlib-dock/po/Makefile
931 plugins/project-wizard/templates/sdl/Makefile
932 plugins/project-wizard/templates/sdl/src/Makefile
933 plugins/project-wizard/templates/sdl/po/Makefile
934 plugins/project-wizard/templates/library/Makefile
935 plugins/project-wizard/templates/library/src/Makefile
936 plugins/project-wizard/templates/library/po/Makefile
937 plugins/project-wizard/templates/directory/Makefile
938 plugins/project-wizard/templates/m4/Makefile
939 plugins/project-wizard/templates/gnome-shell-extension/Makefile
940 plugins/project-wizard/templates/gnome-shell-extension/src/Makefile
941 plugins/project-wizard/templates/vala-library/Makefile
942 plugins/project-wizard/templates/vala-library/src/Makefile
943 plugins/project-wizard/templates/vala-library/po/Makefile
944 plugins/am-project/Makefile
945 plugins/am-project/tests/atlocal
946 plugins/am-project/tests/Makefile
947 plugins/mk-project/Makefile
948 plugins/dir-project/Makefile
949 plugins/language-support-cpp-java/Makefile
950 plugins/run-program/Makefile
951 plugins/starter/Makefile
952 plugins/indentation-c-style/Makefile
953 plugins/indentation-python-style/Makefile
954 plugins/language-support-js/Makefile
955 plugins/language-support-vala/Makefile
956 plugins/language-support-python/Makefile
957 plugins/parser-cxx/Makefile
958 plugins/parser-cxx/cxxparser/Makefile
959 plugins/python-loader/Makefile
960 plugins/jhbuild/Makefile
961 plugins/quick-open/Makefile
962 anjuta.desktop.in
963 manuals/Makefile
964 manuals/reference/Makefile
965 manuals/reference/libanjuta/Makefile
966 manuals/reference/libanjuta/version.xml
967 manuals/anjuta-manual/Makefile
968 manuals/anjuta-faqs/Makefile
969 manuals/anjuta-build-tutorial/Makefile
970 mime/Makefile
972 AC_OUTPUT
973 echo " "
974 echo "-------------------------------------------------------------------"
975 echo "Conditionally built plugins:"
976 echo "-------------------------------------------------------------------"
977 if [ test -n "$SVN_INCLUDE" ]; then
978         echo "Building subversion plugin: ............................YES"
979 else
980         echo "Building subversion plugin: ............................NO"
981                 echo "        Requires apr (>= 0.9.4); http://subversion.org"
982                 echo "        Requires apr-util (>= 0.9.4); http://subversion.org"
983                 echo "        Requires neon (>= 0.28.2); http://subversion.org"
984                 echo "        Requires subversion (>= 1.5); http://subversion.org"
987 if [ test x$gladeui_found = xyes ]; then
988        echo "Building glade plugin: .................................YES"
989 else
990        echo "Building glade plugin: .................................NO"
991        echo "        Requires glade-3 (>= $GLADEUI_REQUIRED)"
994 if [ test x$devhelp_enabled = xyes ]; then
995        echo "Building devhelp plugin: ...............................YES"
996 else
997        echo "Building devhelp plugin: ...............................NO"
998        echo "        Requires libdevhelp-3.0 (>= $LIBDEVHELP_REQUIRED)"
1001 if [ test x$terminal_enabled = xyes ]; then
1002        echo "Building terminal plugin: ..............................YES"
1003 else
1004        echo "Building terminal plugin: ..............................NO"
1005        echo "        Requires vte-2.91 (>= $VTE_REQUIRED)"
1008 if [ test x$enable_vala = xyes ]; then
1009         echo "Building Vala support: .................................YES"
1010 else
1011         echo "Building Vala support: .................................NO"
1012         echo "        Requires libvala (>= $VALA_REQUIRED)"
1014 if [ test x$have_python = xyes]; then
1015         echo "Building python plugin loaeder: ........................YES"
1016 else
1017         echo "Building python plugin loaeder: ........................NO"
1018         echo "        Requires python"
1020 echo "-------------------------------------------------------------------"
1021 echo "AM_CFLAGS = $AM_CFLAGS"
1022 echo "AM_CXXFLAGS = $AM_CXXFLAGS"