diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-11-20 22:16:08 -0800 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-11-20 22:16:08 -0800 |
commit | 1e9320e48e74ec9a36a77b609463c867e271f8b9 (patch) | |
tree | a3d5e0bc40c80733f93aa417bf33e19d410f7e84 | |
parent | 4c7dde9f519095f74d19982fb3c1d05fb1ff46be (diff) | |
download | libcap-1e9320e48e74ec9a36a77b609463c867e271f8b9.tar.gz |
Clean up libpsx.so execable mode.
The previous commit crossed the beams on libpsx.so and libcap.so
executable build. This commit decouples them.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | libcap/Makefile | 4 | ||||
-rw-r--r-- | libcap/psx_exec.c | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/libcap/Makefile b/libcap/Makefile index 05fa90d..df1267a 100644 --- a/libcap/Makefile +++ b/libcap/Makefile @@ -115,8 +115,8 @@ $(CAPLIBNAME) $(MAJCAPLIBNAME) $(MINCAPLIBNAME): $(CAPOBJS) $(CAPMAGICOBJ) ln -sf $(MINCAPLIBNAME) $(MAJCAPLIBNAME) ln -sf $(MAJCAPLIBNAME) $(CAPLIBNAME) -psx_magic.o: execable.h execable.c loader.txt - $(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(PSXTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" -c execable.c -o $@ +psx_magic.o: execable.h psx_exec.c loader.txt + $(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(PSXTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" -c psx_exec.c -o $@ $(PSXLIBNAME) $(MAJPSXLIBNAME) $(MINPSXLIBNAME): $(PSXOBJS) include/sys/psx_syscall.h $(PSXMAGICOBJ) $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJPSXLIBNAME) -o $(MINPSXLIBNAME) $(PSXOBJS) $(PSXMAGICOBJ) $(MAGIC) $(PSXLINKFLAGS) diff --git a/libcap/psx_exec.c b/libcap/psx_exec.c new file mode 100644 index 0000000..5e7a88f --- /dev/null +++ b/libcap/psx_exec.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "execable.h" + +SO_MAIN(int argc, char **argv) +{ + const char *cmd = "This library"; + if (argv != NULL && argv[0] != NULL) { + cmd = argv[0]; + } + printf("%s is the shared library version: " LIBRARY_VERSION ".\n" + "See the License file for distribution information.\n" + "More information on this library is available from:\n" + "\n" + " https://sites.google.com/site/fullycapable/\n", cmd); +} |