Beep if the user hasn't entered a class name on pressing OK.
[geany-mirror.git] / configure.ac
blob1147cba64f87dc06d94da185318442780c21f739
1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id$
4 AC_INIT(configure.ac)
5 AM_INIT_AUTOMAKE(geany, 0.19)
7 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
9 AM_CONFIG_HEADER(config.h)
11 AC_GNU_SOURCE
12 AC_AIX
13 AC_MINIX
15 AC_PROG_CC
17 AC_PROG_CXX
18 # check for C++ compiler explicitly and fail if none is found, do this check
19 # after AC_PROG_CXX has set the CXX environment variable
20 AC_PATH_PROG([CXXCOMPILER], [$CXX])
21 if ! test -x "${CXXCOMPILER}"
22 then
23         AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
26 #AC_PROG_RANLIB
27 AC_PROG_INSTALL
28 AC_PROG_LN_S
29 AC_PROG_INTLTOOL
31 # for plugins
32 AC_DISABLE_STATIC
33 AM_PROG_LIBTOOL
34 LIBTOOL="$LIBTOOL --silent"
36 # autoscan start
38 # Checks for header files.
39 AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h regex.h stdlib.h sys/time.h])
41 # Checks for typedefs, structures, and compiler characteristics.
42 AC_TYPE_OFF_T
43 AC_TYPE_SIZE_T
44 AC_STRUCT_TM
46 # Checks for library functions.
47 AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp regcomp strerror strstr])
49 # autoscan end
52 # get svn revision (try GIT first, then check for SVN)
53 REVISION="r0"
54 AC_PATH_PROG([GIT], [git])
55 if test -d ".git" -a "x${GIT}" != "x" -a -x "${GIT}"
56 then
57         REVISION=r`git svn find-rev origin/trunk 2>/dev/null ||
58                                 git svn find-rev trunk 2>/dev/null || git svn find-rev HEAD 2>/dev/null ||
59                                 git svn find-rev master 2>/dev/null || echo 0`
61 if test "x${REVISION}" = "xr0"
62 then
63         AC_PATH_PROG([SVN], [svn])
64         if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}"
65         then
66                 REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
67         fi
69 if test "x${REVISION}" != "xr0"
70 then
71         # force debug mode for a SVN working copy
72         CFLAGS="-g -DGEANY_DEBUG $CFLAGS"
73 else
74         REVISION="-1"
76 AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])
79 dnl Check for binary relocation support
80 dnl taken from Inkscape (Hongli Lai <h.lai@chello.nl>)
82 AC_ARG_ENABLE(binreloc,
83        [  --enable-binreloc       compile with binary relocation support],
84        enable_binreloc=$enableval,enable_binreloc=no)
86 AC_MSG_CHECKING(whether binary relocation support should be enabled)
87 if test "$enable_binreloc" = "yes"; then
88        AC_MSG_RESULT(yes)
89        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
90        if test -e /proc/self/maps; then
91                AC_MSG_RESULT(yes)
92        else
93                AC_MSG_RESULT(no)
94                AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
95                enable_binreloc="no"
96        fi
98 elif test "$enable_binreloc" = "auto"; then
99        AC_MSG_RESULT(yes when available)
100        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
101        if test -e /proc/self/maps; then
102                AC_MSG_RESULT(yes)
103                enable_binreloc=yes
105                AC_MSG_CHECKING(whether everything is installed to the same prefix)
106                if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
107                        "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
108                        "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
109                then
110                        AC_MSG_RESULT(yes)
111                else
112                        AC_MSG_RESULT(no)
113                        AC_MSG_NOTICE(Binary relocation support will be disabled.)
114                        enable_binreloc=no
115                fi
117        else
118                AC_MSG_RESULT(no)
119                enable_binreloc=no
120        fi
122 elif test "$enable_binreloc" = "no"; then
123        AC_MSG_RESULT(no)
124 else
125        AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
126        enable_binreloc=no
128 if test "$enable_binreloc" = "yes"; then
129    AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
133 # GTK checks
134 gtk_modules="gtk+-2.0 >= 2.8.0"
135 PKG_CHECK_MODULES(GTK, [$gtk_modules])
136 AC_SUBST(GTK_CFLAGS)
137 AC_SUBST(GTK_LIBS)
138 # GIO checks
139 gio_modules="gio-2.0 >= 2.16"
140 PKG_CHECK_MODULES(GIO, [$gio_modules], have_gio=1, have_gio=0)
141 AC_SUBST(GIO_CFLAGS)
142 AC_SUBST(GIO_LIBS)
143 if test $have_gio = 1 ; then
144     AC_DEFINE(HAVE_GIO, 1, [Whether GIO is available])
147 # --disable-deprecated switch for GTK2 purification
148 AC_ARG_ENABLE(deprecated, [  --disable-deprecated    Disable deprecated GTK functions. ],
149                           [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
151 # Plugins support
152 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support  [default=no]])], , enable_plugins=yes)
154 if test "x$enable_plugins" = "xyes" ; then
155         AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled.])
156         AM_CONDITIONAL(PLUGINS, true)
157 else
158         AM_CONDITIONAL(PLUGINS, false)
161 # Use included GNU regex library
162 AC_ARG_ENABLE(gnu-regex, [AC_HELP_STRING([--enable-gnu-regex], [compile with included GNU regex library  [default=no]])], , enable_gnu_regex=no)
164 if test "x$enable_gnu_regex" = "xyes" ; then
165         AC_DEFINE(USE_INCLUDED_REGEX, 1, [Define if included GNU regex code should be used.])
166         AC_DEFINE(HAVE_REGCOMP, 1, [Define if you have the 'regcomp' function.])
167         AM_CONDITIONAL(USE_INCLUDED_REGEX, true)
168 else
169         AM_CONDITIONAL(USE_INCLUDED_REGEX, false)
172 case "${host}" in
173     *mingw*)
174         AC_CHECK_LIB(iberty, fnmatch, [], [
175                 AC_MSG_ERROR([fnmatch does not present in libiberty. You need to update it, read http://www.geany.org/Support/CrossCompile for details.])
176                 ])
177         AC_DEFINE_UNQUOTED([WIN32], 1, [we are cross compiling for WIN32])
178         want_vte="no"
179         want_socket="yes"
180         AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
181         AC_EXEEXT
182         AM_CONDITIONAL(MINGW, true)
183         ;;
184     *)
185         AM_CONDITIONAL(MINGW, false)
186         ;;
187 esac
189 dnl skip check if already decided
190 if test "x$want_socket" = "x"; then
191     # socket support
192     AC_ARG_ENABLE(socket, AC_HELP_STRING([--enable-socket],[enable if you want to detect a running instance [[default=yes]]]),
193      [want_socket="$enableval"], [want_socket="yes"])
195     if test "x$want_socket" = "xyes"; then
196         AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
197         # this should bring in libsocket on Solaris:
198         AC_SEARCH_LIBS([connect],[socket],[],[],[])
199     fi
202 dnl skip check if already decided
203 if test "x$want_vte" = "x"; then
204     # VTE support
205     AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],
206      [enable if you want virtual terminal support [[default=yes]]]),
207      [want_vte="$enableval"], [want_vte="yes"])
208     if test "x$want_vte" = "xyes"; then
209         AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])
210     fi
211     AC_ARG_WITH(vte-module-path, AC_HELP_STRING([--with-vte-module-path=PATH],
212      [Path to a loadable libvte [[default=None]]]), [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH],
213      ["$withval"], [Path to a loadable libvte])])
216 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
219 # GTK 2.10 printing support
220 $PKG_CONFIG --exists 'gtk+-2.0 >= 2.10.0'
221 if test "x$?" = "x0" ; then
222         enable_printing="yes"
223 else
224         enable_printing="no (GTK >= 2.10 necessary)"
228 # just for a laugh (it has absolutely no effect)
229 AC_ARG_ENABLE(the-force, AC_HELP_STRING([--enable-the-force],
230      [enable if you are Luke Skywalker and the force is with you [[default=no]]]), [be_luke="$enableval"], [be_luke="no"])
231 AC_MSG_CHECKING([whether the force is with you])
232 if test "x$be_luke" = "xyes"; then
233         AC_MSG_RESULT([yes])
234 else
235         AC_MSG_RESULT([no])
238 # i18n
239 GETTEXT_PACKAGE=geany
240 AC_SUBST(GETTEXT_PACKAGE)
241 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
243 if test -n "${LINGUAS}"
244 then
245         ALL_LINGUAS="${LINGUAS}"
246 else
247         if test -z "$conf_dir" ; then
248                 conf_dir="."
249         fi
250         ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $1 }'`
253 AM_GLIB_GNU_GETTEXT
254 # workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845)
255 if test "x$MSGFMT" = "xno"; then
256         AC_MSG_ERROR([msgfmt not found. Please install the gettext package.])
260 # Set ${datadir}
261 if test "x${datadir}" = 'x${prefix}/share' -o "x${datarootdir}" = 'x${prefix}/share'; then
262         if test "x${prefix}" = "xNONE"; then
263                 prefix=${ac_default_prefix}
264         fi
267 # Set ${docdir} if it is empty
268 if test -z "${docdir}"; then
269         docdir='${datadir}/doc/${PACKAGE}'
270         AC_SUBST(docdir)
273 GEANY_DATA_DIR=`eval echo ${datarootdir}/geany`
274 AC_SUBST(GEANY_DATA_DIR)
276 # intltool hack to define install_sh on Debian/Ubuntu systems
277 if test "x$install_sh" = "x"; then
278         install_sh="`pwd`/install-sh"
279         AC_SUBST(install_sh)
282 AC_OUTPUT([
283 Makefile
284 icons/Makefile
285 icons/16x16/Makefile
286 icons/48x48/Makefile
287 icons/scalable/Makefile
288 tagmanager/Makefile
289 tagmanager/include/Makefile
290 scintilla/Makefile
291 scintilla/include/Makefile
292 src/Makefile
293 plugins/Makefile
294 po/Makefile.in
295 doc/Makefile
296 doc/geany.1
297 geany.spec
298 geany.pc
299 doc/Doxyfile
302 echo "----------------------------------------"
303 echo "Install Geany in                   : ${prefix}"
304 if test "x${build}" != "x" -a "x${target}" != "x"
305 then
306         echo "Building Geany on                  : ${build}"
307         echo "Building Geany for                 : ${target}"
309 echo "Using GTK version                  : ${GTK_VERSION}"
310 echo "Build with GTK printing support    : ${enable_printing}"
311 echo "Build with plugin support          : ${enable_plugins}"
312 echo "Use virtual terminal support       : ${want_vte}"
313 echo "Use (UNIX domain) socket support   : ${want_socket}"
314 if test "${REVISION}" != "-1"
315 then
316         echo "Compiling Subversion revision      : ${REVISION}"
318 echo ""
319 echo "Configuration is done OK."
320 echo ""