The executable will search for .so files not inside predefined paths like /usr/lib but inside it’s current directory. You may theoretically put . as an argument to configure, but it converts that into an absolute path, snd libtool and linker fail when encountering relative paths inside shared library dependencies.
I see what you mean, very clever solution if a program is using the configure prefix by compiling it into the binary.
That can’t be very common though is it? Usually the configure prefix is just used by make install to install the binaries into the prefix. If the compiled program needs to know where it is installed it can read argv[0].
I am using this myself in Android app, where you can write files only inside /data/data/your.app.id/
So naturally, if you want to publish a different app, your.app.id will be different, so you need to recompile all your Linux tools that you bundle inside your app.
If you are not running your Linux tools on Android, you’d probably be better off using Docker or a chroot.
Do you know how to build portable executables?
configure --prefix=/proc/self/pwdIt even works in .so files and libtool.
May I have the explanation?
The executable will search for .so files not inside predefined paths like /usr/lib but inside it’s current directory. You may theoretically put
.as an argument toconfigure, but it converts that into an absolute path, snd libtool and linker fail when encountering relative paths inside shared library dependencies.How would this differ from
--prefix=$(pwd)?--prefix=$(pwd)is resolved at compile time. If you move your compiled .so files to a different directory, they stop working.I see what you mean, very clever solution if a program is using the configure prefix by compiling it into the binary.
That can’t be very common though is it? Usually the configure prefix is just used by
make installto install the binaries into the prefix. If the compiled program needs to know where it is installed it can readargv[0].Have you seen this used somewhere?
I am using this myself in Android app, where you can write files only inside
/data/data/your.app.id/So naturally, if you want to publish a different app,
your.app.idwill be different, so you need to recompile all your Linux tools that you bundle inside your app.If you are not running your Linux tools on Android, you’d probably be better off using Docker or a chroot.