How to compile minetest with libraries packaged w/ excecutable

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

How to compile minetest with libraries packaged w/ excecutable

by Traxie21 » Tue Mar 26, 2013 12:20

I'd like to compile Minetest on Linux, but I want to compile it with the required libraries included wuth the excecutable, similar to how Windows does ir.

Any tips/instructions?
NOTE: I will be compiling on a remote server.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Wed Mar 27, 2013 04:34

The easiest way would probably be to link the library, then analyze its dependencies, copy the libraries to the application directory somewhere, and modify the paths the executable uses to search for libraries (probably to include a relative path). Use "ldd" to determine what libraries an executable or library depends on, and where they were found at link time. To change where the system looks for the libraries, see http://en.wikipedia.org/wiki/Rpath. It would probably be helpful to create a launcher script to set variables like LD_LIBRARY_PATH and/or (if you change the executable's built-in search path) the current working directory before launching the actual application binary. You'll probably want to exclude libraries that will be found in default locations on just about every system (probably meaning anything under /lib instead of /usr/lib).

There are other ways, but they are often going to involve changing the build system. That's probably going to mean familiarizing yourself with cmake, make, g++, and/or Minetest's particular makefiles. So I suggest trying the above first.
Last edited by prestidigitator on Wed Mar 27, 2013 04:41, edited 1 time in total.
 


Return to Minetest General

Who is online

Users browsing this forum: Bing [Bot] and 16 guests