1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/autoconf/hotfixes.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,24 @@ 1.4 +dnl This Source Code Form is subject to the terms of the Mozilla Public 1.5 +dnl dnl License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +dnl dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +dnl Set of hotfixes to address issues in autoconf 2.13 1.9 + 1.10 +dnl Divert AC_CHECK_FUNC so that the #includes it uses can't interfere 1.11 +dnl with the function it tests. 1.12 +dnl So, when testing e.g. posix_memalign, any #include that AC_CHECK_FUNC 1.13 +dnl prints is replaced with: 1.14 +dnl #define posix_memalign innocuous_posix_memalign 1.15 +dnl #include "theinclude" 1.16 +dnl #undef posix_memalign 1.17 +dnl This avoids double declaration of that function when the header normally 1.18 +dnl declares it, while the test itself is just expecting the function not to be 1.19 +dnl declared at all, and declares it differently (which doesn't matter for the 1.20 +dnl test itself). 1.21 +dnl More recent versions of autoconf are essentially doing this. 1.22 +define([ac_cv_func_], [ac_cv_func2_])dnl 1.23 +define([_AC_CHECK_FUNC],defn([AC_CHECK_FUNC]))dnl 1.24 +define([AC_CHECK_FUNC], [dnl 1.25 +patsubst(_AC_CHECK_FUNC($@), [#include.*$], [#define $1 innocuous_$1 1.26 +\& 1.27 +#undef $1])])dnl