[Top][All Lists]

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

Command line variables and the environment

From: John David Anglin
Subject: Command line variables and the environment
Date: Tue, 16 Jan 2001 12:43:15 -0500 (EST)

Gnu make by default exports make variables passed on the command line to
the environment.  This presents a problem in processing complex Makefiles
on systems with a small ARG_MAX.  In particular, this is a problem when
variables are passed on the command line to sub-makes.  This places
unnecessary variables into the environment and may cause other commands
which use the environment for passing information to fail.  The particular
problem is the gcc Makefile when used under ultrix which has an ARG_MAX
of 10240.

I have found that:

1)      `unexport' by itself doesn't unexport command line variables.

2)      `unexport VARIABLE' will unexport VARIABLE when passed on the command

3)      Some reduction in the size of the environment exported can be achieved
        by passing `MAKEOVERRIDES=' on the command line.  This prevents
        the command line variables from being put into MAKEFLAGS.

Here are the possible solutions that I see:

1)      Change the default behaviour so that command line variables are
        not exported by default.  If I want a variable exported to the
        environment, there are a variety of ways to do this before the
        sub-make is executed.

2)      Add a make option to change the above default.

3)      Parse MAKEFLAGS to determine the variables passed on the command line
        and unexport them.  This make be tricky to do in a manner which is

Does anybody have another solution?

J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

reply via email to

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