public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Environment variable equivalent of -L
@ 2022-03-28 14:04 Ian Pilcher
  2022-03-28 14:35 ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Pilcher @ 2022-03-28 14:04 UTC (permalink / raw)
  To: gcc-help

I am using GCC as a cross compiler, which results in some crazy long
command lines, because of all the directories that need to be passed
with the -I and -L options.

I've found the CPATH variable, for include file paths (-I equivalent),
but I haven't found anything that works like -L.  I tried LIBRARY_PATH,
but that didn't work.

Am I missing something, or is there just no such variable?

Thanks!

-- 
========================================================================
Google                                      Where SkyNet meets Idiocracy
========================================================================


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Environment variable equivalent of -L
  2022-03-28 14:04 Environment variable equivalent of -L Ian Pilcher
@ 2022-03-28 14:35 ` Segher Boessenkool
  2022-03-28 14:43   ` Ian Pilcher
  0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2022-03-28 14:35 UTC (permalink / raw)
  To: Ian Pilcher; +Cc: gcc-help

On Mon, Mar 28, 2022 at 09:04:53AM -0500, Ian Pilcher via Gcc-help wrote:
> I am using GCC as a cross compiler, which results in some crazy long
> command lines, because of all the directories that need to be passed
> with the -I and -L options.
> 
> I've found the CPATH variable, for include file paths (-I equivalent),
> but I haven't found anything that works like -L.  I tried LIBRARY_PATH,
> but that didn't work.
> 
> Am I missing something, or is there just no such variable?

You could use what in DOS was called a response file:
'@FILE'
     Read command-line options from FILE.  The options read are inserted
     in place of the original @FILE option.  If FILE does not exist, or
     cannot be read, then the option will be treated literally, and not
     removed.


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Environment variable equivalent of -L
  2022-03-28 14:35 ` Segher Boessenkool
@ 2022-03-28 14:43   ` Ian Pilcher
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Pilcher @ 2022-03-28 14:43 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

On 3/28/22 09:35, Segher Boessenkool wrote:
> You could use what in DOS was called a response file:
> '@FILE'
>       Read command-line options from FILE.  The options read are inserted
>       in place of the original @FILE option.  If FILE does not exist, or
>       cannot be read, then the option will be treated literally, and not
>       removed.

I could also add the paths that I need to a variable of my own invention
and pass that on the command line, e.g.:

   $ mips-openwrt-linux-musl-gcc ... -L${MY_LIB_PATHS} ...

I just seems a bit weird that GCC honors CPATH and friends for header
file locations, but there doesn't seem to be any equivalent for library
paths.

-- 
========================================================================
Google                                      Where SkyNet meets Idiocracy
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-28 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 14:04 Environment variable equivalent of -L Ian Pilcher
2022-03-28 14:35 ` Segher Boessenkool
2022-03-28 14:43   ` Ian Pilcher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).