Update C++ compiler check to require C++17 (#2862)
[geany-mirror.git] / configure.ac
blobb92d9fc5b9aac3c2d95aef4c2f6673fbd8abe58f
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_17
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>.])
47 AC_CHECK_FUNC([regcomp],
48                 [have_regcomp=yes],
49                 [have_regcomp=no
50                  dnl various stuff for ctags/gnu_regex/
51                  AC_CHECK_HEADERS([langinfo.h locale.h libintl.h wctype.h wchar.h])
52                  AC_CHECK_FUNCS([memcpy isblank wcrtomb mbrtowc wcscoll])
53                  AC_FUNC_ALLOCA])
54 AM_CONDITIONAL([USE_BUNDLED_REGEX], [test "xno" = "x$have_regcomp"])
55 AC_CHECK_FUNC([fnmatch], [have_fnmatch=yes], [have_fnmatch=no])
56 AM_CONDITIONAL([USE_BUNDLED_FNMATCH], [test "xno" = "x$have_fnmatch"])
58 # Checks for typedefs, structures, and compiler characteristics.
59 AC_TYPE_OFF_T
60 AC_TYPE_SIZE_T
61 AC_STRUCT_TM
63 # Checks for library functions.
64 AC_CHECK_FUNCS([realpath])
66 # Function checks for u-ctags
67 AC_CHECK_FUNCS([strerror strstr asprintf])
68 AC_CHECK_FUNCS([mkstemp tempnam], [break])
69 AC_CHECK_FUNCS([strcasecmp stricmp], [break])
70 AC_CHECK_FUNCS([strncasecmp strnicmp], [break])
71 AC_CHECK_FUNCS([truncate ftruncate chsize], [break])
72 # non-functions checks for u-ctags.  Not that we really need those as we don't
73 # use u-ctags's main, but the corresponding macros have to be defined to
74 # something, so simply perform the actual checks.
75 AC_CHECK_DECLS([__environ],,,[[#include <unistd.h>]])
76 AC_CHECK_DECLS([_NSGetEnviron],,,[[#include <crt_externs.h>]])
78 # autoscan end
81 # check for VCS revision
82 GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy
83                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
85 # GTK/GLib/GIO checks
86 gtk_modules="gtk+-3.0 >= 3.0 glib-2.0 >= 2.32"
87 gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0"
88 PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
89 AC_SUBST([DEPENDENCIES], [$gtk_modules])
90 AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"])
91 dnl Disable all GTK deprecations
92 AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])
93 AC_SUBST([GTK_CFLAGS])
94 AC_SUBST([GTK_LIBS])
95 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
96 AC_SUBST([GTK_VERSION])
97 GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
98 # GTHREAD checks
99 gthread_modules="gthread-2.0"
100 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
101 AC_SUBST([GTHREAD_CFLAGS])
102 AC_SUBST([GTHREAD_LIBS])
104 # --disable-deprecated switch for GTK purification
105 AC_ARG_ENABLE([deprecated],
106                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
107                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
108                 [])
111 # Check for binary relocation support
112 GEANY_CHECK_BINRELOC
113 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
114 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
115 # Plugins support
116 GEANY_CHECK_PLUGINS
117 # check for mingw specific settings
118 GEANY_CHECK_MINGW
120 GEANY_CHECK_SOCKET
121 GEANY_CHECK_VTE
122 GEANY_CHECK_MAC_INTEGRATION
123 GEANY_CHECK_THE_FORCE dnl hehe
125 # i18n
126 GEANY_I18N
128 # double eval since datarootdir is usually defined as ${prefix}/share
129 AM_COND_IF([MINGW],
130   [pkgdatadir='${prefix}/data'],
131   [pkgdatadir='${datarootdir}/geany'])
132 AC_SUBST([GEANY_DATA_DIR], [$(eval echo $(eval echo $pkgdatadir))])
133 AC_SUBST([pkgdatadir])
135 # The default Python command.  On Windows, use the `py` launcher by default
136 AC_ARG_WITH([python-command],
137                         [AS_HELP_STRING([--with-python-command],
138                                                         [the default Python command [defaults to "py" on Windows and "python" otherwise]])],
139                         [with_python_command=$withval],
140                         [with_python_command=auto])
141 AS_IF([test "x$with_python_command" = xauto],
142           [AM_COND_IF([MINGW], [with_python_command=py], [with_python_command=python])])
143 AC_SUBST([PYTHON_COMMAND], [$with_python_command])
145 # Documentation tools
146 GEANY_CHECK_DOCUTILS
147 GEANY_CHECK_DOXYGEN
148 GEANY_CHECK_GTKDOC_HEADER
150 # libgeany
151 GEANY_LIB_INIT
153 # Output
154 AC_CONFIG_FILES([
155                 Makefile
156                 icons/Makefile
157                 icons/16x16/Makefile
158                 icons/24x24/Makefile
159                 icons/32x32/Makefile
160                 icons/48x48/Makefile
161                 icons/scalable/Makefile
162                 icons/tango/Makefile
163                 icons/tango/16x16/Makefile
164                 icons/tango/24x24/Makefile
165                 icons/tango/32x32/Makefile
166                 icons/tango/48x48/Makefile
167                 icons/tango/scalable/Makefile
168                 ctags/Makefile
169                 scintilla/Makefile
170                 scintilla/include/Makefile
171                 src/Makefile
172                 src/tagmanager/Makefile
173                 plugins/Makefile
174                 po/Makefile.in
175                 data/Makefile
176                 data/filedefs/filetypes.python
177                 doc/Makefile
178                 doc/geany.1
179                 geany.pc
180                 geany.nsi
181                 doc/Doxyfile
182                 tests/Makefile
183                 tests/ctags/Makefile
185 AC_OUTPUT
187 # Summary
188 GEANY_STATUS_OUTPUT
189 echo ""
190 echo "Configuration is done OK."
191 echo ""