prefix/winnt/profile.bashrc: move usr/lib/*.dll to usr/bin/
authorMichael Haubenwallner <haubi@gentoo.org>
Mon, 24 Jun 2019 11:01:25 +0000 (13:01 +0200)
committerMichael Haubenwallner <haubi@gentoo.org>
Mon, 24 Jun 2019 11:07:51 +0000 (13:07 +0200)
When dlls or executables are created without the parity loader in place,
dlls may not be found when not in usr/bin.
So better move dlls from usr/lib to usr/bin, much like Cygwin does.

Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>
profiles/prefix/windows/winnt/profile.bashrc

index 4e60691a4944361574049df3753569713dae2c06..c0eaec08a6dff23b2fa3b591f5bcd1c4b8c63d14 100644 (file)
@@ -62,6 +62,17 @@ post_src_install() {
                        ;;
                esac
        done
+       find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
+       while read f
+       do
+               if test ! -f usr/bin/${f##*/}; then
+                       ebegin "moving ${f} to usr/bin for native loader"
+                       dodir usr/bin || die
+                       mv -f "${f}" usr/bin || die
+                       ln -sf "../bin/${f##*/}" "${f}"
+                       eend $?
+               fi
+       done
 }
 
 windows_setup_dllhelper_cp() {