1 dnl ---------------------------------------------------------------------------
2 dnl AM_WXCONFIG_LARGEFILE()
4 dnl Test that wxWidgets is built with support for large-files. If not
5 dnl configure is terminated.
6 dnl ---------------------------------------------------------------------------
7 AC_DEFUN([AM_WXCONFIG_LARGEFILE],
11 dnl Backup current flags and setup flags for testing
12 __CPPFLAGS=${CPPFLAGS}
13 CPPFLAGS=${WX_CPPFLAGS}
15 AC_MSG_CHECKING(that wxWidgets has support for large files)
20 #if !HAVE_LARGEFILE_SUPPORT && !defined(_LARGE_FILES) && !defined(__WXMSW__)
21 #error No LargeFile support!;
27 if test "x${NO_LF}" != "x";
31 Support for large files in wxWidgets is required by aMule.
32 To continue you must recompile wxWidgets with support for
39 dnl Restore backup'd flags
40 CPPFLAGS=${__CPPFLAGS}
46 dnl --------------------------------------------------------------------------
48 dnl --------------------------------------------------------------------------
50 AC_DEFUN([CHECK_CCACHE],
52 if test x$ccache_prefix == x ; then
53 ccache_full=$(which ccache)
54 ccache_prefix=$(dirname ${ccache_full})
56 $ccache_prefix/ccache -V > /dev/null 2>&1
58 if test "$CCACHE" != 0; then
63 AC_MSG_CHECKING([for ccache presence])
64 AC_MSG_RESULT($result)
66 AC_SUBST(ccache_prefix)
70 AC_DEFUN([AM_OPTIONS_CCACHE_PFX],
75 [--with-ccache-prefix=PREFIX],
76 [prefix where ccache is installed])],
77 [ccache_prefix="$withval"],
82 dnl ----------------------------------------------------
84 dnl check if bfd.h is on the system and usable
85 dnl ----------------------------------------------------
88 AC_MSG_CHECKING([for bfd])
90 LIBS="-lbfd -liberty $LIBS"
96 char *dummy = bfd_errmsg(bfd_get_error());
100 BFD_FLAGS="-DHAVE_BFD"
101 BFD_LIB="-lbfd -liberty"
105 bfd.h not found or unusable, please install binutils development
106 package if you are a developer or want to help testing aMule])
114 dnl ----------------------------------------------------
116 dnl check if autopoint is installed and fail if not
117 dnl ----------------------------------------------------
118 AC_DEFUN([CHECK_AUTOPOINT],
121 AC_MSG_CHECKING([for autopoint])
123 autopoint_version=`autopoint --version | head -n 1 | sed -e 's/.*[[^0-9.]]\([[0-9]]\{1,\}\(\.[[0-9]]\{1,\}\)\{1,2\}\)[[^0-9.]]*/\1/'`
124 if test x$autopoint_version != x; then
132 AC_MSG_RESULT($result ($autopoint_version))
133 if test x$result = xno; then
134 AC_MSG_NOTICE([You need to install GNU gettext/gettext-tools to compile aMule with i18n support])
136 AC_SUBST(HAVE_GETTEXT)
140 dnl ----------------------------------------------------
141 dnl CHECK_FLEX_EXTENDED
142 dnl check if flex can produce header files
143 dnl ----------------------------------------------------
144 AC_DEFUN([CHECK_FLEX_EXTENDED],
147 AC_MSG_CHECKING([for extended flex capabilities])
149 extended_flex=`flex --help | grep header-file`
150 if test x"$extended_flex" != x""; then
156 HAVE_FLEX_EXTENDED=$result
158 AC_MSG_RESULT($result)
160 if test x$result = xno; then
161 AC_MSG_NOTICE([Your flex version doesn't support --header-file flag. This is not critical, but an upgrade is recommended ])
164 AC_SUBST(HAVE_FLEX_EXTENDED)
169 dnl ----------------------------------------------------
171 dnl Checks for broken exception-handling. This is needed
172 dnl because exception handling is broken for some archs/
174 dnl ----------------------------------------------------
175 AC_DEFUN([CHECK_EXCEPTIONS],
177 AC_MSG_CHECKING([for exception-handling])
194 AC_MSG_ERROR([Exception handling does not work. Broken compiler?])
196 AC_MSG_RESULT([undeterminable])
198 Cross-compilation detected, so exception handling cannot be tested.
199 Note that broken exception handling in your compiler may lead to
200 unexpected crashes.])
206 dnl ---------------------------------------------------------------------------
207 dnl GENERATE_MANS_TO_INSTALL(TESTNAME, BASENAMEPATH)
209 dnl This function will generate the list of manpages to be installed.
211 dnl TESTNAME is the name of a variable that'll evaluate to yes if this
212 dnl set of manpages need installing. The list of files will be returned in
213 dnl the TESTNAME_MANPAGES variable.
215 dnl BASENAMEPATH is the path and basename of the manpages we test for, relative
216 dnl to the package root (top_srcdir)
217 dnl ---------------------------------------------------------------------------
218 AC_DEFUN([GENERATE_MANS_TO_INSTALL],
220 if test "$[]$1" == "yes"; then
221 if test "$LINGUAS" = ""; then
222 $1_MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g'`
224 $1_MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g' | grep $Generate_Langs `
225 $1_MANPAGES="`basename $2.1` $[]$1_MANPAGES"
227 $1_MANPAGES=`echo $[]$1_MANPAGES | tr -d '\n'`
231 AC_SUBST($1_MANPAGES)
235 dnl ---------------------------------------------------------------------------
236 dnl AC_CHECK_REGEX([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
238 dnl This function will test the existance of a POSIX compliant regex library.
239 dnl ---------------------------------------------------------------------------
240 AC_DEFUN([AC_CHECK_REGEX],
242 AC_MSG_CHECKING([for a POSIX compliant regex library])
244 for lib in '' -lgnurx -lregex; do
252 regcomp(&preg, "", REG_EXTENDED);
254 regexec(&preg, "", 0, pmatch, 0);
265 AC_MSG_RESULT([$regex_found])
266 AS_IF([test $regex_found = yes],
271 AC_SUBST([REGEX_LIB])
275 dnl ---------------------------------------------------------------------------
278 dnl This function will test the header <cxxabi.h> and __cxxabiv1::__cxa_demangle()
279 dnl ---------------------------------------------------------------------------
280 AC_DEFUN([CHECK_CXXABI],
283 AC_MSG_CHECKING([for <cxxabi.h> and __cxa_demangle()])
289 char * demangled = abi::__cxa_demangle("", 0, 0, &status);
290 std::type_info *ti = abi::__cxa_current_exception_type();
293 AH_TEMPLATE([HAVE_CXXABI], [Define to 1 if you have the <cxxabi.h> header which declares abi::__cxa_demangle()])
294 AC_DEFINE([HAVE_CXXABI])
303 dnl ---------------------------------------------------------------------------
306 dnl This function will test the header <execinfo.h> and backtrace()
307 dnl ---------------------------------------------------------------------------
308 AC_DEFUN([CHECK_EXECINFO],
310 AC_MSG_CHECKING([for <execinfo.h> and backtrace()])
313 #include <execinfo.h>
316 int n = backtrace(&bt, 1);
317 const char **bt_syms = backtrace_symbols(bt, n);
320 AH_TEMPLATE([HAVE_EXECINFO], [Define to 1 if you have the <execinfo.h> header which declares backtrace()])
321 AC_DEFINE([HAVE_EXECINFO])