Opened 20 years ago

Closed 19 years ago

Last modified 9 years ago

#3061 closed defect (fixed)

BUG: xterm fails to compile on Tiger

Reported by: jcobleigh Owned by: pesco@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc: minskim@…
Port: xterm

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I tried to compile (and install) the xterm package on Tiger (OS X 10.4). During compilation, I get the following error:

   gcc -I. -I. -DHAVE_CONFIG_H  -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/X11R6/include -I/usr/X11R6/include  -I. -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I./exports/include/X11 -I/usr/X11R6/include -D__DARWIN__ -DNO_ALLOCA -DCSRG_BASED     -DXFREE86_FT2 -DUTMP  -DOSMAJORVERSION=8 -DOSMINORVERSION=0 -I/usr/X11R6/include  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=500 -DPROJECTROOT='"/usr/X11R6"' -D__vendorversion__='"Version 4.4.0 XFree86"'  -g -O2  -c ./main.c
./main.c: In function 'spawn':
./main.c:3760: error: too many arguments to function 'setpgrp'
./main.c:3762: error: too many arguments to function 'setpgrp'
make: *** [main.o] Error 1

Line 3760 is: setpgrp(0, 0);
Line 3762 is: setpgrp(0, pgrp);

Looking at what the preprocessor generated, it looks like this function is getting defined in /usr/include/unistd.h in an ifdef:

#if __DARWIN_UNIX03
pid_t    setpgrp(void) __DARWIN_ALIAS(setpgrp);
#else /* !__DARWIN_UNIX03 */
int      setpgrp(pid_t pid, pid_t pgrp);        /* obsoleted by setpgid() */
#endif /* __DARWIN_UNIX03 */

I am not a C expert, but it seems that depending on the value of __DARWIN_UNIX03, setpgrp can either take one argument or two arguments. However, I am not sure what is setting __DARWIN_UNIX03 and I don't know enough about gcc to get it to tell me this information.

Change History (7)

comment:1 Changed 20 years ago by jmpp@…

Owner: changed from darwinports-bugs@… to pesco@…

comment:2 Changed 20 years ago by snu@…

Summary: xterm fails to compile on TigerBUG: xterm fails to compile on Tiger

comment:3 Changed 19 years ago by minskim@…

The following patch will fix this problem.

--- main.c.orig	2005-05-02 19:38:24.000000000 -0500
+++ main.c
@@ -282,7 +282,7 @@ ttyslot()
 
 #else
 
-#ifdef __INTERIX
+#if defined(__INTERIX) || defined(__APPLE__)
 #define setpgrp setpgid
 #endif
 
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 19 years ago by minskim@…

Cc: minskim@… added

comment:5 Changed 19 years ago by minskim@…

The patch in the previous comment was applied in xterm-203. See Bug #3943.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 19 years ago by mww@…

Resolution: fixed
Status: newclosed

commited the patch from #3943;

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: xterm added
Note: See TracTickets for help on using tickets.