diff --git a/src/cpp/main.cpp b/src/cpp/main.cpp index e5011bb..71334ec 100644 --- a/src/cpp/main.cpp +++ b/src/cpp/main.cpp @@ -146,8 +146,14 @@ int main(int argc, char* argv[]) { #endif #ifdef INI_ASDF + LQML::eval("(x:ensure-compiler)"); ecl_init_module(NULL, init_lib_ASDF); - LQML::eval("(push *default-pathname-defaults* asdf:*central-registry*)"); + // needed for desktop/SFOS apps that depend on ASDF and need additional files + // at runtime; in this case, the absolute app path must be passed when + // launching the app, like 'qt-runner /usr/bin/my-app/my-app' (SFOS) + LQML::eval("(let ((path (ext:argv 0)))" + " (x:when-it (position #\\/ path :from-end t)" + " (push (subseq path 0 (1+ x:it)) asdf:*central-registry*)))"); #endif // load .eclrc diff --git a/src/lisp/x.lisp b/src/lisp/x.lisp index d3bcc0b..28db882 100644 --- a/src/lisp/x.lisp +++ b/src/lisp/x.lisp @@ -7,6 +7,7 @@ #:d #:do-string #:empty-string + #:ensure-compiler #:ensure-list #:ends-with #:it @@ -137,3 +138,8 @@ (package-name (symbol-package callback)) (symbol-name callback)))) +(defun ensure-compiler () + (ignore-errors (ext:install-c-compiler)) + (unless (find-symbol "*CC*" :c) + (ext:install-bytecodes-compiler))) +