Bug 83000 - portmap Makefile SYS variable usage breaks compile
Bug#: 83000 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: net-fs@gentoo.org Reported By: mihailim@gmail.com
Component: Core system
URL:  http://forums.gentoo.org/viewtopic-t-299090.html
Summary: portmap Makefile SYS variable usage breaks compile
Keywords:  
Status Whiteboard: 
Opened: 2005-02-22 13:27 0000
Description:   Opened: 2005-02-22 13:27 0000
The net-nds/portmap Makefile contains the following snippet around line 110:

COPT    = $(CONST) -Dperror=xperror $(CHECK_PORT) \
        $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \
        $(LOOPBACK) $(SETPGRP)

If the user has the environment variable SYS set to anything besides whitespace, the compile bombs out. Examples:

    http://forums.gentoo.org/viewtopic-t-299090.html
    http://bugs.gentoo.org/show_bug.cgi?id=81430

I haven't seen any situation yet where it would be useful for a Gentoo Linux system to let the Makefile blindly pull this in from the environment, but I've encountered reports of this type of problem a few times already. So it would seem the default behavior should be changed to *not* pull in $(SYS) from the environment since it's a variable name likely to be used.
I think we should patch portmap's Makefile to either use a different name there, or to simply not use it at all. I'm not sure about the implications of not using SYS on a Solaris system, but since Portaris is very much under work I don't think it should be a blocker.

Reproducible: Always
Steps to Reproduce:
SYS="whatever" emerge net-nds/portmap
Actual Results:  
Compile fails with "cannot specify -o with -c or -S and multiple compilations"

------- Comment #1 From Mihai Limbasan 2005-02-22 13:30:33 0000 -------
I forgot an additional argument for patching it: The resulting errors give no
clue whatsoever to the typical user as to the root cause of the problem and to
what one should do to fix it. Tracking it down requires an unpack step and an
understanding on Makefile and compiler command line syntax. That's a no-no.

------- Comment #2 From Mihai Limbasan 2005-02-22 13:42:10 0000 -------
Created an attachment (id=51900) [details]
Patch renaming $(SYS)

This patch alters the Makefile usage of the environment variable SYS to
GLOCAL_SYS.

------- Comment #3 From Mihai Limbasan 2005-02-22 13:42:34 0000 -------
Created an attachment (id=51901) [details]
Patch to ebuild to use portmap-5b-renamesysvar.patch

------- Comment #4 From SpanKY 2005-02-22 14:36:03 0000 -------
deleted the variable all together since the makefile doesnt use it at all