sysklogd: fix build on musl
[buildroot-gz.git] / package / gauche / 0002-gc-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch
blob6cc065693fd35117c242a800336c230fe83d644e
1 gc/configure.ac: add check for NO_GETCONTEXT definition
3 This patch is ported from bdwgc package. Since Gauche uses an internal
4 copy of the boehm gc code, it is affected by the same problem.
6 Both configure and configure.ac are modified because autoreconf fails
7 due to an incompatibility with the version of the autotools used by
8 Buildroot.
10 Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
12 Original credits of patch in bdwgc package:
13 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
14 [yann.morin.1998@free.fr: add a comment, change variable name, use
15 AS_IF, remove debug traces, use AC_CHECK_FUNCS (as suggested by
16 Thomas)]
17 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
18 Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
20 diff -ur a/gc/configure b/gc/configure
21 --- a/gc/configure 2015-11-12 21:41:02.394822056 +0900
22 +++ b/gc/configure 2015-11-12 22:04:14.655157423 +0900
23 @@ -16153,6 +16153,23 @@
24 $as_echo "$ac_cv_fno_strict_aliasing" >&6; }
27 +# Check for getcontext (uClibc can be configured without it, for example)
28 +for ac_func in getcontext
29 +do :
30 + ac_fn_c_check_func "$LINENO" "getcontext" "ac_cv_func_getcontext"
31 +if test "x$ac_cv_func_getcontext" = xyes; then :
32 + cat >>confdefs.h <<_ACEOF
33 +#define HAVE_GETCONTEXT 1
34 +_ACEOF
36 +fi
37 +done
39 +if test "$ac_cv_func_getcontext" = "no"; then :
40 + CFLAGS="$CFLAGS -DNO_GETCONTEXT"
41 + CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"
42 +fi
44 case "$host" in
45 # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64
46 # and unnecessary everywhere.
47 diff -ur a/gc/configure.ac b/gc/configure.ac
48 --- a/gc/configure.ac 2015-11-12 22:31:44.851510997 +0900
49 +++ b/gc/configure.ac 2015-11-12 22:33:39.292191227 +0900
50 @@ -459,6 +459,12 @@
51 AC_MSG_RESULT($ac_cv_fno_strict_aliasing)
54 +# Check for getcontext (uClibc can be configured without it, for example)
55 +AC_CHECK_FUNCS([getcontext])
56 +AS_IF([test "$ac_cv_func_getcontext" = "no"],
57 + [CFLAGS="$CFLAGS -DNO_GETCONTEXT"
58 + CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"])
60 case "$host" in
61 # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64
62 # and unnecessary everywhere.