some thoughts on win32 'make install'

Lubomir I. Ivanov neolit123 at gmail.com
Fri Oct 11 07:12:24 UTC 2013


i've been thinking today on a possible working 'make install' on
native win32 and i'm starting to doubt it is possible to cover certain
corner cases...

now, my guess here is that we want to automatically copy all required
Qt (this has to include plugins) and third party DLL's to the
'packaging/windows/' folder, then possibly even automatically write to
the NSIS file?

first, there are some issues with the current commands on my end:

dlls.commands += PATH=\$\$PATH:`$(CC) -print-search-dirs | $(SED) -nE
\'/^libraries: =/{s///;s,/lib/?(:|\\\$\$),/bin\\1,g;p;q;}\'`

what happens here is that $(CC) gets expanded to 'cc' and $(SED) gets
expanded to ' ' (empty, but there is still 'sed.exe' in PATH), for
unknown reasons. $(SED) remains empty at all times, while $(CC) gets
populated correctly.

i can hardcode these for testing purposes but then i get a SIGSEGV
when the perl line is called from the makefile or this when:

perl ./scripts/win-ldd.pl ./release/subsurface.exe
Died at ./scripts/win-ldd.pl line 8.

which could be a piping issue with:
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;

so instead of debugging the script i went and wrote a perl script that
does a similar thing - finds dependecies based on $(LIBS), but also
copies DLLs (from perl) to a target path. it works OK over here.

then i realized (duh..) that a DLL can depend on another DLL and my
libzip-2.dll with zlib1.dll are an example of that. libzip-2.dll does
no have zlib statically linked in there and the executable also
depends on it. so what can be done here is traverse the DLLs for
dependencies (like Thiago does in his script), but then the question
is how do we find the path of zlib1.dll, since it does not come in out
$(LIBS) variable.

i guess since the script accepts any number of paths /mylibs/zlib/lib
can be added or some sort of a search path, but then again i don't
even have the file there because i simply copy pasted zlib1.dll from
somewhere.

so the problem again is lack of standardization of folders on win32
and i'm not sure the pursue of 'make install' is worth it - i.e. a
possible solid set of logic can still break for say, 1 of 3 users.

ideas are appreciated.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copydepend.pl
Type: application/octet-stream
Size: 2070 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131011/e12c09ed/attachment.obj>


More information about the subsurface mailing list