Solved How to make changes to include and lib paths permanent?

Hi,

i am using lang/gcc to compile a 3rd party library which depends on OpenGL (Irrlicht).

Since /usr/local/include and /usr/local/lib is not in the default search path, I have to enter the following commands so that gcc can find them:

export CPLUS_INCLUDE_PATH=/usr/local/include/:${CPLUS_INCLUDE_PATH}
export LIBRARY_PATH=/usr/local/lib/:${LIBRARY_PATH}


I want to make these changes permanent. But where is the best place for this?
I've seen /etc/default/rc.conf but i think there's a better place.
 
I've seen /etc/default/rc.conf but i think there's a better place.

rc.conf is intended only for variables to manipulate the startup behavior of the system. Besides, /etc/defaults/rc.conf should not touched at all, as the note explicitly point it out: You should not edit this file!

As SKull already mention it, the individual users shell's startup file is one of the places to put the path variable. Another place is the users ~/.login_conf file ( after editing run cap_mkdb(1) ).

If you want a system-wide environment setting for every user for bourne again shells and sh(1): /etc/profile, /etc/csh.cshrc for csh/tcsh.

If you prefer to set the variable only for certain users, create a login class in /etc/login.conf ( login.conf(5) ), set the user environment variables, run cap_mkdb(1), make the user member of the login class [1].

[1] chpass(1), look for "Class". Add a class line, set the class name used in login.conf. vi(1) is the editor, unless changed by environment variable.
 
Back
Top