Add helper function for building the LD_PRELOAD list for Steam's runtime

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2016-05-26 23:19:32 +01:00
parent 59565b0b46
commit 82a623f5b7
4 changed files with 25 additions and 0 deletions
+12
View File
@@ -10,6 +10,16 @@ AM_SILENT_RULES([yes])
LT_INIT([disable-static])
AC_CONFIG_MACRO_DIR([m4])
# emul32 directory. On Solus this is /usr/lib32. multiarch systems are likely
# using /usr/lib/i386-linux-gnu/
AC_ARG_WITH([emul32-libdir], AS_HELP_STRING([--with-emul32-libdir],
[the path in which 32-bit libraries are stored]), [emul32dir=${withval}],
[emul32dir="/usr/lib32"])
AC_SUBST(emul32dir)
AC_DEFINE_UNQUOTED(EMUL32LIBDIR, "$emul32dir",
[The location of 32-bit libraries in the OS configuration])
AC_CONFIG_FILES([Makefile])
@@ -26,6 +36,8 @@ AC_MSG_RESULT([
bindir: ${bindir}
datarootdir: ${datarootdir}
emul32-libdir: ${emul32dir}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
+6
View File
@@ -12,6 +12,7 @@
#include <assert.h>
#include <stdio.h>
#include "config.h"
#include "lsi.h"
bool lsi_config_load(__lsi_unused__ LsiConfig *config)
@@ -36,6 +37,11 @@ void lsi_config_load_defaults(LsiConfig *config)
config->use_native_runtime = true;
}
const char *lsi_preload_list()
{
return EMUL32LIBDIR "/libx11.so.6:" EMUL32LIBDIR "/libstdc++.so.6";
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
+6
View File
@@ -59,6 +59,12 @@ __lsi_inline__ static inline bool lsi_system_is_64bit(void)
return false;
}
/**
* Return the required preload list for running Steam via their runtime
* This is static .text - do not free
*/
const char *lsi_preload_list(void);
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
+1
View File
@@ -29,6 +29,7 @@ int main(__lsi_unused__ int argc, __lsi_unused__ char **argv)
fprintf(stderr, "emul32? %s\n", config.force_32 ? "yes" : "no");
fprintf(stderr, "native-runtime? %s\n", config.use_native_runtime ? "yes" : "no");
fprintf(stderr, "x86-64? %s\n", is_x86_64 ? "yes" : "no");
fprintf(stderr, "LD_PRELOAD=\"%s\"\n", lsi_preload_list());
return EXIT_FAILURE;
}