1 # Process this file with autoconf to produce a configure script.
4 # configure.ac for distributed
6 # Copyright (C) 2008 Francesco Salvestrini
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 AC_INIT([Distributed],[@VERSION@],[salvestrini@gmail.com],[distributed])
25 # Check for a recent version of autoconf
28 # Place/find all autotools related files in the following directories
29 AC_CONFIG_AUX_DIR([tools/autotools])
30 AC_CONFIG_MACRO_DIR([tools/autotools/m4])
31 AC_CONFIG_SRCDIR([AUTHORS])
32 AC_CONFIG_HEADERS([src/autoconfig.h])
35 # For automake options (AM_INIT_AUTOMAKE options) see Makefile.am
36 # file, AUTOMAKE_OPTIONS variable
38 AM_INIT_AUTOMAKE([1.10 foreign -Wall])
41 # Build related programs
58 AX_CXXCPP_CHECK_FLAG([-Wall], [],[],[ TEMP_FLAGS="$TEMP_FLAGS -Wall" ])
59 AX_CXXCPP_CHECK_FLAG([-Werror],[],[],[ TEMP_FLAGS="$TEMP_FLAGS -Werror"])
60 AC_SUBST([EXTRA_CPPFLAGS],$TEMP_FLAGS)
64 AS_IF([test -z "$PKG_CONFIG"],[
68 # Check for lua support (libraries and programs)
69 AC_PATH_PROG([LUAC],[luac])
70 PKG_CHECK_MODULES([LUA],[lua],[ lua_available=1 ],[ lua_available=0 ])
71 AC_ARG_ENABLE(lua,[AS_HELP_STRING([--disable-lua],[disable lua support])],[
72 AS_IF([test "$enable_lua" = "no"],[
77 # Finally output lua related state
78 AS_IF([ test "$lua_available" = 1 ],[
79 AC_DEFINE_UNQUOTED(HAVE_LUA,[1],[ Define to 1 if lua is available ])
81 AM_CONDITIONAL([ENABLE_LUA],[test "$lua_available" = "1"])
84 # Maintainer-side related program checks
86 AX_PATH_MISSING([WGET], [wget])
87 AX_PATH_MISSING([PERL], [perl])
88 AX_PATH_MISSING([ASCIIDOC], [asciidoc])
91 # User-side related program checks
95 # Headers and functions check
97 AC_CHECK_HEADERS([unistd.h getopt.h execinfo.h])
98 AC_CHECK_FUNCS([backtrace backtrace_symbols])
112 tools/autotools/Makefile
113 tools/autotools/m4/Makefile
119 AC_CONFIG_FILES([tools/maint/fetch], [chmod +x tools/maint/fetch])
120 AC_CONFIG_FILES([tools/maint/gitlog-to-committers],[chmod +x tools/maint/gitlog-to-committers])