ruby-configure.patch 842 B

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