Cleanup statusbar template code a bit
[geany-mirror.git] / configure.ac
blob2ec8029838bd75a0ddbb6aa41da796ead07ae459
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4 AC_INIT([Geany], [1.24],
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
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 AC_PROG_CC
28 AC_PROG_CXX
29 # check for C++ compiler explicitly and fail if none is found, do this check
30 # after AC_PROG_CXX has set the CXX environment variable
31 if ! which $CXX >/dev/null 2>&1; then
32         AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
38 # autoscan start
40 # Checks for header files.
41 AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h stdlib.h sys/time.h])
43 # Checks for typedefs, structures, and compiler characteristics.
44 AC_TYPE_OFF_T
45 AC_TYPE_SIZE_T
46 AC_STRUCT_TM
48 # Checks for library functions.
49 AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp strerror strstr])
51 # autoscan end
54 # check for SVN revision
55 GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
56                                           CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
59 AC_ARG_ENABLE([gtk3],
60                 [AS_HELP_STRING([--enable-gtk3],
61                                                 [compile with GTK3 support (experimental) [default=no]])],
62                 [enable_gtk3=$enableval],
63                 [enable_gtk3=no])
65 AS_IF([test "x$enable_gtk3" = xyes],
66           [gtk_package=gtk+-3.0
67            gtk_min_version=3.0],
68           [gtk_package=gtk+-2.0
69            gtk_min_version=2.16])
70 AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
72 # GTK/GLib/GIO checks
73 gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.20"
74 gtk_modules_private="gio-2.0 >= 2.20 gmodule-2.0"
75 PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
76 AC_SUBST([DEPENDENCIES], [$gtk_modules])
77 AC_SUBST([GTK_CFLAGS])
78 AC_SUBST([GTK_LIBS])
79 GTK_VERSION=`$PKG_CONFIG --modversion $gtk_package`
80 GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
81 # GTHREAD checks
82 gthread_modules="gthread-2.0"
83 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
84 AC_SUBST([GTHREAD_CFLAGS])
85 AC_SUBST([GTHREAD_LIBS])
87 # --disable-deprecated switch for GTK2 purification
88 AC_ARG_ENABLE([deprecated],
89                 [AS_HELP_STRING([--disable-deprecated], [Disable deprecated GTK functions.])],
90                 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"],
91                 [])
94 # Check for binary relocation support
95 GEANY_CHECK_BINRELOC
96 # CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
97 AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
98 # Plugins support
99 GEANY_CHECK_PLUGINS
100 # check for mingw specific settings
101 GEANY_CHECK_MINGW
103 GEANY_CHECK_SOCKET
104 GEANY_CHECK_VTE
105 GEANY_CHECK_THE_FORCE dnl hehe
107 # i18n
108 GEANY_I18N
110 GEANY_DATA_DIR=`eval echo ${datarootdir}/geany`
111 AC_SUBST([GEANY_DATA_DIR])
113 # Output
114 AC_CONFIG_FILES([
115                 Makefile
116                 icons/Makefile
117                 icons/16x16/Makefile
118                 icons/24x24/Makefile
119                 icons/32x32/Makefile
120                 icons/48x48/Makefile
121                 icons/scalable/Makefile
122                 icons/tango/Makefile
123                 icons/tango/16x16/Makefile
124                 icons/tango/24x24/Makefile
125                 icons/tango/32x32/Makefile
126                 icons/tango/48x48/Makefile
127                 icons/tango/scalable/Makefile
128                 tagmanager/Makefile
129                 tagmanager/ctags/Makefile
130                 tagmanager/mio/Makefile
131                 tagmanager/src/Makefile
132                 scintilla/Makefile
133                 scintilla/include/Makefile
134                 src/Makefile
135                 plugins/Makefile
136                 po/Makefile.in
137                 doc/Makefile
138                 doc/geany.1
139                 geany.spec
140                 geany.pc
141                 doc/Doxyfile
143 AC_OUTPUT
145 # Summary
146 GEANY_STATUS_OUTPUT
147 echo ""
148 echo "Configuration is done OK."
149 echo ""