Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /usr dir to isolate self-built binaries and libs? #166

Open
MagicalDrizzle opened this issue Aug 30, 2024 · 5 comments
Open

Add /usr dir to isolate self-built binaries and libs? #166

MagicalDrizzle opened this issue Aug 30, 2024 · 5 comments

Comments

@MagicalDrizzle
Copy link

Currrently if you self-build a lot of packages - it can be tough to look inside the bin/lib/share etc folder and realize which file is yours and/or remove them to restore w64devkit to stock - especially since it's not easy to undo a make install. It might be a good idea to follow FHS and put all usermade packages in /usr or /usr/local?

@Peter0x44
Copy link
Contributor

I agree. But how do we get GCC to search in these places?

I'm sure it's possible. I just don't know how.

@skeeto
Copy link
Owner

skeeto commented Sep 3, 2024 via email

@rapte
Copy link

rapte commented Sep 4, 2024

This is a snippet from my .profile file for SDL2, SFML and RayLib
libraries added. We only need to ensure that the folders where
the libraries are copied are in the correct $ARCH folders . I am
able to use the correct 32-bit or 64-bit libraries with this
setting with a single .profile in a single $HOME folder defined
in the w64devkit.ini file for 32 and 64 bit toolkits. Just in
case anyone should find it useful.

`
export ARCH="$(gcc -dumpmachine)"
export SDK="$HOME/SDK"

unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset CPATH
unset LIBRARY_PATH
unset LD_LIBRARY_PATH
unset PKG_CONFIG_PATH

export CPATH="$CPATH;$SDK/SDL2/$ARCH/include"
export LIBRARY_PATH="$LIBRARY_PATH;$SDK/SDL2/$ARCH/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;$SDK/SDL2/$ARCH/bin"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH;$SDK/SDL2/$ARCH/lib/pkgconfig"

export SFML_VERSION="2.6.1"
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH;$SDK/SFML-$SFML_VERSION/$ARCH/include"
export LIBRARY_PATH="$LIBRARY_PATH;$SDK/SFML-$SFML_VERSION/$ARCH/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;$SDK/SFML-$SFML_VERSION/$ARCH/bin"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH;$SDK/SFML-$SFML_VERSION/$ARCH/lib/pkgconfig"

export RAYLIB_VERSION="5.0"
export CPATH="$CPATH;$SDK/raylib-$RAYLIB_VERSION/$ARCH/include"
export LIBRARY_PATH="$LIBRARY_PATH;$SDK/raylib-$RAYLIB_VERSION/$ARCH/lib"

PATH="$PATH;$LD_LIBRARY_PATH"
`

@skeeto
Copy link
Owner

skeeto commented Sep 5, 2024 via email

@rapte
Copy link

rapte commented Sep 6, 2024

Thank you @skeeto for this super portable toolchain.

It is true that I use the LD_LIBRARY_PATH just as a naming convention. But the reason
I export the paths to this variable and then update it to the path is because I do
not need to copy the .dll files of the library in my project when the I run the compiled
binary which are linked dynamically from the shell. I find it very convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants