summaryrefslogtreecommitdiff
path: root/m4/gst-makecontext.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/gst-makecontext.m4')
-rw-r--r--m4/gst-makecontext.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/m4/gst-makecontext.m4 b/m4/gst-makecontext.m4
new file mode 100644
index 0000000..467aa13
--- /dev/null
+++ b/m4/gst-makecontext.m4
@@ -0,0 +1,34 @@
+AC_DEFUN(GST_CHECK_MAKECONTEXT, [
+ AC_MSG_CHECKING([whether we have makecontext])
+ AC_TRY_RUN([
+#include <ucontext.h>
+#include <stdlib.h>
+
+void test(void)
+{
+ exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+ ucontext_t ucp;
+ int ret;
+
+ ret = getcontext(&ucp);
+ if(ret<0)exit(1);
+
+ ucp.uc_stack.ss_sp = malloc(65536);
+ ucp.uc_stack.ss_size = 65536;
+
+ makecontext(&ucp,test,0);
+ setcontext(&ucp);
+
+ exit(1);
+}
+], HAVE_MAKECONTEXT="yes", HAVE_MAKECONTEXT="no")
+AC_MSG_RESULT($HAVE_MAKECONTEXT)
+if test "$HAVE_MAKECONTEXT" == "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
+ [defined if we have makecontext ()])
+fi
+])