Browse Source
- Like in danger-bird2, some Common Lisp gets compiled at weechat build time into a static library, which gets linked in to the final binary. - This required some cmake trickery to get it to actually do the thing. - As a proof of concept, we now get the "plugin loaded" message to be printed from Lisp, with the ECL version chucked in as a nifty trick.master
6 changed files with 99 additions and 4 deletions
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
(require 'cmp) |
||||
|
||||
(defun cmpsupport (source afile) |
||||
(let* ((src-length (length source)) |
||||
;; HACK(eta): what the heck |
||||
(c::+static-library-format+ "~a.a") |
||||
(cursed-obj-file (concatenate 'string |
||||
(subseq source 0 (- src-length 4)) |
||||
"o"))) |
||||
(compile-file source :system-p t) |
||||
(c::build-static-library afile |
||||
:lisp-files (list cursed-obj-file) |
||||
:init-name "ecl_support_init") |
||||
(quit))) |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
(defpackage :wee-impl |
||||
(:use)) |
||||
|
||||
(defpackage :strophe-impl |
||||
(:use)) |
||||
|
||||
(defpackage :weexmpp |
||||
(:nicknames :wx) |
||||
(:use :cl)) |
||||
|
||||
(in-package :weexmpp) |
||||
|
||||
(defun printf (format-string &rest args) |
||||
(wee-impl::printf nil (apply #'format nil format-string args))) |
||||
|
||||
(defun initialize () |
||||
(printf "xmpp: plugin loaded (ECL ~A)" (lisp-implementation-version))) |
Loading…
Reference in new issue