From f69db0983a2f435e7a0147bf8ad82b16196d4397 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 22 Jan 2019 21:15:38 -0800 Subject: Added some Makefile options to build a packaging friendly executable --- util.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index e54e8ea..50f79ee 100644 --- a/util.c +++ b/util.c @@ -875,14 +875,18 @@ char const *get_userdata_dir() char *read_bundled_file(char *name, uint32_t *sizeret) { - char *exe_dir = get_exe_dir(); - if (!exe_dir) { +#ifdef DATA_PATH + char *data_dir = DATA_PATH; +#else + char *data_dir = get_exe_dir(); + if (!data_dir) { if (sizeret) { *sizeret = -1; } return NULL; } - char const *pieces[] = {exe_dir, PATH_SEP, name}; +#endif + char const *pieces[] = {data_dir, PATH_SEP, name}; char *path = alloc_concat_m(3, pieces); FILE *f = fopen(path, "rb"); free(path); -- cgit v1.2.3