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
80 # Checks for preprocessor flags
82 AX_CXXCPP_CHECK_FLAG([-Wall], [],[],[ TEMP_FLAGS="$TEMP_FLAGS -Wall" ])
83 AX_CXXCPP_CHECK_FLAG([-Werror],[],[],[ TEMP_FLAGS="$TEMP_FLAGS -Werror"])
84 AC_SUBST([EXTRA_CPPFLAGS],$TEMP_FLAGS)
90 AS_IF([test -n "$PKG_CONFIG"],[
91 # XXX FIXME: To be removed ASAP
92 AC_MSG_NOTICE([Performing pkg-config checks])
94 # Check for lua support
95 PKG_CHECK_MODULES([LUA],[lua],[ lua_available=1 ],[ lua_available=0 ])
96 AC_ARG_ENABLE(lua,[AS_HELP_STRING([--disable-lua],[disable lua support])],[
97 AS_IF([test "$enable_lua" = "no"],[
103 # XXX FIXME: To be removed ASAP
104 AC_MSG_NOTICE([lua_available = $lua_available])
106 # Finally output lua related state
107 AS_IF([ test "$lua_available" = "1" ],[
108 AC_DEFINE_UNQUOTED(HAVE_LUA,[1],[ Define to 1 if lua is available ])
110 AM_CONDITIONAL([ENABLE_LUA],[test "$lua_available" = "1"])
113 # Maintainer-side related program checks
115 AX_PATH_MISSING([WGET], [wget])
116 AX_PATH_MISSING([PERL], [perl])
117 AX_PATH_MISSING([ASCIIDOC], [asciidoc])
118 AX_PATH_MISSING([DEVTODO], [devtodo])
121 # User-side related program checks
125 # Headers and functions check
127 AC_CHECK_HEADERS([unistd.h getopt.h execinfo.h])
128 AC_CHECK_FUNCS([backtrace backtrace_symbols])
143 tools/autotools/Makefile
144 tools/autotools/m4/Makefile
150 AC_CONFIG_FILES([tools/maint/fetch], [chmod +x tools/maint/fetch])
151 AC_CONFIG_FILES([tools/maint/gitlog-to-committers],[chmod +x tools/maint/gitlog-to-committers])
153 AS_IF([test "$lua_available" = "1" ],[lua_state="yes"],[lua_state="no"])
158 ${PACKAGE_NAME} configuration summary
160 Software version : ${PACKAGE_VERSION}
162 Host : ${host_cpu} ($host)
163 Build : ${build_cpu} ($build)
164 Target : ${target_cpu} ($target)
166 C preprocessor : ${CPP}
167 C preprocessor flags : ${CPPFLAGS}
168 C compiler : ${CC} (version ${CC_VERSION})
169 C compiler flags : ${CFLAGS}
170 C++ preprocessor : ${CXXCPP}
171 C++ preprocessor flags : ${CPPFLAGS}
172 C++ compiler : ${CXX} (version ${CXX_VERSION})
173 C++ compiler flags : ${CXXFLAGS}
175 Archive handler : ${RANLIB}
176 Linker flags : ${LDFLAGS}
178 Lua support : ${lua_state}
180 ${PACKAGE_NAME} ${PACKAGE_VERSION} configured.
182 Copyright (C) 2008 Francesco Salvestrini
185 The ${PACKAGE_NAME}; you can redistribute it and/or
186 modify it under the terms of the GNU General Public License as
187 published by the Free Software Foundation; either version 2 of
188 the License, or (at your option) any later version.
190 The ${PACKAGE_NAME} is distributed in the hope that it will be useful,
191 but WITHOUT ANY WARRANTY; without even the implied warranty of
192 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193 GNU General Public License for more details.