From: Paul Eggert Date: Thu, 14 Feb 2013 07:28:21 +0000 (-0800) Subject: AC_FUNC_SETPGRP: work even when cross-compiling X-Git-Tag: v2.69b~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c048e2f9f387f01e8f9254f800b909cabd28672;p=thirdparty%2Fautoconf.git AC_FUNC_SETPGRP: work even when cross-compiling * lib/autoconf/functions.m4 (AC_FUNC_SETPGRP): Use AC_COMPILE_IFELSE rather than AC_RUN_IFELSE. Problem reported by Alvaro Soliverez in . --- diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 05f59bdcc..1b566410e 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -1518,15 +1518,13 @@ rm -f conftest* # --------------- AC_DEFUN([AC_FUNC_SETPGRP], [AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void, -[AC_RUN_IFELSE( -[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], -[/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1;])], - [ac_cv_func_setpgrp_void=no], - [ac_cv_func_setpgrp_void=yes], - [AC_MSG_ERROR([cannot check setpgrp when cross compiling])])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static int (*p) (void) = setpgrp;]], + [[return setpgrp ();]])], + [ac_cv_func_setpgrp_void=yes], + [ac_cv_func_setpgrp_void=no])]) if test $ac_cv_func_setpgrp_void = yes; then AC_DEFINE(SETPGRP_VOID, 1, [Define to 1 if the `setpgrp' function takes no argument.])