Minor fix to the example.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6572 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2004-10-30 17:58:16 +00:00
commit 76f7652d3b

View file

@ -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