[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_FUNC_SETPGRP fails to work properly when cross-compiling
From: |
Alvaro Soliverez |
Subject: |
AC_FUNC_SETPGRP fails to work properly when cross-compiling |
Date: |
Tue, 12 Feb 2013 20:42:44 -0300 |
User-agent: |
KMail/4.10 (Linux/3.7.6-22-desktop; KDE/4.10.0; x86_64; ; ) |
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.
address@hidden
Hei_Ku at FreeNode IRC
signature.asc
Description: This is a digitally signed message part.
- AC_FUNC_SETPGRP fails to work properly when cross-compiling,
Alvaro Soliverez <=