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