diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fed46f4..7341a365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,6 +416,7 @@ IF( ENABLE_SDL ) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example DESTINATION ${SYSCONFDIR} RENAME vbam.cfg) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vba-over.ini DESTINATION ${DATA_INSTALL_DIR}) ENDIF( ENABLE_SDL ) IF( ENABLE_GTK ) diff --git a/src/sdl/SDL.cpp b/src/sdl/SDL.cpp index 2c7562cc..987b4ac8 100644 --- a/src/sdl/SDL.cpp +++ b/src/sdl/SDL.cpp @@ -468,14 +468,7 @@ FILE *sdlFindFile(const char *name) if(f != NULL) return f; } -#else // ! _WIN32 - fprintf(stdout, "Searching system config directory: %s\n", SYSCONFDIR); - sprintf(path, "%s%c%s", SYSCONFDIR, FILE_SEP, name); - f = fopen(path, "r"); - if(f != NULL) - return f; -#endif // ! _WIN32 - + if(!strchr(arg0, '/') && !strchr(arg0, '\\')) { char *path = getenv("PATH"); @@ -515,6 +508,20 @@ FILE *sdlFindFile(const char *name) return f; } } +#else // ! _WIN32 + fprintf(stdout, "Searching data directory: %s\n", PKGDATADIR); + sprintf(path, "%s%c%s", PKGDATADIR, FILE_SEP, name); + f = fopen(path, "r"); + if(f != NULL) + return f; + + fprintf(stdout, "Searching system config directory: %s\n", SYSCONFDIR); + sprintf(path, "%s%c%s", SYSCONFDIR, FILE_SEP, name); + f = fopen(path, "r"); + if(f != NULL) + return f; +#endif // ! _WIN32 + return NULL; }