You are not logged in.

#1 2019-06-13 00:47:45

BobCollins
Member
From: Silicon Valley
Registered: 2019-06-13
Posts: 6

Proper (suggested?) location of the setting of GCC env variables

From my memory on previous Unix systems, the environment variables for the compiler such as CC, CPATH, etc. were set at the system level.

While reading the fine wiki, it appears that a (the?) proper location to set them might be as a separate .sh file in /etc/profile.d/

I know they can be set most anywhere and work, be I would like to know where is recommended on Arch Linux.

Thanks,

Bob Collins
Sunnyvale CA USA

Offline

#2 2019-06-13 01:00:30

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Proper (suggested?) location of the setting of GCC env variables

BobCollins wrote:

were set at the system level.

BobCollins wrote:

a separate .sh file in /etc/profile.d/

These are the same thing.

Offline

#3 2019-06-13 01:06:45

BobCollins
Member
From: Silicon Valley
Registered: 2019-06-13
Posts: 6

Re: Proper (suggested?) location of the setting of GCC env variables

Allan wrote:
BobCollins wrote:

were set at the system level.

BobCollins wrote:

a separate .sh file in /etc/profile.d/

These are the same thing.

Allen, on my computer, I don't currently see (printenv) these environment variables being set. I listed the /etc/profile.d/ directory as a POSSIBLE place I could set them. There is no file in my /etc/profile.d/ directory which sets the compiler environment variables.

Offline

#4 2019-06-13 01:43:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Proper (suggested?) location of the setting of GCC env variables

Then none are set.  What's the question here?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-06-13 04:41:10

BobCollins
Member
From: Silicon Valley
Registered: 2019-06-13
Posts: 6

Re: Proper (suggested?) location of the setting of GCC env variables

QUESTION: Where should I set the compiler environment variables? It there a standard location? Is there a package I missed that should have done it for me?

Trilby wrote:

Then none are set.  What's the question here?

I guess I violated forum rule #1—ask the question first and clear. All caps?

Offline

#6 2019-06-13 05:47:34

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Proper (suggested?) location of the setting of GCC env variables

BobCollins wrote:

I listed the /etc/profile.d/ directory as a POSSIBLE place I could set them. There is no file in my /etc/profile.d/ directory which sets the compiler environment variables.

So put one there...

Offline

#7 2019-06-13 07:30:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,423

Re: Proper (suggested?) location of the setting of GCC env variables

You might want to clarify your exact intention, what do you want to set, and why and for what purpose. As mentioned globally setting variables happens at the location mentioned.

But if your actual question is where these flags come from when using makepkg, you will want to read https://wiki.archlinux.org/index.php/Ma … d_binaries

Offline

#8 2019-06-13 11:25:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Proper (suggested?) location of the setting of GCC env variables

BobCollins wrote:

QUESTION: Where should I set the compiler environment variables?

But this was answered in the first response by Allan.  Then you noted that there were no environment variables set.  Certainly this is a true statement, but it suggests that your question wasn't completely answered or that you are still unclear about something.  What remaining uncertainty do you have?

Create a .sh file in /etc/profile.d if you'd like to set those variables system-wide.  You have not yet done so, so as you note, those environment variables do not yet exist.  This is normal.  If you want them set, set them.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB