aboutsummaryrefslogtreecommitdiff
path: root/package/ruby/ruby-configure.patch
blob: 0077a676165260fd198a620c6bea634f016e64a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff -Nura ruby-1.9.2-p0.orig/configure.in ruby-1.9.2-p0/configure.in
--- ruby-1.9.2-p0.orig/configure.in	2010-08-14 05:11:59.000000000 -0300
+++ ruby-1.9.2-p0/configure.in	2010-11-04 15:46:22.478191926 -0300
@@ -1410,7 +1410,25 @@
 fi
 
 AC_FUNC_GETPGRP
-AC_FUNC_SETPGRP
+
+dnl AC_FUNC_SETPGRP does not work if cross compiling
+dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
+if test "$cross_compiling" = no; then
+  AC_FUNC_SETPGRP
+else
+  AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
+    [AC_TRY_COMPILE([
+#include <unistd.h>
+], [
+  if (setpgrp(1,1) == -1)
+    exit (0);
+  else
+    exit (1);
+], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
+if test $ac_cv_func_setpgrp_void = yes; then
+  AC_DEFINE(SETPGRP_VOID, 1)
+fi
+fi
 
 AC_C_BIGENDIAN
 AC_C_CONST