How to Compile Static for Linux

There are no stupid questions, just stupid answers.
9 posts Page 1 of 1
practicing01
Posts: 35
Joined: Sat Apr 11, 2015 8:05 pm
by practicing01 » Sun Dec 15, 2019 10:42 pm
Hello, I can compile and run on Linux using the wiki instructions (slightly outdated dev branch). The executable directory has .so (shared object) sdl files. What steps must be taken to statically include all of the dependencies, so that users don't have to deal with that? Thanks for any help.
Bloodknight
Posts: 305
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Mon Dec 16, 2019 1:02 am
https://stackoverflow.com/questions/397 ... y-on-linux

Windows, sorry but options should be there if available Image

https://wiki.libsdl.org/FAQLinux

this last link should help you locate thing inside the cmake junk, or even the makefile itself, and might help understand the foirst link which seems heavy on theory as well as other sub dependencies as an extra problem.
Jason Campbell
Posts: 360
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Mon Dec 16, 2019 1:02 am
I was thinking about this awhile ago and I think the answer must be AppImage. I just haven't got around to delving deeper. There is also FlatPak and Snap but AppImage looks to be the most flexible and easy for the user but as I said, I haven't delved into it. Here are some links.

AppImage
https://appimage.org/

Flatpak
https://flatpak.org/

Snap App
https://snapcraft.io/


Edit: Maybe I didn't understand the question. Heh
Bloodknight
Posts: 305
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Mon Dec 16, 2019 1:09 am
I was suggesting earlier about dependency management being part of the install but apparently Godot and unity builds work on every distro flawlessly, so if Godot and unity do it I guess torque should too, tho i suspect the answer might be doing the same as Godot and unity which probably includes shipping half a gig of bloat :p or is that just unreal games :D
Jason Campbell
Posts: 360
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Mon Dec 16, 2019 1:35 am
I was thinking of distribution of aT3D game so that it would work on any distro out there. I imagine the dependencies wouldn't add much bloat. Many distros come with flatpak or snap app installed but that's why I was thinking AppImage since it runs without a client piece of software.

You can compile with all dependencies included?

I need to read more about that cause that would be great.
Bloodknight
Posts: 305
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Mon Dec 16, 2019 2:18 am
seems he has an issue with SDL specifically, which I read some time ago had some issues RE static linking, whether that exists still now I don't know, I suspect not given I have options for it again, I think is the base game is running on either 3.6 or 3.8 tho, I did the few links I found that seemed relevant, hopefully that helps, the answer may mean upgrading sdl for his own versions
practicing01
Posts: 35
Joined: Sat Apr 11, 2015 8:05 pm
by practicing01 » Mon Dec 16, 2019 5:41 am
Right now the issue is sdl and openal. I can get around sdl with a shell script that adds the exe directory to the path (which a t3d compile slaps a few sdl .so files into). Setting static sdl in cmake didn't work, it always forces dynamic. The magic that unity/Godot use, is what I want: I compile the game on my dev machine and distribute that to the user. I don't know how those engines do it but if it's something that can be done for t3d with a little effort, then would someone kindly point me to the documentation, please? Thanks for the replies.
Happenstance
Posts: 104
Joined: Sat Apr 11, 2015 9:08 pm
by Happenstance » Mon Dec 16, 2019 10:25 pm
Not sure about Unity, but Godot does it by including precompiled binaries for each supported platform as part of an "export template" package. When you 'compile' your game Godot just pulls out the corresponding binary from the export template and renames it for you. We could do something similar in Torque but it'd only be useful for people that work exclusively in TorqueScript. As soon as you modify the engine you have to recompile for (and on) every platform you want to support.
practicing01
Posts: 35
Joined: Sat Apr 11, 2015 8:05 pm
by practicing01 » Tue Dec 17, 2019 7:04 am
Downloaded the latest dev branch and am in the process of testing. It creates an openal .so which is good. I think the steam run-time can deal with the dependencies but I can't use that for itch.io.
9 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests