X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fapp%2Fsetup.cpp;h=f1d40815b490daa7d4cd81be5c2c1ee315137d6b;hb=79eeba22101e6ae87a3f229aebc127ccbcf047ed;hp=5ddcb01984866ab873e08561b870390fce579f62;hpb=c03f452931adede1ad3f654a8329bbb58f5e4c61;p=supertux.git diff --git a/lib/app/setup.cpp b/lib/app/setup.cpp index 5ddcb0198..f1d40815b 100644 --- a/lib/app/setup.cpp +++ b/lib/app/setup.cpp @@ -297,16 +297,21 @@ void Setup::directories(void) } else { - std::string exedir = std::string(dirname(exe_file)) + "/"; - - datadir = exedir + "../../data"; // SuperTux run from source dir + std::string exedir = std::string(dirname(exe_file)) + "/"; + + datadir = exedir + "../data"; // SuperTux run from source dir if (access(datadir.c_str(), F_OK) != 0) { + datadir = exedir + "../../data"; //SuperTux run from source dir (with libtool script) + + if (access(datadir.c_str(), F_OK) != 0) + { datadir = exedir + "../share/" + package_symbol_name; // SuperTux run from PATH if (access(datadir.c_str(), F_OK) != 0) { // If all fails, fall back to compiled path datadir = DATA_PREFIX; } + } } } #else