autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_FUNC_GETPGRP and autoconf > 2.50


From: Artur Frysiak
Subject: AC_FUNC_GETPGRP and autoconf > 2.50
Date: Tue, 17 Jul 2001 14:26:07 +0200
User-agent: Mutt/1.3.18i

>From ChangeLog:
2001-06-18  Akim Demaille  <address@hidden>

        * acfunctions.m4 (AC_FUNC_CHOWN, AC_FUNC_CLOSEDIR_VOID)
        (AC_FUNC_GETPGRP, AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK)
        (AC_FUNC_MMAP, AC_FUNC_SELECT_ARGTYPES, _AC_FUNC_STAT)
        (AC_FUNC_UTIME_NULL): Use AC_INCLUDES_DEFAULT.
        Don't use AC_TRY_RUN, which double quotes, prefer AC_RUN_IFELSE,
        and either AC_LANG_SOURCE or AC_LANG_PROGRAM.

This change break AC_FUNC_GETPGRP.
On autoconf 2.50 result on my system is
grep GETPGRP ac250/config.h
#define GETPGRP_VOID 1
from config.log:
configure:1563: checking whether getpgrp takes no argument
configure:1628: gcc -o conftest -g -O2   conftest.c  >&5
configure:1631: $? = 0 
configure:1633: ./conftest
configure:1636: $? = 0 
configure:1649: result: yes

On autoconf 2.50c:
grep GETPGRP ac250c/config.h
/* #undef GETPGRP_VOID */
from config.log:
configure:2080: checking whether getpgrp takes no argument
configure:2144: gcc -o conftest -g -O2   conftest.c  >&5
configure: In function `main':
configure:2142: too many arguments to function `getpgrp'
configure:2144: too many arguments to function `getpgrp'
configure:2145: too many arguments to function `getpgrp'
configure:2161: too many arguments to function `setpgrp'
configure:2162: too many arguments to function `getpgrp'
configure:2147: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 2091 "configure"
#include "confdefs.h"
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h> 
#else
# if HAVE_STDLIB_H 
#  include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
#  include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif


/*
 * If this system has a BSD-style getpgrp(),
 * which takes a pid argument, exit unsuccessfully.
 *
 * Snarfed from Chet Ramey's bash pgrp.c test program
 */

int     pid;
int     pg1, pg2, pg3, pg4;
int     ng, np, s, child;

int
main ()
{
  pid = getpid ();
  pg1 = getpgrp (0);
  pg2 = getpgrp ();
  pg3 = getpgrp (pid);
  pg4 = getpgrp (1);

  /* If all of these values are the same, it's pretty sure that we're
     on a system that ignores getpgrp's first argument.  */
  if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
    exit (0);

  child = fork ();
  if (child < 0)
    exit(1);
  else if (child == 0)
    {
      np = getpid ();
      /*  If this is Sys V, this will not work; pgrp will be set to np
     because setpgrp just changes a pgrp to be the same as the
     pid.  */
      setpgrp (np, pg1);
      ng = getpgrp (0);        /* Same result for Sys V and BSD */
      if (ng == pg1)
    exit (1);
      else
    exit (0);
    }
  else
    {
      wait (&s);
      exit (s>>8);
    }
}
configure:2165: result: no

Best regards.
PS: My system:
$ /usr/share/automake/config.guess 
i686-pc-linux-gnu
-- 
Artur Frysiak
http://www.pld.org.pl/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]