Fix crash in lookup_includes()
[geany-mirror.git] / configure.ac
blobd529e1f6c6513c3456e48767cfef75d9609fa04a
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4 AC_INIT([Geany], [1.28],
5                 [https://sourceforge.net/tracker/?group_id=153444&atid=787791])
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 # check for C++ compiler explicitly and fail if none is found, do this check
34 # after AC_PROG_CXX has set the CXX environment variable
35 if ! which $CXX >/dev/null 2>&1; then
36         AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
39 AC_PROG_INSTALL
40 AC_PROG_LN_S
42 # autoscan start
44 # Checks for header files.
45 AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h stdlib.h sys/time.h])
47 # Checks for typedefs, structures, and compiler characteristics.
48 AC_TYPE_OFF_T
49 AC_TYPE_SIZE_T
50 AC_STRUCT_TM
52 # Checks for library functions.
53 AC_CHECK_FUNCS([ftruncate fgetpos fnmatch mkstemp strerror strstr])
55 # autoscan end
58 # check for VCS revision
59 GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy
60                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
63 AC_ARG_ENABLE([gtk3],
64                 [AS_HELP_STRING([--enable-gtk3],
65                                                 [compile with GTK3 support (experimental) [default=no]])],
66                 [enable_gtk3=$enableval],
67                 [enable_gtk3=no])
69 AS_IF([test "x$enable_gtk3" = xyes],
70           [gtk_package=gtk+-3.0
71            gtk_min_version=3.0],
72           [gtk_package=gtk+-2.0
73            gtk_min_version=2.24])
74 AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
76 # GTK/GLib/GIO checks
77 gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.28"
78 gtk_modules_private="gio-2.0 >= 2.28 gmodule-no-export-2.0"
79 PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
80 AC_SUBST([DEPENDENCIES], [$gtk_modules])
81 dnl Define minimum requirements to avoid warnings about symbols deprecated afterward.
82 dnl Although GLIB_VERSION_2_28 is new in 2.32, older versions won't evaluate
83 dnl GLIB_VERSION_MIN_REQUIRED so it won't be a problem.
84 AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28"])
85 dnl Disable all GTK deprecations on 3.x so long as we want to keep 2.x support and only require 3.0.
86 dnl No need on 2.x as we target the latest version.
87 AM_COND_IF([GTK3], [AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])])
88 AC_SUBST([GTK_CFLAGS])
89 AC_SUBST([GTK_LIBS])
90 GTK_VERSION=`$PKG_CONFIG --modversion $gtk_package`
91 AC_SUBST([GTK_VERSION])
92 GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
93 # GTHREAD checks
94 gthread_modules="gthread-2.0"
95 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
96 AC_SUBST([GTHREAD_CFLAGS])
97 AC_SUBST([GTHREAD_LIBS])
99 # --disable-deprecated switch for GTK purification
100 AC_ARG_ENABLE([deprecated],
101                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
102                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
103                 [])
106 # Check for binary relocation support
107 GEANY_CHECK_BINRELOC
108 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
109 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
110 # Plugins support
111 GEANY_CHECK_PLUGINS
112 # check for mingw specific settings
113 GEANY_CHECK_MINGW
115 GEANY_CHECK_SOCKET
116 GEANY_CHECK_VTE
117 GEANY_CHECK_MAC_INTEGRATION
118 GEANY_CHECK_THE_FORCE dnl hehe
120 # i18n
121 GEANY_I18N
123 # double eval since datarootdir is usually defined as ${prefix}/share
124 AM_COND_IF([MINGW],
125   [pkgdatadir='${prefix}/data'],
126   [pkgdatadir='${datarootdir}/geany'])
127 AC_SUBST([GEANY_DATA_DIR], [$(eval echo $(eval echo $pkgdatadir))])
128 AC_SUBST([pkgdatadir])
130 # Documentation tools
131 GEANY_CHECK_DOCUTILS
132 GEANY_CHECK_DOXYGEN
133 GEANY_CHECK_GTKDOC_HEADER
135 # libgeany
136 GEANY_LIB_INIT
138 # Output
139 AC_CONFIG_FILES([
140                 Makefile
141                 icons/Makefile
142                 icons/16x16/Makefile
143                 icons/24x24/Makefile
144                 icons/32x32/Makefile
145                 icons/48x48/Makefile
146                 icons/scalable/Makefile
147                 icons/tango/Makefile
148                 icons/tango/16x16/Makefile
149                 icons/tango/24x24/Makefile
150                 icons/tango/32x32/Makefile
151                 icons/tango/48x48/Makefile
152                 icons/tango/scalable/Makefile
153                 tagmanager/Makefile
154                 tagmanager/ctags/Makefile
155                 tagmanager/mio/Makefile
156                 tagmanager/src/Makefile
157                 scintilla/Makefile
158                 scintilla/include/Makefile
159                 src/Makefile
160                 plugins/Makefile
161                 po/Makefile.in
162                 data/Makefile
163                 doc/Makefile
164                 doc/geany.1
165                 geany.spec
166                 geany.pc
167                 geany.nsi
168                 doc/Doxyfile
169                 tests/Makefile
170                 tests/ctags/Makefile
172 AC_OUTPUT
174 # Summary
175 GEANY_STATUS_OUTPUT
176 echo ""
177 echo "Configuration is done OK."
178 echo ""