[gambit-list] changing the ld options on dynamically loaded files

Christian christian at pflanze.mine.nu
Mon Aug 29 11:28:00 EDT 2005


At 14:46 Uhr -0500 25.08.2005, Bradley Lucier wrote:
>  >  (compile-file "all.scm")
>*** ERROR IN #<procedure #2> -- Unbound variable: ##ld-cmd
>
>and there's no ##ld-cmd in gambc40b14, either.
>
>How can I set things up to link all dynamically loaded files against 
>libfftw.so.2.0.5?

I run c#cf and the gsc-cc-o command directly to be able to specify 
linking options. Below is the my-compile-file function from 
chjmodule.scm.

Christian.


(define c-cf (defined-and-true 'c#cf))

(define (my-compile-file sourcefilepath
                          opts
                          cfilepath
                          objectfilepath
                          #!key
                          cc-opts
                          ld-opts)
   (if (not c-cf)
       (error "the gambit binary you're running doesn't have 
compilation ability (c#cf is missing)"))
   (and (c-cf sourcefilepath #f opts cfilepath (path-strip-directory 
objectfilepath))
        (let* ((gambcdir
                (path-expand "~~"))
               (gambcdir-bin
                (parameterize
                 ((current-directory
                   (path-expand "bin" gambcdir)))
                 (current-directory)))
               (exit-status
                (shell-command
                 (string-append
                  gambcdir-bin
                  "gsc-cc-o "
                  gambcdir
                  " "
                  objectfilepath
                  " "
                  cfilepath
                  " "
                  (or cc-opts "")
                  " "
                  (or ld-opts "")))))
          (if (= exit-status 0)
              #t
              (error "my-compile-file"
                     'compile-file
                     (list sourcefilepath
                           opts
                           cfilepath
                           objectfilepath
                           cc-opts
                           ld-opts))))))



More information about the Gambit-list mailing list