Remove unnecessary use of AH_TEMPLATE
[geany-mirror.git] / configure.ac
blobc8fcc16b29172677ff71dadedfc5d7d1cb640a32
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4 AC_INIT([Geany], [1.29],
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 GEANY_PROG_CXX
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
38 # autoscan start
40 # Checks for header files.
41 AC_CHECK_HEADERS([fcntl.h glob.h stdlib.h sys/time.h errno.h limits.h])
43 # Checks for dependencies needed by ctags
44 AC_CHECK_HEADERS([fnmatch.h direct.h io.h sys/dir.h])
45 AC_DEFINE([USE_STDBOOL_H], [1], [whether or not to use <stdbool.h>.])
46 AC_DEFINE([CTAGS_LIB], [1], [compile ctags as a library.])
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([ftruncate fgetpos fnmatch mkstemp strerror strstr])
56 # autoscan end
59 # check for VCS revision
60 GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy
61                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
64 AC_ARG_ENABLE([gtk3],
65                 [AS_HELP_STRING([--enable-gtk3],
66                                                 [compile with GTK3 support (experimental) [default=no]])],
67                 [enable_gtk3=$enableval],
68                 [enable_gtk3=no])
70 AS_IF([test "x$enable_gtk3" = xyes],
71           [gtk_package=gtk+-3.0
72            gtk_min_version=3.0],
73           [gtk_package=gtk+-2.0
74            gtk_min_version=2.24])
75 AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
77 # GTK/GLib/GIO checks
78 gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.32"
79 gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0"
80 PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
81 AC_SUBST([DEPENDENCIES], [$gtk_modules])
82 AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"])
83 dnl Disable all GTK deprecations on 3.x so long as we want to keep 2.x support and only require 3.0.
84 dnl No need on 2.x as we target the latest version.
85 AM_COND_IF([GTK3], [AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])])
86 AC_SUBST([GTK_CFLAGS])
87 AC_SUBST([GTK_LIBS])
88 GTK_VERSION=`$PKG_CONFIG --modversion $gtk_package`
89 AC_SUBST([GTK_VERSION])
90 GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
91 # GTHREAD checks
92 gthread_modules="gthread-2.0"
93 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
94 AC_SUBST([GTHREAD_CFLAGS])
95 AC_SUBST([GTHREAD_LIBS])
97 # --disable-deprecated switch for GTK purification
98 AC_ARG_ENABLE([deprecated],
99                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
100                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
101                 [])
104 # Check for binary relocation support
105 GEANY_CHECK_BINRELOC
106 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
107 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
108 # Plugins support
109 GEANY_CHECK_PLUGINS
110 # check for mingw specific settings
111 GEANY_CHECK_MINGW
113 GEANY_CHECK_SOCKET
114 GEANY_CHECK_VTE
115 GEANY_CHECK_MAC_INTEGRATION
116 GEANY_CHECK_THE_FORCE dnl hehe
118 # i18n
119 GEANY_I18N
121 # double eval since datarootdir is usually defined as ${prefix}/share
122 AM_COND_IF([MINGW],
123   [pkgdatadir='${prefix}/data'],
124   [pkgdatadir='${datarootdir}/geany'])
125 AC_SUBST([GEANY_DATA_DIR], [$(eval echo $(eval echo $pkgdatadir))])
126 AC_SUBST([pkgdatadir])
128 # Documentation tools
129 GEANY_CHECK_DOCUTILS
130 GEANY_CHECK_DOXYGEN
131 GEANY_CHECK_GTKDOC_HEADER
133 # libgeany
134 GEANY_LIB_INIT
136 # Output
137 AC_CONFIG_FILES([
138                 Makefile
139                 icons/Makefile
140                 icons/16x16/Makefile
141                 icons/24x24/Makefile
142                 icons/32x32/Makefile
143                 icons/48x48/Makefile
144                 icons/scalable/Makefile
145                 icons/tango/Makefile
146                 icons/tango/16x16/Makefile
147                 icons/tango/24x24/Makefile
148                 icons/tango/32x32/Makefile
149                 icons/tango/48x48/Makefile
150                 icons/tango/scalable/Makefile
151                 ctags/Makefile
152                 scintilla/Makefile
153                 scintilla/include/Makefile
154                 src/Makefile
155                 src/tagmanager/Makefile
156                 plugins/Makefile
157                 po/Makefile.in
158                 data/Makefile
159                 doc/Makefile
160                 doc/geany.1
161                 geany.spec
162                 geany.pc
163                 geany.nsi
164                 doc/Doxyfile
165                 tests/Makefile
166                 tests/ctags/Makefile
168 AC_OUTPUT
170 # Summary
171 GEANY_STATUS_OUTPUT
172 echo ""
173 echo "Configuration is done OK."
174 echo ""