Merge pull request #3759 from andy5995/meson-fix-deprecated-str-fmt
[geany-mirror.git] / configure.ac
blobf0b65d6275b2ba11de94818c9beff1b70cca5706
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4 AC_INIT([Geany], [2.1],
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 # Silence "AC_LINK_IFELSE before AC_USE_SYSTEM_EXTENSIONS" warnings
13 # Note: Enables _GNU_SOURCE on Linux
14 AC_USE_SYSTEM_EXTENSIONS
16 AM_GNU_GETTEXT_VERSION([0.19.8])
17 AM_GNU_GETTEXT([external])
19 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
21 GEANY_PREFIX
22 GEANY_DOCDIR
24 GEANY_STATUS_ADD([Install Geany in], [${prefix}])
25 if test -n "${build}" -a -n "${target}"; then
26         GEANY_STATUS_ADD([Building Geany on], [${build}])
27         GEANY_STATUS_ADD([Building Geany for], [${target}])
30 m4_ifdef([AM_PROG_AR],[AM_PROG_AR])
31 LT_INIT([disable-static])
32 AC_PROG_CC
33 AM_PROG_CC_C_O
34 AC_PROG_CXX
35 GEANY_PROG_CXX
36 AX_CXX_COMPILE_STDCXX_17
38 AC_PROG_INSTALL
39 AC_PROG_LN_S
41 if test "$ac_cv_prog_cc_c99" = "no"; then
42         AC_MSG_ERROR([Need a C99 compiler])
45 # autoscan start
47 # Checks for header files.
48 AC_CHECK_HEADERS([fcntl.h stdlib.h sys/time.h errno.h limits.h])
50 # Checks for dependencies needed by ctags
51 AC_CHECK_HEADERS([dirent.h fnmatch.h direct.h io.h sys/dir.h])
52 AC_DEFINE([HAVE_STDBOOL_H], [1], [whether or not to use <stdbool.h>.])
53 AC_CHECK_FUNC([regcomp],
54                 [have_regcomp=yes],
55                 [have_regcomp=no
56                  dnl various stuff for ctags/gnu_regex/
57                  AC_CHECK_HEADERS([langinfo.h locale.h libintl.h wctype.h wchar.h])
58                  AC_CHECK_FUNCS([memcpy isblank wcrtomb mbrtowc wcscoll])
59                  AC_FUNC_ALLOCA])
60 AM_CONDITIONAL([USE_BUNDLED_REGEX], [test "xno" = "x$have_regcomp"])
61 AC_CHECK_FUNC([fnmatch], [have_fnmatch=yes], [have_fnmatch=no])
62 AM_CONDITIONAL([USE_BUNDLED_FNMATCH], [test "xno" = "x$have_fnmatch"])
64 # Checks for typedefs, structures, and compiler characteristics.
65 AC_TYPE_OFF_T
66 AC_TYPE_SIZE_T
67 AC_STRUCT_TM
69 # Checks for library functions.
70 AC_CHECK_FUNCS([realpath])
72 # Function checks for u-ctags
73 AC_CHECK_FUNCS([strerror strstr asprintf])
74 AC_CHECK_FUNCS([mkstemp tempnam], [break])
75 AC_CHECK_FUNCS([strcasecmp stricmp], [break])
76 AC_CHECK_FUNCS([strncasecmp strnicmp], [break])
77 AC_CHECK_FUNCS([truncate ftruncate chsize], [break])
78 # non-functions checks for u-ctags.  Not that we really need those as we don't
79 # use u-ctags's main, but the corresponding macros have to be defined to
80 # something, so simply perform the actual checks.
81 AC_CHECK_DECLS([__environ],,,[[#include <unistd.h>]])
82 AC_CHECK_DECLS([_NSGetEnviron],,,[[#include <crt_externs.h>]])
84 # autoscan end
87 # check for VCS revision
88 GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy
89                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
91 GEANY_CHECK_GTK
92 GEANY_CHECK_GTK_FUNCS([g_strv_equal])
94 # --disable-deprecated switch for GTK purification
95 AC_ARG_ENABLE([deprecated],
96                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
97                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
98                 [])
101 # Check for binary relocation support
102 GEANY_CHECK_BINRELOC
103 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
104 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
105 # Plugins support
106 GEANY_CHECK_PLUGINS
107 # check for mingw specific settings
108 GEANY_CHECK_MINGW
110 GEANY_CHECK_SOCKET
111 GEANY_CHECK_VTE
112 GEANY_CHECK_MAC_INTEGRATION
113 GEANY_CHECK_THE_FORCE dnl hehe
115 AC_SUBST([GETTEXT_PACKAGE],[$PACKAGE])
116 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$PACKAGE"], [Gettext package.])
118 # double eval since datarootdir is usually defined as ${prefix}/share
119 AM_COND_IF([MINGW],
120   [pkgdatadir='${prefix}/data'],
121   [pkgdatadir='${datarootdir}/geany'])
122 AM_COND_IF([MINGW],[LIBS="$LIBS -liconv"])
123 AC_SUBST([GEANY_DATA_DIR], [$(eval echo $(eval echo $pkgdatadir))])
124 AC_SUBST([pkgdatadir])
126 # The default Python command.  On Windows, use the `py` launcher by default
127 AC_ARG_WITH([python-command],
128                         [AS_HELP_STRING([--with-python-command],
129                                                         [the default Python command [defaults to "py" on Windows and "python" otherwise]])],
130                         [with_python_command=$withval],
131                         [with_python_command=auto])
132 AS_IF([test "x$with_python_command" = xauto],
133           [AM_COND_IF([MINGW], [with_python_command=py], [with_python_command=python])])
134 AC_SUBST([PYTHON_COMMAND], [$with_python_command])
136 # Documentation tools
137 GEANY_CHECK_DOCUTILS
138 GEANY_CHECK_DOXYGEN
139 GEANY_CHECK_GTKDOC_HEADER
141 # libgeany
142 GEANY_LIB_INIT
144 # Output
145 AC_CONFIG_FILES([
146                 Makefile
147                 icons/Makefile
148                 icons/16x16/Makefile
149                 icons/24x24/Makefile
150                 icons/32x32/Makefile
151                 icons/48x48/Makefile
152                 icons/scalable/Makefile
153                 icons/tango/Makefile
154                 icons/tango/16x16/Makefile
155                 icons/tango/24x24/Makefile
156                 icons/tango/32x32/Makefile
157                 icons/tango/48x48/Makefile
158                 icons/tango/scalable/Makefile
159                 ctags/Makefile
160                 scintilla/Makefile
161                 src/Makefile
162                 src/tagmanager/Makefile
163                 plugins/Makefile
164                 po/Makefile.in
165                 data/Makefile
166                 data/filedefs/filetypes.python
167                 doc/Makefile
168                 doc/geany.1
169                 geany.pc
170                 geany.nsi
171                 tests/Makefile
172                 tests/ctags/Makefile
174 AC_OUTPUT
176 # Summary
177 GEANY_STATUS_OUTPUT
178 echo ""
179 echo "Configuration is done OK."
180 echo ""