Update of /project/elephant/cvsroot/elephant In directory clnet:/tmp/cvs-serv19415
Modified Files: elephant.asd Log Message: Windows build support
--- /project/elephant/cvsroot/elephant/elephant.asd 2007/02/26 19:12:18 1.35 +++ /project/elephant/cvsroot/elephant/elephant.asd 2007/03/01 02:46:42 1.36 @@ -96,6 +96,62 @@ can be overridden or augmented by subclass methods" #+(or mswindows windows) (progn + (let* ((pathname (component-pathname c)) + (directory (directory-namestring pathname)) + (stdout-lines) (stderr-lines) (exit-status)) + (let ((command (format nil "~A ~{~A ~}" + (c-compiler-path c) + (compiler-options (c-compiler c) c + :input-file (format nil ""~A"" (namestring pathname)) + :output-file nil + :library nil)))) + #+allegro (multiple-value-setq (stdout-lines stderr-lines exit-status) + (excl.osi:command-output command :directory directory)) + #+lispworks (setf exit-status (system:call-system command :current-directory directory)) + (unless (zerop exit-status) + (error 'operation-error :component c :operation o))) + + (let ((command (format nil "dlltool -z ~A --export-all-symbols -e exports.o -l ~A ~A" + (format nil ""~A"" (namestring (make-pathname :type "def" :defaults pathname))) + (format nil ""~A"" (namestring (make-pathname :type "lib" :defaults pathname))) + (format nil ""~A"" (namestring (make-pathname :type "o" :defaults pathname)))))) + #+allegro (multiple-value-setq (stdout-lines stderr-lines exit-status) + (excl.osi:command-output command :directory directory)) + #+lispworks (setf exit-status (system:call-system command :current-directory directory)) + (unless (zerop exit-status) + (error 'operation-error :component c :operation o))) + + (let ((command (format nil "~A ~{~A ~}" ;; -I~A -L~A -l~A + (c-compiler-path c) + (compiler-options (c-compiler c) c + :input-file + (list (format nil ""~A"" (namestring + (make-pathname :type "o" :defaults pathname))) + "exports.o") + :output-file (format nil ""~A"" (first (output-files o c))) + :library t)))) + #+allegro (multiple-value-setq (stdout-lines stderr-lines exit-status) + (excl.osi:command-output command :directory directory)) + #+lispworks (setf exit-status (system:call-system command :current-directory directory)) + (unless (zerop exit-status) + (error 'operation-error :component c :operation o))))) + + #-(or mswindows windows) + (unless (zerop (run-shell-command + "~A ~{~A ~}" + (c-compiler-path c) + (compiler-options (c-compiler c) c + :input-file (namestring (component-pathname c)) + :output-file (namestring (first (output-files o c)))))) + (error 'operation-error :component c :operation o))) + +#| +(defmethod perform ((o compile-op) (c elephant-c-source)) + "Run the appropriate compiler for this platform on the source, getting + the specific options from 'compiler-options method. Default options + can be overridden or augmented by subclass methods" + #+(or mswindows windows) + (progn (let ((pathname (component-pathname c))) (unless (zerop (run-shell-command (format nil "~A ~{~A ~}" @@ -130,6 +186,12 @@ :input-file (namestring (component-pathname c)) :output-file (namestring (first (output-files o c)))))) (error 'operation-error :component c :operation o))) +|# + +;;Cygwin compile script: +;;gcc -mno-cygwin -mwindows -std=c99 -c libmemutil.c +;;dlltool -z libmeutil.def --export-all-symbols -e exports.o -l libmemutil.lib libmemutil.o +;;gcc -shared -mno-cygwin -mwindows libmemutil.o exports.o -o libmemutil.dll
(defmethod operation-done-p ((o compile-op) (c elephant-c-source)) "Is the first generated library more recent than the source file?" @@ -167,12 +229,6 @@ (if (listp input-file) input-file (list input-file)) (when output-file (list "-o" output-file))))
-;;Cygwin script: -;;gcc -mno-cygwin -mwindows -std=c99 -c libmemutil.c -;;dlltool -z libmeutil.def --export-all-symbols -e exports.o -l libmemutil.lib libmemutil.o -;;gcc -shared -mno-cygwin -mwindows libmemutil.o exports.o -o libmemutil.dll - - (defmethod compiler-options ((compiler (eql :msvc)) (c elephant-c-source) &key input-file output-file) (declare (ignore input-file output-file)) (error "MSVC compiler option not supported yet"))