From xemacs-m  Mon Mar 24 15:40:04 1997
Received: from uni-kl.de (news.uni-kl.de [131.246.136.51])
	by xemacs.org (8.8.5/8.8.5) with SMTP id PAA17534
	for <xemacs-beta@xemacs.org>; Mon, 24 Mar 1997 15:40:02 -0600 (CST)
Received: from uklirb.informatik.uni-kl.de by news.uni-kl.de id aa27479;
          24 Mar 97 22:39 MET
Received: from gentzen.informatik.uni-kl.de by uklirb.informatik.uni-kl.de
          id aa04362; 24 Mar 97 22:30 MET
To: xemacs-beta@xemacs.org
CC: jaeger@informatik.uni-kl.de
Subject: XEmacs19.15beta 104: build failure on Linux, glibc2.0.90 (snapshot)
Date: 24 Mar 1997 22:21:30 +0100
From: jaeger@informatik.uni-kl.de
Message-ID:  <9703242230.aa04362@uklirb.informatik.uni-kl.de>


I patched up from beta 102 and got a build failure (see below).
Environment: Linux 2.0.29, i486, glibc 2.0.90 (snapshot)

Configured for `i486-unknown-linux2.0.29'.

  Where should the build process find the source code?
/mnt/xemacs/xemacs-19.15-betaXX
  What installation prefix should install use?            /usr
  What operating system and machine description files should XEmacs
use?
        `s/linux.h' and `m/intel386.h'
  What compiler should XEmacs be built with?              gcc -O3 -g
  Should XEmacs use the GNU version of malloc?            no
  (User chose not to use GNU allocators.)
  Should XEmacs use the relocating allocator for buffers? no
  What window system should XEmacs use?                   x11
  Where do we find X Windows header files?
/usr/X11R6/include
  Where do we find X Windows libraries?
/usr/X11R6/lib
  Compiling in support for XAUTH.
  Compiling in support for XPM.
  Compiling in support for X-Face headers.
  Compiling in support for GIF image conversion.
  Compiling in support for PNG image conversion.
  Compiling in native sound support.
  Compiling in support for Berkeley DB.
  Compiling in support for GNU DBM.
  Using the Lucid menubar.
  Using the Lucid scrollbar.
  Using the Athena dialog boxes.
  Compiling in extra code for debugging.

/mnt/xemacs/xemacs-19.15-betaXX/src/process.c: In function
`create_process':
/mnt/xemacs/xemacs-19.15-betaXX/src/process.c:980: too few arguments
to function `__bsd_getpgrp'

The problem seems to come from compiling with _BSD_SOURCE on linux.

Since we compile with _BSD_SOURCE the makro __FAVOR_BSD is defined on
Linux.
In systty.h we've got:
#if defined (USG) && !defined (GETPGRP_NEEDS_ARG)
#  if !defined (GETPGRP_NO_ARG)
#    define GETPGRP_NO_ARG
#  endif
#endif

I've convinced myself that GETPGRP_NO_ARG is defined for Linux.

But if we compile with _BSD_SOURCE we get an getpgrp with one
argument:
<unistd.h> from libc5 says:
#ifndef __FAVOR_BSD
/* Get the process group ID of the calling process.  */
extern __pid_t getpgrp __P ((void));
#else /* Favor BSD.  */
#define getpgrp(pid)    __getpgrp(pid)
#endif

<unistd.h> from glibc 2.1 will say (it does only in the snapshots so
far):
/* Get the process group ID of the calling process.  */
extern __pid_t getpgrp __P ((void));
/* The old BSD definition is a bit different.  */
extern __pid_t __bsd_getpgrp __P ((__pid_t __pid));
#ifdef __FAVOR_BSD
/* When we explicitely compile BSD sources use the BSD definition of
this
   function.  Please note that we cannot use parameters for the
macro.  */
#define getpgrp __bsd_getpgrp
#endif

I think we need to put
#if defined __GLIBC__ && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) ||
__GLIBC__ > 2)
# define GETPGRP_NEEDS_ARG
#endif
in linux.h

An alternative would be to use getpgid - we could even autodetect it
if the declaration would be the same everywhere.
/* Get the process group ID of the process matching PID.
   If PID is zero, the current process's process group ID
   is returned. */
extern __pid_t getpgid __P ((__pid_t __pid));


I've made the change to src/s/linux.h and got process.c compiled. I'll
tell more when the build finishes.

Andreas
--
 Andreas Jaeger   aj@arthur.pfalz.de    jaeger@informatik.uni-kl.de
  Altenwoogstr. 31      67655 Kaiserslautern, Germany
   Phone +49 631 3403051 Fax/Modem +49 631 3403052
    http://www.student.uni-kl.de/~ajaeger/

