Changeset 11678 for trunk/abcl/build-abcl.lisp
- Timestamp:
- 02/22/09 15:13:44 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/build-abcl.lisp
r11674 r11678 218 218 (defun substitute-in-string (string substitutions-alist) 219 219 (dolist (entry substitutions-alist) 220 (let ((index (search (car entry) string :test #'string=))) 221 (when index 222 (setf string (concatenate 'string 223 (subseq string 0 index) 224 (cdr entry) 225 (subseq string (+ index (length (car entry))))))))) 220 (loop named replace 221 for index = (search (car entry) string :test #'string=) 222 do 223 (unless index 224 (return-from replace)) 225 (setf string (concatenate 'string 226 (subseq string 0 index) 227 (cdr entry) 228 (subseq string (+ index (length (car entry)))))))) 226 229 string) 227 230 … … 269 272 (t 270 273 (cond (batch 274 (ensure-directories-exist (merge-pathnames "build/classes/" *build-root*)) 271 275 (let* ((dir (pathname-directory *abcl-dir*)) 272 276 (cmdline (with-output-to-string (s) 273 277 (princ *java-compiler-command-line-prefix* s) 278 (princ " -d " s) 279 (princ (merge-pathnames "build/classes/" 280 *build-root*) s) 281 (princ #\Space s) 274 282 (dolist (source-file source-files) 275 283 (princ … … 282 290 (zerop status))) 283 291 (t 292 (ensure-directories-exist (merge-pathnames "build/classes/" *build-root*)) 284 293 (dolist (source-file source-files t) 285 294 (unless (java-compile-file source-file) … … 297 306 (command (if (eq *platform* :windows) "make-jar.bat" "sh make-jar"))) 298 307 (copy-with-substitutions source-file target-file substitutions-alist) 308 (ensure-directories-exist (merge-pathnames "dist/" *build-root*)) 299 309 (let ((status (run-shell-command command :directory *build-root*))) 300 310 (unless (zerop status) … … 306 316 (finish-output) 307 317 (let* ((java-namestring (safe-namestring *java*)) 308 status) 309 (cond ((eq *platform* :windows) 310 (with-open-file (stream 311 (merge-pathnames "compile-system.bat" *build-root*) 312 :direction :output 313 :if-exists :supersede) 314 (princ java-namestring stream) 315 (write-string " -cp " stream) 316 (princ "src" stream) 317 (write-char #\space stream) 318 (write-string 319 (if zip 320 "org.armedbear.lisp.Main --eval \"(compile-system :zip t :quit t)\"" 321 "org.armedbear.lisp.Main --eval \"(compile-system :zip nil :quit t)\"") 322 stream) 323 (terpri stream)) 324 (setf status 325 (run-shell-command "compile-system.bat" 326 :directory *build-root*))) 327 (t ; Linux 328 (let ((cmdline 329 (with-output-to-string (s) 330 (princ java-namestring s) 331 (write-string " -cp " s) 332 (princ "src" s) 333 (write-char #\space s) 334 (write-string 335 (if zip 336 "org.armedbear.lisp.Main --eval \"(compile-system :zip t :quit t)\"" 337 "org.armedbear.lisp.Main --eval \"(compile-system :zip nil :quit t)\"") 338 s)))) 339 (setf status 340 (run-shell-command cmdline 341 :directory *build-root*))))) 318 status 319 (abcl-home (substitute-in-string 320 (namestring *abcl-dir*) 321 (when (eq *platform* :windows) 322 '(("\\" . "/") 323 ("/" . "\\\\"))))) 324 (output-path (substitute-in-string 325 (namestring 326 (merge-pathnames "build/classes/org/armedbear/lisp/" 327 *build-root*)) 328 (when (eq *platform* :windows) 329 '(("\\" . "/"))))) 330 (cmdline (format nil 331 "~A -cp build\\classes -Dabcl.home=\"~A\" ~ 332 org.armedbear.lisp.Main --noinit ~ 333 --eval \"(compile-system :zip ~A :quit t :output-path \\\"~A\\\")\"~%" 334 java-namestring 335 abcl-home 336 (not (not zip)) ;; because that ensures T or NIL 337 output-path))) 338 (ensure-directories-exist output-path) 339 (setf status 340 (run-shell-command cmdline 341 :directory *build-root*)) 342 342 status)) 343 343 … … 377 377 :direction :output 378 378 :if-exists :supersede) 379 (format s "~A -Xss4M -Xmx256M -cp \"~A ;~A\" org.armedbear.lisp.Main %1 %2 %3 %4 %5 %6 %7 %8 %9~%"379 (format s "~A -Xss4M -Xmx256M -cp \"~A\" org.armedbear.lisp.Main %1 %2 %3 %4 %5 %6 %7 %8 %9~%" 380 380 (safe-namestring *java*) 381 (namestring (merge-pathnames "src" *build-root*)) 382 (namestring (merge-pathnames "abcl.jar" *build-root*))))) 381 (namestring (merge-pathnames "dist\\abcl.jar" *build-root*))))) 383 382 (t 384 383 (let ((pathname (merge-pathnames "abcl" *build-root*))) … … 426 425 427 426 (defun clean () 428 (dolist (f (list (list *build-root* "abcl.jar") 427 (dolist (f (list (list *build-root* "abcl.jar" "abcl.bat" "make-jar.bat" 428 "compile-system.bat") 429 429 (list *abcl-dir* "*.class" "*.abcl" "*.cls" 430 430 "native.h" "libabcl.so" "build") 431 (list (merge-pathnames "java/awt/" *abcl-dir*) 431 (list (merge-pathnames "build/classes/org/armedbear/lisp/" 432 *build-root*) 433 "*.class" "*.abcl" "*.cls" 434 "native.h" "libabcl.so" "build") 435 (list (merge-pathnames 436 "build/classes/org/armedbear/lisp/util/" 437 *build-root*) 438 "*.class" "*.abcl" "*.cls") 439 (list (merge-pathnames "dist/" *build-root*) 440 "*.jar" "*.class" "*.abcl" "*.cls") 441 (list (merge-pathnames "java/awt/" *abcl-dir*) 432 442 "*.class"))) 433 443 (let ((default (car f))) 434 (delete-files (mapcan #'(lambda (name) 435 (directory (merge-pathnames name default))) 436 (cdr f)))))) 444 (when (probe-directory default) 445 (delete-files (mapcan #'(lambda (name) 446 (directory (merge-pathnames name default))) 447 (cdr f))))))) 437 448 438 449 (defun build-abcl (&key force
Note: See TracChangeset
for help on using the changeset viewer.