Changeset 13041
- Timestamp:
- 11/21/10 19:40:25 (13 years ago)
- Location:
- trunk/abcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/build-abcl.lisp
r13039 r13041 22 22 23 23 (defun safe-namestring (pathname) 24 (let* ((string (namestring pathname)) 25 (len (length string))) 24 (let ((string (namestring pathname))) 26 25 (when (position #\space string) 27 26 (setf string (concatenate 'string "\"" … … 70 69 (cond ((member :win32 *features*) 71 70 :windows) 72 (( zerop(ext:run-shell-command "uname | grep -i darwin" :output nil))71 ((equal 0 (ext:run-shell-command "uname | grep -i darwin" :output nil)) 73 72 :darwin) 74 (( zerop(ext:run-shell-command "uname | grep -i linux" :output nil))73 ((equal 0 (ext:run-shell-command "uname | grep -i linux" :output nil)) 75 74 :linux) 76 75 (t … … 95 94 command))) 96 95 (sb-ext:process-exit-code 97 (sb-ext:run-program 96 (sb-ext:run-program 98 97 "/bin/sh" 99 98 (list "-c" command) … … 169 168 exitcode)) 170 169 171 #+(or sbcl cmu lispworks openmcl) 170 #+ecl 171 (defun run-shell-command (command &key directory (output *standard-output*)) 172 (when directory 173 (if (member :windows *features*) 174 (error "Unimplemented.") 175 (setf command (concatenate 'string 176 "\\cd \"" 177 (namestring (pathname directory)) 178 "\" && " 179 command)))) 180 (ext:system command)) 181 ;; (multiple-value-bind (stream exit details) 182 ;; (ext:run-program 183 ;; "/bin/sh" (list "-c" command) 184 ;; :input nil :output :stream :error :output) 185 ;; (declare (ignore details)) 186 ;; (loop for line = (read-line stream nil) 187 ;; while line do (format output "~A~%" line)) 188 ;; exit)) 189 190 191 #+(or sbcl cmu lispworks openmcl ecl) 172 192 (defun probe-directory (pathspec) 173 193 (let* ((truename (probe-file pathspec)) ; TRUENAME is a pathname. … … 286 306 (defun java-compile-file (source-file) 287 307 (let ((cmdline (build-javac-command-line source-file))) 288 ( zerop(run-shell-command cmdline :directory *abcl-dir*))))289 290 (defun make-classes (force batch)308 (equal 0 (run-shell-command cmdline :directory *abcl-dir*)))) 309 310 (defun do-compile-classes (force batch) 291 311 (let* ((source-files 292 312 (remove-if-not … … 300 320 (or force 301 321 (file-newer name output-name)))) 302 (mapcan #'(lambda (default) 303 (directory (merge-pathnames "*.java" 304 default))) 305 (list *abcl-dir* 306 (merge-pathnames "util/" *abcl-dir*)))))) 322 (directory (merge-pathnames "**/*.java" *source-root*))))) 307 323 (format t "~&JDK: ~A~%" *jdk*) 308 324 (format t "Java compiler: ~A~%" *java-compiler*) 309 325 (format t "Compiler options: ~A~%~%" (if *java-compiler-options* *java-compiler-options* "")) 326 (format t "~&Compiling Java sources...") 310 327 (finish-output) 311 328 (cond ((null source-files) … … 316 333 (cond (batch 317 334 (ensure-directories-exist *build-root*) 318 (let* ((dir (pathname-directory *abcl-dir*)) 319 (cmdline (with-output-to-string (s) 335 (let* ((cmdline (with-output-to-string (s) 320 336 (princ *java-compiler-command-line-prefix* s) 321 337 (princ " -d " s) … … 323 339 (princ #\Space s) 324 340 (dolist (source-file source-files) 325 (princ 326 (safe-namestring 327 (if (equal (pathname-directory source-file) dir) 328 (file-namestring source-file) 329 (namestring source-file))) 330 s) 341 (princ (safe-namestring (namestring source-file)) s) 331 342 (princ #\space s)))) 332 (status (run-shell-command cmdline :directory *abcl-dir*))) 333 (zerop status))) 343 (status (run-shell-command cmdline :directory *tree-root*))) 344 (format t " done.~%") 345 (equal 0 status))) 334 346 (t 335 347 (ensure-directories-exist *build-root*) … … 351 363 (ensure-directories-exist *dist-root*) 352 364 (let ((status (run-shell-command command :directory *tree-root*))) 353 (unless ( zeropstatus)365 (unless (equal 0 status) 354 366 (format t "~A returned ~S~%" command status)) 355 367 status)))) 356 368 357 369 (defun do-compile-system (&key (zip t)) 370 (format t "~&Compiling Lisp sources...") 358 371 (terpri) 359 372 (finish-output) … … 380 393 output-path))) 381 394 (ensure-directories-exist output-path) 382 (setf status 383 (run-shell-command cmdline 384 :directory *tree-root*)) 395 (setf status (run-shell-command cmdline :directory *tree-root*)) 396 (format t " done.~%") 385 397 status)) 386 398 … … 434 446 435 447 (defun clean () 448 (format t "~&Cleaning compilation results." 436 449 (dolist (f (list (list *tree-root* "abcl.jar" "abcl.bat" "make-jar.bat" 437 450 "compile-system.bat") … … 482 495 (when clean 483 496 (clean)) 484 ;; classes485 (unless ( make-classes force batch)497 ;; Compile Java source into classes 498 (unless (do-compile-classes force batch) 486 499 (format t "Build failed.~%") 487 500 (return-from build-abcl nil)) … … 490 503 (let* ((zip (if (or full jar) nil t)) 491 504 (status (do-compile-system :zip zip))) 492 (unless ( zeropstatus)505 (unless (equal 0 status) 493 506 (format t "Build failed.~%") 494 507 (return-from build-abcl nil)))) … … 496 509 (when (or full jar) 497 510 (let ((status (make-jar))) 498 (unless ( zeropstatus)511 (unless (equal 0 status) 499 512 (format t "Build failed.~%") 500 513 (return-from build-abcl nil)))) … … 519 532 (princ "--main=org.armedbear.lisp.Main -o lisp" s))) 520 533 (result (run-shell-command cmdline :directory *abcl-dir*))) 521 ( zeropresult)))534 (equal 0 result))) 522 535 523 536 (defvar *copy-verbose* nil) … … 592 605 version-string version-string)) 593 606 (status (run-shell-command command :directory parent-dir))) 594 (unless ( zeropstatus)607 (unless (equal 0 status) 595 608 (format t "~A returned ~S~%" command status))) 596 609 (let* ((command (format nil "zip -q -r ~A~A.zip ~A" … … 598 611 version-string version-string)) 599 612 (status (run-shell-command command :directory parent-dir))) 600 (unless ( zeropstatus)613 (unless (equal 0 status) 601 614 (format t "~A returned ~S~%" command status))))) -
trunk/abcl/build-from-lisp.sh
r12052 r13041 73 73 } 74 74 75 ecl() 76 { 77 exec "$1" -norc -load "$2" -eval "(progn $3 (ext:quit))" 78 } 79 75 80 clisp() 76 81 { … … 121 126 notimplemented "$IMPL" "$FILE" "$FORM" ;; 122 127 ecl*) 123 notimplemented "$IMPL" "$FILE" "$FORM";;128 ecl "$IMPL" "$FILE" "$FORM" ;; 124 129 alisp*) 125 130 notimplemented "$IMPL" "$FILE" "$FORM" ;;
Note: See TracChangeset
for help on using the changeset viewer.