Add editor_goto_pos() to the plugin API.
[geany-mirror.git] / configure.ac
blobca3d117b0ebc1354048c792fabb766263cfa50e2
1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id$
4 AC_INIT(configure.ac)
5 AM_INIT_AUTOMAKE(geany, 0.20)
7 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
9 AM_CONFIG_HEADER(config.h)
11 AC_GNU_SOURCE
12 AC_AIX
13 AC_MINIX
15 AC_PROG_CC
17 AC_PROG_CXX
18 # check for C++ compiler explicitly and fail if none is found, do this check
19 # after AC_PROG_CXX has set the CXX environment variable
20 which $CXX >/dev/null 2>&1
21 if test "x$?" != "x0"; then
22         AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
25 #AC_PROG_RANLIB
26 AC_PROG_INSTALL
27 AC_PROG_LN_S
28 AC_PROG_INTLTOOL
30 # for plugins
31 AC_DISABLE_STATIC
32 AM_PROG_LIBTOOL
33 LIBTOOL="$LIBTOOL --silent"
35 # autoscan start
37 # Checks for header files.
38 AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h regex.h stdlib.h sys/time.h])
40 # Checks for typedefs, structures, and compiler characteristics.
41 AC_TYPE_OFF_T
42 AC_TYPE_SIZE_T
43 AC_STRUCT_TM
45 # Checks for library functions.
46 AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp regcomp strerror strstr])
48 # autoscan end
51 # get svn revision (try GIT first, then check for SVN)
52 REVISION="r0"
53 GIT=`which git 2>/dev/null`
54 if test -d ".git" -a "x${GIT}" != "x" -a -x "${GIT}"
55 then
56         # check for git-svn repo first - find-rev (v1.5.4.1) doesn't always fail with git-only repo
57         git svn info &>/dev/null
58         if test "x$?" == "x0"; then
59                 REVISION=r`git svn find-rev origin/trunk 2>/dev/null ||
60                                 git svn find-rev trunk 2>/dev/null || git svn find-rev HEAD 2>/dev/null ||
61                                 git svn find-rev master 2>/dev/null || echo 0`
62         fi
64 if test "x${REVISION}" = "xr0"
65 then
66         SVN=`which svn 2>/dev/null`
67         if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}"
68         then
69                 REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
70         fi
72 if test "x${REVISION}" != "xr0"
73 then
74         # force debug mode for a SVN working copy
75         CFLAGS="-g -DGEANY_DEBUG $CFLAGS"
76 else
77         REVISION="-1"
79 AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])
82 dnl Check for binary relocation support
83 dnl taken from Inkscape (Hongli Lai <h.lai@chello.nl>)
85 AC_ARG_ENABLE(binreloc,
86        [  --enable-binreloc       compile with binary relocation support],
87        enable_binreloc=$enableval,enable_binreloc=no)
89 AC_MSG_CHECKING(whether binary relocation support should be enabled)
90 if test "$enable_binreloc" = "yes"; then
91        AC_MSG_RESULT(yes)
92        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
93        if test -e /proc/self/maps; then
94                AC_MSG_RESULT(yes)
95        else
96                AC_MSG_RESULT(no)
97                AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
98                enable_binreloc="no"
99        fi
101 elif test "$enable_binreloc" = "auto"; then
102        AC_MSG_RESULT(yes when available)
103        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
104        if test -e /proc/self/maps; then
105                AC_MSG_RESULT(yes)
106                enable_binreloc=yes
108                AC_MSG_CHECKING(whether everything is installed to the same prefix)
109                if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
110                        "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
111                        "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
112                then
113                        AC_MSG_RESULT(yes)
114                else
115                        AC_MSG_RESULT(no)
116                        AC_MSG_NOTICE(Binary relocation support will be disabled.)
117                        enable_binreloc=no
118                fi
120        else
121                AC_MSG_RESULT(no)
122                enable_binreloc=no
123        fi
125 elif test "$enable_binreloc" = "no"; then
126        AC_MSG_RESULT(no)
127 else
128        AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
129        enable_binreloc=no
131 if test "$enable_binreloc" = "yes"; then
132    AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
136 # GTK checks
137 gtk_modules="gtk+-2.0 >= 2.8.0"
138 PKG_CHECK_MODULES(GTK, [$gtk_modules])
139 AC_SUBST(GTK_CFLAGS)
140 AC_SUBST(GTK_LIBS)
141 # GIO checks
142 gio_modules="gio-2.0 >= 2.16"
143 PKG_CHECK_MODULES(GIO, [$gio_modules], have_gio=1, have_gio=0)
144 AC_SUBST(GIO_CFLAGS)
145 AC_SUBST(GIO_LIBS)
146 if test $have_gio = 1 ; then
147     AC_DEFINE(HAVE_GIO, 1, [Whether GIO is available])
150 # --disable-deprecated switch for GTK2 purification
151 AC_ARG_ENABLE(deprecated, [  --disable-deprecated    Disable deprecated GTK functions. ],
152                           [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
154 # Plugins support
155 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support  [default=no]])], , enable_plugins=yes)
157 if test "x$enable_plugins" = "xyes" ; then
158         AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled.])
159         AM_CONDITIONAL(PLUGINS, true)
160 else
161         AM_CONDITIONAL(PLUGINS, false)
164 # Use included GNU regex library
165 AC_ARG_ENABLE(gnu-regex, [AC_HELP_STRING([--enable-gnu-regex], [compile with included GNU regex library  [default=no]])], , enable_gnu_regex=no)
167 if test "x$enable_gnu_regex" = "xyes" ; then
168         AC_DEFINE(USE_INCLUDED_REGEX, 1, [Define if included GNU regex code should be used.])
169         AC_DEFINE(HAVE_REGCOMP, 1, [Define if you have the 'regcomp' function.])
170         AM_CONDITIONAL(USE_INCLUDED_REGEX, true)
171 else
172         AM_CONDITIONAL(USE_INCLUDED_REGEX, false)
175 case "${host}" in
176     *mingw*)
177         AC_CHECK_LIB(iberty, fnmatch, [], [
178                 AC_MSG_ERROR([fnmatch does not present in libiberty. You need to update it, read http://www.geany.org/Support/CrossCompile for details.])
179                 ])
180         AC_DEFINE_UNQUOTED([WIN32], 1, [we are cross compiling for WIN32])
181         want_vte="no"
182         want_socket="yes"
183         AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
184         AC_EXEEXT
185         AM_CONDITIONAL(MINGW, true)
186         ;;
187     *)
188         AM_CONDITIONAL(MINGW, false)
189         ;;
190 esac
192 dnl skip check if already decided
193 if test "x$want_socket" = "x"; then
194     # socket support
195     AC_ARG_ENABLE(socket, AC_HELP_STRING([--enable-socket],[enable if you want to detect a running instance [[default=yes]]]),
196      [want_socket="$enableval"], [want_socket="yes"])
198     if test "x$want_socket" = "xyes"; then
199         AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
200         # this should bring in libsocket on Solaris:
201         AC_SEARCH_LIBS([connect],[socket],[],[],[])
202     fi
205 dnl skip check if already decided
206 if test "x$want_vte" = "x"; then
207     # VTE support
208     AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],
209      [enable if you want virtual terminal support [[default=yes]]]),
210      [want_vte="$enableval"], [want_vte="yes"])
211     if test "x$want_vte" = "xyes"; then
212         AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])
213     fi
214     AC_ARG_WITH(vte-module-path, AC_HELP_STRING([--with-vte-module-path=PATH],
215      [Path to a loadable libvte [[default=None]]]), [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH],
216      ["$withval"], [Path to a loadable libvte])])
219 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
222 # GTK 2.10 printing support
223 $PKG_CONFIG --exists 'gtk+-2.0 >= 2.10.0'
224 if test "x$?" = "x0" ; then
225         enable_printing="yes"
226 else
227         enable_printing="no (GTK >= 2.10 necessary)"
231 # just for a laugh (it has absolutely no effect)
232 AC_ARG_ENABLE(the-force, AC_HELP_STRING([--enable-the-force],
233      [enable if you are Luke Skywalker and the force is with you [[default=no]]]), [be_luke="$enableval"], [be_luke="no"])
234 AC_MSG_CHECKING([whether the force is with you])
235 if test "x$be_luke" = "xyes"; then
236         AC_MSG_RESULT([yes])
237 else
238         AC_MSG_RESULT([no])
241 # i18n
242 GETTEXT_PACKAGE=geany
243 AC_SUBST(GETTEXT_PACKAGE)
244 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
246 if test -n "${LINGUAS}"
247 then
248         ALL_LINGUAS="${LINGUAS}"
249 else
250         if test -z "$conf_dir" ; then
251                 conf_dir="."
252         fi
253         ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $1 }'`
256 AM_GLIB_GNU_GETTEXT
257 # workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845)
258 if test "x$MSGFMT" = "xno"; then
259         AC_MSG_ERROR([msgfmt not found. Please install the gettext package.])
263 # Set ${datadir}
264 if test "x${datadir}" = 'x${prefix}/share' -o "x${datarootdir}" = 'x${prefix}/share'; then
265         if test "x${prefix}" = "xNONE"; then
266                 prefix=${ac_default_prefix}
267         fi
270 # Set ${docdir} if it is empty
271 if test -z "${docdir}"; then
272         docdir='${datadir}/doc/${PACKAGE}'
273         AC_SUBST(docdir)
276 GEANY_DATA_DIR=`eval echo ${datarootdir}/geany`
277 AC_SUBST(GEANY_DATA_DIR)
279 # intltool hack to define install_sh on Debian/Ubuntu systems
280 if test "x$install_sh" = "x"; then
281         install_sh="`pwd`/install-sh"
282         AC_SUBST(install_sh)
285 AC_OUTPUT([
286 Makefile
287 icons/Makefile
288 icons/16x16/Makefile
289 icons/48x48/Makefile
290 icons/scalable/Makefile
291 tagmanager/Makefile
292 tagmanager/include/Makefile
293 scintilla/Makefile
294 scintilla/include/Makefile
295 src/Makefile
296 plugins/Makefile
297 po/Makefile.in
298 doc/Makefile
299 doc/geany.1
300 geany.spec
301 geany.pc
302 doc/Doxyfile
305 echo "----------------------------------------"
306 echo "Install Geany in                   : ${prefix}"
307 if test "x${build}" != "x" -a "x${target}" != "x"
308 then
309         echo "Building Geany on                  : ${build}"
310         echo "Building Geany for                 : ${target}"
312 echo "Using GTK version                  : ${GTK_VERSION}"
313 echo "Build with GTK printing support    : ${enable_printing}"
314 echo "Build with plugin support          : ${enable_plugins}"
315 echo "Use virtual terminal support       : ${want_vte}"
316 echo "Use (UNIX domain) socket support   : ${want_socket}"
317 if test "${REVISION}" != "-1"
318 then
319         echo "Compiling Subversion revision      : ${REVISION}"
321 echo ""
322 echo "Configuration is done OK."
323 echo ""