Article View: gnu.gcc.help
Article #53363Re: INCPATH and LIBPATH?
From: Gary S. Moss <moss>
Date: Thu, 13 Feb 1992 14:28
Date: Thu, 13 Feb 1992 14:28
39 lines
2925 bytes
2925 bytes
In article <1028@lysator.liu.se>, pen@lysator.liu.se (Peter Eriksson) writes: |> There is one thing I am missing from the otherwise nice Unix world that |> I grew accustomed to when in the PRIMOS world, and that is to be able to |> specify a default search path for <include> files and "-lfoo" libraries. |> |> I know that I can use "-I" and "-L" on the command line, but I think |> that it would be much better if there were a mechanism for handling |> this using environment variables when I always (or most of the time) |> have to add a directory to the search path. |> |> What do you folx think? I'm thinking of writing the code needed to |> implement this (easy to do in Gcc/cccp.c, haven't looked at the code |> for the ld linker). I think that depending on environment variables is a bad idea. The source code should compile correctly regardless; it is easy enough to define the compiler and loader flags in the makefile, cakefile, Imakefile, or whatever you use. In fact, good software distributions take care of this with a top-level configuration file. It is unlikely that using environment variables provides flexibility, typically you always use the same include and lib directories to compile a given program. Also, it would be a pain to have to change environment variables when compiling different executables, possibly in the same source tree. I have been bit many times by makefiles that specify "CC=cc" rather than /bin/cc when a BSD compiler was required over the System 5 flavor and my path had /usr/5bin ahead of /bin (forget why my PATH is that way, it gets complicated). The worst thing is that sometimes the program compiled, but didn't work right, the X11R5 server compiled for Sun 3s is an example that comes vividly to mind; when compiled with /usr/5bin/cc, it would freeze up as soon as one touched the mouse or keyboard. [Of course I used gcc 1.40 to compile it ultimately.] -Gary +-----------------------------------------------+------------------------+ | Gary Moss | Internet: moss@brl.mil | | Computer Scientist | Phone: 410 278-2979 | | Ballistic Research Laboratory | DSN: 298-2979 | | Aberdeen Proving Ground, Maryland, USA | Fax: 410 278-5058 | +-----------------------------------------------+------------------------+
Technical Details
Message-ID:
<18147@smoke.brl.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!uwm.edu!psuvax1!hsdndev!adm!smoke!brl.mil!mossReferences:
<1028@lysator.liu.se>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,d10ab7e54eef2618 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-02-13 07:09:25 PST Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!uwm.edu!psuvax1!hsdndev!adm!smoke!brl.mil!moss From: moss@brl.mil (Gary S. Moss <moss>) Newsgroups: gnu.gcc.help Subject: Re: INCPATH and LIBPATH? Keywords: feature gcc ld cpp Message-ID: <18147@smoke.brl.mil> Date: 13 Feb 92 14:28:04 GMT References: <1028@lysator.liu.se> Sender: news@smoke.brl.mil Reply-To: moss@brl.mil Organization: Ballistic Research Laboratory Lines: 39