1 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(geany, 0.21)
6 AC_CONFIG_MACRO_DIR([m4])
8 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
10 AM_CONFIG_HEADER(config.h)
19 # check for C++ compiler explicitly and fail if none is found, do this check
20 # after AC_PROG_CXX has set the CXX environment variable
21 which $CXX >/dev/null 2>&1
22 if test "x$?" != "x0"; then
23 AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
33 LIBTOOL="$LIBTOOL --silent"
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.
45 # Checks for library functions.
46 AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp strerror strstr])
51 # get svn revision (try GIT first, then check for SVN)
53 GIT=`which git 2>/dev/null`
54 if test -d ".git" -a "x${GIT}" != "x" -a -x "${GIT}"
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`
64 if test "x${REVISION}" = "xr0"
66 SVN=`which svn 2>/dev/null`
67 if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}"
69 REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
72 if test "x${REVISION}" != "xr0"
74 # force debug mode for a SVN working copy
75 CFLAGS="-g -DGEANY_DEBUG $CFLAGS"
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
92 AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
93 if test -e /proc/self/maps; then
97 AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
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
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'
116 AC_MSG_NOTICE(Binary relocation support will be disabled.)
125 elif test "$enable_binreloc" = "no"; then
128 AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
131 if test "$enable_binreloc" = "yes"; then
132 AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
136 # GTK/GLib/GIO checks
137 gtk_modules="gtk+-2.0 >= 2.12 glib-2.0 >= 2.16 gio-2.0 >= 2.16"
138 PKG_CHECK_MODULES(GTK, [$gtk_modules])
141 # currently define it, but we will be able to drop the checks now we hard-depend on it
142 AC_DEFINE(HAVE_GIO, 1, [Whether GIO is available])
144 gthread_modules="gthread-2.0"
145 PKG_CHECK_MODULES(GTHREAD, [$gthread_modules])
146 AC_SUBST(GTHREAD_CFLAGS)
147 AC_SUBST(GTHREAD_LIBS)
149 # --disable-deprecated switch for GTK2 purification
150 AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ],
151 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
154 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support [default=no]])], , enable_plugins=yes)
156 if test "x$enable_plugins" = "xyes" ; then
157 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled.])
158 AM_CONDITIONAL(PLUGINS, true)
160 AM_CONDITIONAL(PLUGINS, false)
163 # Use included GNU regex library
164 AC_ARG_ENABLE(gnu-regex, [AC_HELP_STRING([--enable-gnu-regex], [compile with included GNU regex library [default=no]])], , enable_gnu_regex=no)
166 # auto-enable included regex if necessary
167 AC_CHECK_FUNCS([regcomp], [], [enable_gnu_regex="yes"])
169 if test "x$enable_gnu_regex" = "xyes" ; then
170 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Define if included GNU regex code should be used.])
171 AC_DEFINE(HAVE_REGCOMP, 1, [Define if you have the 'regcomp' function.])
172 AM_CONDITIONAL(USE_INCLUDED_REGEX, true)
174 AM_CONDITIONAL(USE_INCLUDED_REGEX, false)
179 AC_CHECK_LIB(iberty, fnmatch, [], [
180 AC_MSG_ERROR([fnmatch does not present in libiberty. You need to update it, read http://www.geany.org/Support/CrossCompile for details.])
182 AC_DEFINE_UNQUOTED([WIN32], 1, [we are cross compiling for WIN32])
185 AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
187 AM_CONDITIONAL(MINGW, true)
190 AM_CONDITIONAL(MINGW, false)
194 dnl skip check if already decided
195 if test "x$want_socket" = "x"; then
197 AC_ARG_ENABLE(socket, AC_HELP_STRING([--enable-socket],[enable if you want to detect a running instance [[default=yes]]]),
198 [want_socket="$enableval"], [want_socket="yes"])
200 if test "x$want_socket" = "xyes"; then
201 AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
202 # this should bring in libsocket on Solaris:
203 AC_SEARCH_LIBS([connect],[socket],[],[],[])
207 dnl skip check if already decided
208 if test "x$want_vte" = "x"; then
210 AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],
211 [enable if you want virtual terminal support [[default=yes]]]),
212 [want_vte="$enableval"], [want_vte="yes"])
213 if test "x$want_vte" = "xyes"; then
214 AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])
216 AC_ARG_WITH(vte-module-path, AC_HELP_STRING([--with-vte-module-path=PATH],
217 [Path to a loadable libvte [[default=None]]]), [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH],
218 ["$withval"], [Path to a loadable libvte])])
221 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
224 # just for a laugh (it has absolutely no effect)
225 AC_ARG_ENABLE(the-force, AC_HELP_STRING([--enable-the-force],
226 [enable if you are Luke Skywalker and the force is with you [[default=no]]]), [be_luke="$enableval"], [be_luke="no"])
227 AC_MSG_CHECKING([whether the force is with you])
228 if test "x$be_luke" = "xyes"; then
235 GETTEXT_PACKAGE=geany
236 AC_SUBST(GETTEXT_PACKAGE)
237 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
239 if test -n "${LINGUAS}"
241 ALL_LINGUAS="${LINGUAS}"
243 if test -z "$conf_dir" ; then
246 ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $1 }'`
250 # workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845)
251 if test "x$MSGFMT" = "xno"; then
252 AC_MSG_ERROR([msgfmt not found. Please install the gettext package.])
257 if test "x${datadir}" = 'x${prefix}/share' -o "x${datarootdir}" = 'x${prefix}/share'; then
258 if test "x${prefix}" = "xNONE"; then
259 prefix=${ac_default_prefix}
263 # Set ${docdir} if it is empty
264 if test -z "${docdir}"; then
265 docdir='${datadir}/doc/${PACKAGE}'
269 GEANY_DATA_DIR=`eval echo ${datarootdir}/geany`
270 AC_SUBST(GEANY_DATA_DIR)
272 # intltool hack to define install_sh on Debian/Ubuntu systems
273 if test "x$install_sh" = "x"; then
274 install_sh="`pwd`/install-sh"
283 icons/scalable/Makefile
285 tagmanager/include/Makefile
286 tagmanager/mio/Makefile
288 scintilla/include/Makefile
299 echo "----------------------------------------"
300 echo "Install Geany in : ${prefix}"
301 if test "x${build}" != "x" -a "x${target}" != "x"
303 echo "Building Geany on : ${build}"
304 echo "Building Geany for : ${target}"
306 echo "Using GTK version : ${GTK_VERSION}"
307 echo "Build with plugin support : ${enable_plugins}"
308 echo "Use virtual terminal support : ${want_vte}"
309 echo "Use (UNIX domain) socket support : ${want_socket}"
310 if test "x$enable_gnu_regex" = "xyes" ; then
311 echo "GNU regex library : built-in"
313 echo "GNU regex library : system"
316 if test "${REVISION}" != "-1"
318 echo "Compiling Subversion revision : ${REVISION}"
321 echo "Configuration is done OK."