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])
40 # For automake options (AM_INIT_AUTOMAKE options) see Makefile.am
41 # file, AUTOMAKE_OPTIONS variable
43 AM_INIT_AUTOMAKE([1.10 foreign -Wall])
46 # Build related programs
56 AS_IF([test "$CC" = "gcc"],[
58 CC_VERSION=$GCC_VERSION
63 AS_IF([test "$CXX" = "g++"],[
65 CXX_VERSION=$GXX_VERSION
74 # Checks for preprocessor flags
76 AX_CXXCPP_CHECK_FLAG([-Wall], [],[],[ TEMP_FLAGS="$TEMP_FLAGS -Wall" ])
77 AX_CXXCPP_CHECK_FLAG([-Werror],[],[],[ TEMP_FLAGS="$TEMP_FLAGS -Werror"])
78 AC_SUBST([EXTRA_CPPFLAGS],$TEMP_FLAGS)
84 AS_IF([test -n "$PKG_CONFIG"],[
85 # XXX FIXME: To be removed ASAP
86 AC_MSG_NOTICE([Performing pkg-config checks])
88 # Check for lua support
89 PKG_CHECK_MODULES([LUA],[lua],[ lua_available=1 ],[ lua_available=0 ])
90 AC_ARG_ENABLE(lua,[AS_HELP_STRING([--disable-lua],[disable lua support])],[
91 AS_IF([test "$enable_lua" = "no"],[
97 # XXX FIXME: To be removed ASAP
98 AC_MSG_NOTICE([lua_available = $lua_available])
100 # Finally output lua related state
101 AS_IF([ test "$lua_available" = "1" ],[
102 AC_DEFINE_UNQUOTED(HAVE_LUA,[1],[ Define to 1 if lua is available ])
104 AM_CONDITIONAL([ENABLE_LUA],[test "$lua_available" = "1"])
107 # Maintainer-side related program checks
109 AX_PATH_MISSING([WGET], [wget])
110 AX_PATH_MISSING([PERL], [perl])
111 AX_PATH_MISSING([ASCIIDOC], [asciidoc])
114 # User-side related program checks
118 # Headers and functions check
120 AC_CHECK_HEADERS([unistd.h getopt.h execinfo.h])
121 AC_CHECK_FUNCS([backtrace backtrace_symbols])
135 tools/autotools/Makefile
136 tools/autotools/m4/Makefile
142 AC_CONFIG_FILES([tools/maint/fetch], [chmod +x tools/maint/fetch])
143 AC_CONFIG_FILES([tools/maint/gitlog-to-committers],[chmod +x tools/maint/gitlog-to-committers])
145 AS_IF([test "$lua_available" = "1" ],[lua_state="yes"],[lua_state="no"])
150 ${PACKAGE_NAME} configuration summary
152 Software version : ${PACKAGE_VERSION}
154 Host : ${host_cpu} ($host)
155 Build : ${build_cpu} ($build)
156 Target : ${target_cpu} ($target)
158 C preprocessor : ${CPP}
159 C compiler : ${CC} (version ${CC_VERSION})
160 C++ preprocessor : ${CXXCPP}
161 C++ compiler : ${CXX} (version ${CXX_VERSION})
163 Archive handler : ${RANLIB}
165 Lua support : ${lua_state}
167 ${PACKAGE_NAME} ${PACKAGE_VERSION} configured.
169 Copyright (C) 2008 Francesco Salvestrini
172 The ${PACKAGE_NAME}; you can redistribute it and/or
173 modify it under the terms of the GNU General Public License as
174 published by the Free Software Foundation; either version 2 of
175 the License, or (at your option) any later version.
177 The ${PACKAGE_NAME} is distributed in the hope that it will be useful,
178 but WITHOUT ANY WARRANTY; without even the implied warranty of
179 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 GNU General Public License for more details.