On 11 June 2012 22:30, Juan Jose Garcia-Ripoll <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@googlemail.com" target="_blank">juanjose.garciaripoll@googlemail.com</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>sockets.fas is not linked in your program because you probably use (REQUIRE :sockets). Why not list it as a dependency on your ASDF file?</div>
</div></blockquote><div><br>Molte grazie, many thanks. I had only usocket as a dependency in my ASDF file. It is usocket that uses a (require 'sockets), not my code. In the usocket code (file backend/sbcl.lisp) I have found this code:</div>
<div><br>
;; There's no way to preload the sockets library other than by requiring it<br>;;<br>;; ECL sockets has been forked off sb-bsd-sockets and implements the<br>;; same interface. We use the same file for now.<br>#+ecl<br>
(eval-when (:compile-toplevel :load-toplevel :execute)<br> (require :sockets))<br><br></div><div>I do not know how to fix that, but I think it is better I get rid of usocket and use ECL sockets directly. My application is not portable for other reasons too.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">
<div></div><div>ECL does not have support for building statically linked executables in Windows.... the Makefile has not been adapted.</div></div></blockquote><div>...<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>how can I tell Lisp to load all dependency files from another directory than the one the .exe file is found? (e.g. a subdir)</div>
</blockquote></div><div>Change the system directory using setenv("ECLDIR","whatever/path/you/want") before calling cl_boot().</div></div></blockquote><div> </div><div>Unfortunately, I do not have a C program, I am compiling only Lisp code. Anyway, I think I will distribute the three or two files (exe, ucd.dat, ecl.dll) in the same directory. As a matter of fact, requiring users to install the whole ECL distribution for Windows just to run my little program is overkill. These three files are much smaller than the whole thing.<br>
</div><div><br></div><div>BTW I had a hard time trying to figure out how to execute some code in the CL-USER package to bootstrap my package. The only way that worked for me was rather tricky:</div><div><br></div><div>in my project ASDF file:</div>
<div><br></div><div>:components (</div><div> ...</div><div> #+eclbuild (:file "prologue"))</div><div><br></div><div>in prologue.lisp:</div><div><br></div><div><div>(defpackage #:cl-user (:use #:cl #:my-pkg))</div>
<div>(in-package :cl-user)</div><div><br></div><div>(my-pkg-main)</div></div><div><br></div><div>Then I have to remember to do:</div><div><br></div><div>(pushnew :eclbuild *features*)</div><div><br></div><div>before issuing:</div>
<div><br></div><div>(asdf:make-build :hyde :type :program)</div><div><br></div><div>:prologue-code and :epilogue-code didn't work for me here.</div><div><br></div><div>Thanks, Antonio Bonifati<br></div></div>