diff --git a/CMakeLists.txt b/CMakeLists.txt index a900b992..4d0c8a9e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -808,20 +808,21 @@ if(NOT _x86 AND NOT _x86_64) install(FILES ${CMAKE_SOURCE_DIR}/system/box86.box86rc DESTINATION ${TERMUX_PATH}/usr/etc/) endif() endif() + set(INSTALL_PATH "/usr/lib/box86-i386-linux-gnu/") if(NOT NO_LIB_INSTALL) if(NOT TERMUX) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION /usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION /usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION /usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION /usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION /usr/lib/i386-linux-gnu/) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION ${INSTALL_PATH}) else() - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION ${TERMUX_PATH}/usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION ${TERMUX_PATH}/usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION ${TERMUX_PATH}/usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION ${TERMUX_PATH}/usr/lib/i386-linux-gnu/) - install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION ${TERMUX_PATH}/usr/lib/i386-linux-gnu/) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) endif() endif() endif() diff --git a/docs/USAGE.md b/docs/USAGE.md index 423be8dd..47fabdd5 100755 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -30,7 +30,7 @@ Disables Box86 printing its version and build #### BOX86_LD_LIBRARY_PATH * Path to look for x86 libraries. Default is current folder and `lib` in current folder. -Also, `/usr/lib/i386-linux-gnu` and `/lib/i386-linux-gnu` are added if they exist. +Also, `/usr/lib/i386-linux-gnu`, `/lib/i386-linux-gnu`, and `/usr/lib/box86-i386-linux-gnu` are added if they exist. #### BOX86_PATH * Path to look for x86 executable. Default is current folder and `bin` in current folder. diff --git a/src/main.c b/src/main.c index f773cdc0..f7da5c67 100644 --- a/src/main.c +++ b/src/main.c @@ -974,6 +974,10 @@ void LoadEnvVars(box86context_t *context) AddPath("/mnt/utmp/codeblocks/usr/lib/i386-linux-gnu", &context->box86_ld_lib, 1); if(FileExist("/mnt/utmp/box86/lib/i386-linux-gnu", 0)) AddPath("/mnt/utmp/box86/lib/i386-linux-gnu", &context->box86_ld_lib, 1); + if(FileExist("/mnt/utmp/codeblocks/usr/lib/box86-i386-linux-gnu", 0)) + AddPath("/mnt/utmp/codeblocks/usr/lib/box86-i386-linux-gnu", &context->box86_ld_lib, 1); + if(FileExist("/mnt/utmp/box86/lib/box86-i386-linux-gnu", 0)) + AddPath("/mnt/utmp/box86/lib/box86-i386-linux-gnu", &context->box86_ld_lib, 1); //TODO: add relative path to box86 location #endif #ifndef TERMUX @@ -991,11 +995,17 @@ void LoadEnvVars(box86context_t *context) AddPath("/usr/lib/i686-pc-linux-gnu", &context->box86_ld_lib, 1); if(FileExist("/usr/lib32", 0)) AddPath("/usr/lib32", &context->box86_ld_lib, 1); + if(FileExist("/lib/box86-i386-linux-gnu", 0)) + AddPath("/lib/box86-i386-linux-gnu", &context->box86_ld_lib, 1); + if(FileExist("/usr/lib/box86-i386-linux-gnu", 0)) + AddPath("/usr/lib/box86-i386-linux-gnu", &context->box86_ld_lib, 1); #else if(FileExist("/data/data/com.termux/files/usr/lib/i386-linux-gnu", 0)) AddPath("/data/data/com.termux/files/usr/lib/i386-linux-gnu", &context->box86_ld_lib, 1); if(FileExist("/data/data/com.termux/files/usr/lib/i686-linux-gnu", 0)) AddPath("/data/data/com.termux/files/usr/lib/i686-linux-gnu", &context->box86_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/lib/box86-i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/box86-i386-linux-gnu", &context->box86_ld_lib, 1); #endif if(getenv("LD_LIBRARY_PATH")) PrependList(&context->box86_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world