Make Steam binary location configurable

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2016-05-27 01:36:55 +01:00
parent 357bb77c48
commit f294cbc504
2 changed files with 17 additions and 5 deletions
+9
View File
@@ -27,6 +27,14 @@ else
use_new_abi="no"
fi
# Shadow location of real Steam
AC_ARG_WITH([real-steam-binary], AS_HELP_STRING([--with-real-steam-binary],
[the real Steam binary to use]), [steambin=${withval}],
[steambin="$libdir/steam/steam"])
AC_SUBST(steambin)
AC_DEFINE_UNQUOTED(STEAM_BINARY, "$steambin",
[The location of the real Steam binary])
AC_OUTPUT
AC_MSG_RESULT([
@@ -41,6 +49,7 @@ AC_MSG_RESULT([
datarootdir: ${datarootdir}
New C++ ABI: ${use_new_abi}
Real Steam binary: ${steambin}
compiler: ${CC}
cflags: ${CFLAGS}
+8 -5
View File
@@ -11,17 +11,18 @@
#define _GNU_SOURCE
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "config.h"
#include "lsi.h"
/**
* Temporary.
*/
#define STEAM_BIN "/usr/bin/steam"
#define EMUL32BIN "/usr/bin/linux32"
int main(int argc, char **argv)
@@ -58,12 +59,12 @@ int main(int argc, char **argv)
if (config.force_32 && is_x86_64) {
exec_command = EMUL32BIN;
n_argv[0] = EMUL32BIN;
n_argv[1] = STEAM_BIN;
n_argv[1] = STEAM_BINARY;
off = 1;
} else {
/* Directly call STEAM_BIN */
exec_command = STEAM_BIN;
n_argv[0] = STEAM_BIN;
/* Directly call STEAM_BINARY */
exec_command = STEAM_BINARY;
n_argv[0] = STEAM_BINARY;
}
/* Point arguments to arguments passed to us */
@@ -74,6 +75,8 @@ int main(int argc, char **argv)
/* Go execute steam. */
if (execv(exec_command, (char **)n_argv) < 0) {
/* TODO: Use Zenity when we have a UI */
fprintf(stderr, "Failed to launch Steam: %s [%s]\n", strerror(errno), STEAM_BINARY);
return EXIT_FAILURE;
}
}