[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA: accessing gnetlistrc variables



Dan McMahill <dan@mcmahill.net> writes:

   Is it possible to access gnetlistrc variables inside of a particular
   gnetlist backend?  I'm wanting to have a way to override a default
   setting

   (define *m4-pcbdir* "/usr/X11R6/lib/X11/pcb/m4")

   which is in schem/gnet-PCBboard.scm

   That would allow easy reconfiguration of gnetlist to accomodate
   possible different locations for the PCB installation.

i don't have access to the source (august is low-bandwidth month ;-),
but can suggest the gnetlist frontend add some code like:

;; early init
(define *gnetlist-backend* #f)

;; during options (command-line) processing
(set! *gnetlist-backend* (string->symbol CHOSEN-BACKEND))

then users can effect backend-specific config like so:

(set! *m4-pcbdir*
      (case *gnetlist-backend*
        ;; some special needs
        ((pcboard locally-hacked-pcboard)
          "/some/path/to/my-m4-files")
        ((unreleased-dotty-hack)
          "/some/other/path/to/other-m4-files")
        ;; normally, leave it alone
        (else
          *m4-pcbdir*)))

we use `case' to demonstrate generality here, but ymmv.

thi