?RCS: $Id: i_ucontext.U 167 2013-05-08 17:58:00Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 2012 Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic License, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic License; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?MAKE:i_ucontext i_sys_ucontext: Inhdr cat echo n c rm \ +cc +ccflags +ldflags ?MAKE: -pick add $@ %< ?S:i_ucontext: ?S: This variable conditionally defines the I_UCONTEXT symbol, and indicates ?S: whether a C program may include to get ucontext_t. ?S:. ?S:i_sys_ucontext: ?S: This variable conditionally defines the I_SYS_UCONTEXT symbol, and ?S: indicates whether a C program may include to get ?S: ucontext_t. ?S:. ?C:I_UCONTEXT: ?C: This symbol, if defined, indicates to the C program that it should ?C: include to get at the user thread context. A portable ?C: program must also check I_SYS_UCONTEXT for inclusion, ?C: especially on OSX. ?C:. ?C:I_SYS_UCONTEXT: ?C: This symbol, if defined, indicates to the C program that it should ?C: include to get at the user thread context. A portable ?C: program must also check I_UCONTEXT for inclusion. ?C:. ?H:#$i_ucontext I_UCONTEXT /**/ ?H:#$i_sys_ucontext I_SYS_UCONTEXT /**/ ?H:. ?T:working : see if this is a ucontext.h system set ucontext.h i_ucontext eval $inhdr : see if this is a sys/ucontext.h system set sys/ucontext.h i_sys_ucontext eval $inhdr : when both ucontext.h and sys/ucontext.h are available, check which one works case "$i_ucontext$i_sys_ucontext" in "$define$define") echo " " $cat >try.c <<'EOC' #ifdef I_UCONTEXT #include #endif #ifdef I_SYS_UCONTEXT #include #endif int main(void) { static ucontext_t u; return (int) sizeof(u) & 0xff; } EOC $echo $n "Checking whether including alone works...$c" >&4 working= if $cc $ccflags -DI_UCONTEXT -o try try.c $ldflags >/dev/null 2>&1; then working="$define" fi case "$working" in "$define") echo " yes." >&4 i_sys_ucontext="$undef" ;; *) echo "no." >&4 echo " " $echo $n "Checking whether including works...$c" >&4 working= if $cc $ccflags -DI_SYS_UCONTEXT \ -o try try.c $ldflags >/dev/null 2>&1 then working="$define" fi case "$working" in "$define") echo " yes, ignoring ." >&4 i_ucontext="$undef" ;; *) echo " no, we'll include both then." >&4;; esac ;; esac ;; esac $rm -f try.*