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