~ubuntu-branches/ubuntu/lucid/gauche-c-wrapper/lucid

« back to all changes in this revision

Viewing changes to lib/c-wrapper/stubgen.scm

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2008-07-16 10:51:00 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080716105100-ye2wkbrk9087iwr8
Tags: upstream-0.5.4
ImportĀ upstreamĀ versionĀ 0.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
494
494
         (stub-file (path-swap-extension compiled-lib "stub"))
495
495
         (cmdlines (case command
496
496
                     ((compile)
497
 
                      (list #`"gauche-package compile ,(if verbose? \"--verbose\" \"\") --cflags=\",|cflags|\" --cppflags=\",|cppflags|\" --ldflags=\",|ldflags|\" --libs=\",|libs|\" ,|extension| ,|stub-file|"))
 
497
                      `(("gauche-package" "compile"
 
498
                         ,@(if verbose? '("--verbose") '())
 
499
                         ,#`"--cflags=,|cflags|"
 
500
                         ,#`"--cppflags=,|cppflags|"
 
501
                         ,#`"--ldflags=,|ldflags|"
 
502
                         ,#`"--libs=,|libs|"
 
503
                         ,extension
 
504
                         ,stub-file)))
498
505
                     ((clean)
499
 
                      (list #`"gauche-package compile --clean ,(if verbose? \"--verbose\" \"\") ,|extension| ,|stub-file|"
500
 
                            #`"rm -f ,|stub-file|")))))
 
506
                      `(("gauche-package" "compile" "--clean"
 
507
                         ,@(if verbose? '("--verbose") '())
 
508
                         ,extension
 
509
                         ,stub-file)
 
510
                        ("rm" "-f" ,stub-file))))))
501
511
    (parameterize ((stub-unit (make-stub-unit module stub-file)))
502
512
      (wrapper->c (listize headers)
503
513
                  (listize include-dirs)
507
517
      (write-stub (sys-dirname compiled-lib))
508
518
      (for-each (lambda (cmd)
509
519
                  (when verbose?
510
 
                    (print cmd))
511
 
                  (with-input-from-process cmd
512
 
                    (lambda ()
513
 
                      (port-for-each print read-line))))
 
520
                    (print (string-join cmd " ")))
 
521
                  (run-process cmd :wait #t))
514
522
                cmdlines))))
515
523
 
516
524
(define (compile-wrapper filename command