From 76f7652d3b3d478f4f0c59b693b6540b2eb4a9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6ppe?= Date: Sat, 30 Oct 2004 17:58:16 +0000 Subject: [PATCH] Minor fix to the example. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6572 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/s-exp/uffi.lisp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/SWIG/Examples/s-exp/uffi.lisp b/SWIG/Examples/s-exp/uffi.lisp index c5c122d9f..5ddb4c20f 100644 --- a/SWIG/Examples/s-exp/uffi.lisp +++ b/SWIG/Examples/s-exp/uffi.lisp @@ -15,12 +15,10 @@ (defvar *swig-source-directory* #p"/home/mkoeppe/s/swig1.3/") -(defvar *swig-program* (merge-pathnames "swig" *swig-source-directory*)) +(defvar *swig-program* (merge-pathnames "preinst-swig" *swig-source-directory*)) (defun run-swig (swig-interface-file-name &key directory-search-list module ignore-errors c++) - (setf (port:getenv :SWIG_LIB) - (namestring (merge-pathnames "Lib" *swig-source-directory*))) (let ((temp-file-name "/tmp/swig.lsp")) (let ((process (port:run-prog (namestring *swig-program*) @@ -212,7 +210,7 @@ is no representation." (defvar *struct-fields* '()) -(defvar *linkage* nil "NIL or :C") +(defvar *linkage* :C "NIL or :C") (defgeneric handle-node (node-type &key &allow-other-keys) (:documentation "Handle a node of SWIG's parse tree of a C/C++ program")) @@ -345,7 +343,8 @@ is no representation." ;; (eval (cons 'progn (compute-uffi-definitions *simple-gifplot-interface*)))) -(with-open-file (f "/tmp/swig-uffi.lisp" :direction :output) +(with-open-file (f "/tmp/swig-uffi.lisp" :direction :output + :if-exists :supersede) (let ((*uffi-definitions* '()) (*uffi-output* f) (*uffi-primitive-type-alist* @@ -362,11 +361,11 @@ is no representation." (compile-file "/tmp/swig-uffi.lisp") -(load "/tmp/swig-uffi.lisp") - (uffi:load-foreign-library (merge-pathnames "Examples/GIFPlot/libgifplot.a" *swig-source-directory*)) +(load "/tmp/swig-uffi.lisp") + (load (merge-pathnames "Examples/GIFPlot/Common-Lisp/full/runme.lisp" *swig-source-directory*)) (action (namestring (merge-pathnames "Examples/GIFPlot/Common-Lisp/full/cmap" @@ -376,6 +375,8 @@ is no representation." ;;; Link to SWIG itself +#|| + (defparameter *c++-compiler* "g++") (defun stdc++-library (&key env) @@ -409,10 +410,11 @@ is no representation." :ignore-errors t :c++ t)) (with-open-file (f *swig-uffi-pathname* :direction :output) - (let ((*uffi-definitions* '()) - (*uffi-output* f) - (*uffi-primitive-type-alist* *uffi-default-primitive-type-alist*)) - (apply 'handle-node *swig-interface*))) + (let ((*linkage* :c++) + (*uffi-definitions* '()) + (*uffi-output* f) + (*uffi-primitive-type-alist* *uffi-default-primitive-type-alist*)) + (apply 'handle-node *swig-interface*))) (compile-file *swig-uffi-pathname*) (alien:load-foreign (merge-pathnames "Source/libswig.a" *swig-source-directory*) @@ -424,6 +426,8 @@ is no representation." ;; (list (stdc++-library))) (load (compile-file-pathname *swig-uffi-pathname*))) +||# + ;;;; TODO: ;; * How to do type lookups? Is everything important that SWIG knows