Rename nestingLevelsGetNth() to nestingLevelsGetNthFromRoot()
[geany-mirror.git] / configure.ac
blobbaa0e38e998669e639dc3064f9e3af8d00d7d73a
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4 AC_INIT([Geany], [1.38],
5                 [https://github.com/geany/geany/issues])
6 AC_CONFIG_SRCDIR([src/geany.h])
7 AC_CONFIG_AUX_DIR([build-aux])
8 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE([1.11 -Wall parallel-tests subdir-objects])
10 AC_CONFIG_HEADERS([config.h])
12 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
14 GEANY_PREFIX
15 GEANY_DOCDIR
17 GEANY_STATUS_ADD([Install Geany in], [${prefix}])
18 if test -n "${build}" -a -n "${target}"; then
19         GEANY_STATUS_ADD([Building Geany on], [${build}])
20         GEANY_STATUS_ADD([Building Geany for], [${target}])
23 # why do we use this?
24 AC_USE_SYSTEM_EXTENSIONS
26 m4_ifdef([AM_PROG_AR],[AM_PROG_AR])
27 LT_INIT([disable-static])
28 AC_PROG_CC
29 AC_PROG_CC_C99
30 AM_PROG_CC_C_O
32 AC_PROG_CXX
33 GEANY_PROG_CXX
34 AX_CXX_COMPILE_STDCXX_11
36 AC_PROG_INSTALL
37 AC_PROG_LN_S
39 # autoscan start
41 # Checks for header files.
42 AC_CHECK_HEADERS([fcntl.h glob.h stdlib.h sys/time.h errno.h limits.h])
44 # Checks for dependencies needed by ctags
45 AC_CHECK_HEADERS([fnmatch.h direct.h io.h sys/dir.h])
46 AC_DEFINE([HAVE_STDBOOL_H], [1], [whether or not to use <stdbool.h>.])
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_TYPE_OFF_T
50 AC_TYPE_SIZE_T
51 AC_STRUCT_TM
53 # Checks for library functions.
54 AC_CHECK_FUNCS([fgetpos fnmatch mkstemp strerror strstr realpath])
56 # Function checks for u-ctags
57 AC_CHECK_FUNCS([strcasecmp stricmp], [break])
58 AC_CHECK_FUNCS([strncasecmp strnicmp], [break])
59 AC_CHECK_FUNCS([truncate ftruncate chsize], [break])
60 # non-functions checks for u-ctags.  Not that we really need those as we don't
61 # use u-ctags's main, but the corresponding macros have to be defined to
62 # something, so simply perform the actual checks.
63 AC_CHECK_DECLS([__environ],,,[[#include <unistd.h>]])
64 AC_CHECK_DECLS([_NSGetEnviron],,,[[#include <crt_externs.h>]])
66 # autoscan end
69 # check for VCS revision
70 GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy
71                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
73 # GTK version check
74 AC_ARG_ENABLE([gtk2],
75                 [AS_HELP_STRING([--enable-gtk2],
76                                                 [compile against deprecated GTK2 [default=no]])],
77                 [enable_gtk2=$enableval],
78                 [enable_gtk2=no])
80 gtk2_package=gtk+-2.0
81 gtk2_min_version=2.24
82 gtk3_package=gtk+-3.0
83 gtk3_min_version=3.0
85 AS_IF([test "x$enable_gtk2" = "xyes"],
86         [gtk_package=$gtk2_package
87          gtk_min_version=$gtk2_min_version],
88         [gtk_package=$gtk3_package
89          gtk_min_version=$gtk3_min_version])
91 AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "x$gtk3_package"])
93 # GTK/GLib/GIO checks
94 gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.32"
95 gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0"
96 PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
97 AC_SUBST([DEPENDENCIES], [$gtk_modules])
98 AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"])
99 dnl Disable all GTK deprecations on 3.x so long as we want to keep 2.x support and only require 3.0.
100 dnl No need on 2.x as we target the latest version.
101 AM_COND_IF([GTK3], [AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])])
102 AC_SUBST([GTK_CFLAGS])
103 AC_SUBST([GTK_LIBS])
104 GTK_VERSION=`$PKG_CONFIG --modversion $gtk_package`
105 AC_SUBST([GTK_VERSION])
106 GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
107 # GTHREAD checks
108 gthread_modules="gthread-2.0"
109 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
110 AC_SUBST([GTHREAD_CFLAGS])
111 AC_SUBST([GTHREAD_LIBS])
113 # --disable-deprecated switch for GTK purification
114 AC_ARG_ENABLE([deprecated],
115                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
116                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
117                 [])
120 # Check for binary relocation support
121 GEANY_CHECK_BINRELOC
122 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
123 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
124 # Plugins support
125 GEANY_CHECK_PLUGINS
126 # check for mingw specific settings
127 GEANY_CHECK_MINGW
129 GEANY_CHECK_SOCKET
130 GEANY_CHECK_VTE
131 GEANY_CHECK_MAC_INTEGRATION
132 GEANY_CHECK_THE_FORCE dnl hehe
134 # i18n
135 GEANY_I18N
137 # double eval since datarootdir is usually defined as ${prefix}/share
138 AM_COND_IF([MINGW],
139   [pkgdatadir='${prefix}/data'],
140   [pkgdatadir='${datarootdir}/geany'])
141 AC_SUBST([GEANY_DATA_DIR], [$(eval echo $(eval echo $pkgdatadir))])
142 AC_SUBST([pkgdatadir])
144 # The default Python command.  On Windows, use the `py` launcher by default
145 AC_ARG_WITH([python-command],
146                         [AS_HELP_STRING([--with-python-command],
147                                                         [the default Python command [defaults to "py" on Windows and "python" otherwise]])],
148                         [with_python_command=$withval],
149                         [with_python_command=auto])
150 AS_IF([test "x$with_python_command" = xauto],
151           [AM_COND_IF([MINGW], [with_python_command=py], [with_python_command=python])])
152 AC_SUBST([PYTHON_COMMAND], [$with_python_command])
154 # Documentation tools
155 GEANY_CHECK_DOCUTILS
156 GEANY_CHECK_DOXYGEN
157 GEANY_CHECK_GTKDOC_HEADER
159 # libgeany
160 GEANY_LIB_INIT
162 # Output
163 AC_CONFIG_FILES([
164                 Makefile
165                 icons/Makefile
166                 icons/16x16/Makefile
167                 icons/24x24/Makefile
168                 icons/32x32/Makefile
169                 icons/48x48/Makefile
170                 icons/scalable/Makefile
171                 icons/tango/Makefile
172                 icons/tango/16x16/Makefile
173                 icons/tango/24x24/Makefile
174                 icons/tango/32x32/Makefile
175                 icons/tango/48x48/Makefile
176                 icons/tango/scalable/Makefile
177                 ctags/Makefile
178                 scintilla/Makefile
179                 scintilla/include/Makefile
180                 src/Makefile
181                 src/tagmanager/Makefile
182                 plugins/Makefile
183                 po/Makefile.in
184                 data/Makefile
185                 data/filedefs/filetypes.python
186                 doc/Makefile
187                 doc/geany.1
188                 geany.pc
189                 geany.nsi
190                 doc/Doxyfile
191                 tests/Makefile
192                 tests/ctags/Makefile
194 AC_OUTPUT
196 # Summary
197 GEANY_STATUS_OUTPUT
198 echo ""
199 echo "Configuration is done OK."
200 echo ""