Note
This is a note currently nothing about about the programming, but the use of C project.
1 $HOME/.local installation with Autotools
Normally, project with GNU Autotools, you can build and install to specified location, for example
% ./configure --prefix=$HOME/.local % make % make install
Which installs the files to $HOME/.local other than commonly default /usr/local. On most distributions, you shouldnt have issues with /usr/local installation, not just the executables, but also the libraries, pkg-config, linking, they all should be configured system-wide.
However, its not the case for user home installation, you will need to take some steps to ensure things can be found.
1.1 pkg-config
export LD_LIBRARY_PATH=$HOME/.local/lib export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig:/usr/lib64/pkgconfig
LD_LIBRARY_PATH makes sure any shared libraries are linked during the compilation can be found when you execute the program.
PKG_CONFIG_PATH isnt for additional paths, so you still need to provide the system pkg-config locations.
1.2 configure
When startup, continues sources prefix/share/config.site, if found, prefix is either default or one you specify with --prefix. In my case, it is $HOME/.local/share/config.site and I have the following content:
CPPFLAGS=-I$HOME/.local/include LDFLAGS=-L$HOME/.local/lib
They will make sure the header files can be found and linker knows there the shared libraries are stored.