Hello,
I'm running autoconf, and cross-compiling for Android.

I ran into an error with AC_FUNC_SETPGRP, and found a fix had already been 
reported in 
Debian.

Here's the reported bug in Debian: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=341256

The proposed patch to configure file works, but it would be nice to have 
AC_FUNC_SETPGRP 
work without any need for workarounds.

Here is an excerpt of the patch to configure. I have no knowledge of the 
internals in autoconf, 
so I can't tell how to patch AC_FUNC_SETPGRP, but I hope this gives a hint.

 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


Regards,
Alvaro



-- 
Alvaro Soliverez
Senior Software Engineer
Collabora Ltd.
alvaro.solive...@collabora.co.uk
Hei_Ku at FreeNode IRC

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to