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

gEDA-cvs: CVS update: Makefile.am



  User: danmc   
  Date: 05/08/16 22:54:04

  Modified:    .        Makefile.am
  Added:       .        gnet-PCBboard.scm.in gnet-gsch2pcb.scm.in
  Removed:     .        gnet-PCBboard.scm gnet-gsch2pcb.scm
  Log:
  - use the M4 program discovered at configure time as the default for
  
  m4 in the PCB backends.
  
  
  
  - use the PCB directories from configure time as the defaults in the PCB
  
  backends.  These can still be changed with --with-pcbm4dir and --with-pcbconfdir.
  
  As usual, they can be changed at runtime with the gsch2pcb project file,
  
  but hopefully this gets things nominally right by default.
  
  
  
  
  Revision  Changes    Path
  1.24      +38 -11    eda/geda/devel/gnetlist/scheme/Makefile.am
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gnetlist/scheme/Makefile.am,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- Makefile.am	29 Dec 2004 01:46:16 -0000	1.23
  +++ Makefile.am	17 Aug 2005 02:54:04 -0000	1.24
  @@ -1,18 +1,45 @@
  +## $Id: Makefile.am,v 1.24 2005/08/17 02:54:04 danmc Exp $
  +##
  +
  +M4=		@M4@
  +PCBM4DIR=	@PCBM4DIR@
  +PCBCONFDIR=	@PCBCONFDIR@
   
   scmdatadir = @GEDADATADIR@/scheme
  -scmdata_DATA = gnet-PCB.scm gnet-allegro.scm gnet-bom.scm gnet-geda.scm \
  +scmdata_DATA = $(DIST_SCM) $(BUILT_SCM)
  +
  +DIST_SCM = gnet-PCB.scm gnet-allegro.scm gnet-bom.scm gnet-geda.scm \
   	       gnet-spice.scm gnet-tango.scm gnet-verilog.scm \
  -	       gnet-vhdl.scm gnet-vipec.scm gnet-PCBboard.scm \
  +	   gnet-vhdl.scm gnet-vipec.scm \
                  gnet-pads.scm gnetlist.scm gnet-bae.scm gnet-protelII.scm \
                  gnet-bom2.scm gnet-gossip.scm gnet-drc.scm gnet-vams.scm \
   	       gnet-partslist-common.scm gnet-partslist1.scm \
   	       gnet-partslist2.scm gnet-partslist3.scm gnet-maxascii.scm \
   	       gnet-switcap.scm gnet-spice-sdb.scm gnet-drc2.scm \
  -	       gnet-gsch2pcb.scm gnet-futurenet2.scm gnet-cascade.scm \
  +	   gnet-futurenet2.scm gnet-cascade.scm \
   	       gnet-redac.scm gnet-systemc.scm gnet-eagle.scm
   
   
  -EXTRA_DIST = $(scmdata_DATA)
  +EXTRA_DIST = $(DIST_SCM) $(SCM_SRCS)
  +
  +SCM_SRCS=	gnet-PCBboard.scm.in \
  +		gnet-gsch2pcb.scm.in
  +
  +BUILT_SCM=	gnet-PCBboard.scm gnet-gsch2pcb.scm
  +
  +gnet-PCBboard.scm: $(srcdir)/gnet-PCBboard.scm.in
  +	sed \
  +		-e 's;@m4@;${M4};g' \
  +		-e 's;@pcbm4dir@;${PCBM4DIR};g' \
  +		-e 's;@pcbconfdir@;${PCBCONFDIR};g' \
  +		$(srcdir)/gnet-PCBboard.scm.in > $@
  +
  +gnet-gsch2pcb.scm: $(srcdir)/gnet-gsch2pcb.scm.in
  +	sed \
  +		-e 's;@m4@;${M4};g' \
  +		-e 's;@pcbm4dir@;${PCBM4DIR};g' \
  +		-e 's;@pcbconfdir@;${PCBCONFDIR};g' \
  +		$(srcdir)/gnet-gsch2pcb.scm.in > $@
   
   MOSTLYCLEANFILES = *.log *~
   CLEANFILES = *.log *~
  
  
  
  1.1                  eda/geda/devel/gnetlist/scheme/gnet-PCBboard.scm.in
  
  Index: gnet-PCBboard.scm.in
  ===================================================================
  ;;; $Id: gnet-PCBboard.scm.in,v 1.1 2005/08/17 02:54:04 danmc Exp $
  ;;;
  ;;; gEDA - GNU Electronic Design Automation
  ;;; gnetlist - GNU Netlist
  ;;; Copyright (C) 1998-2000 Ales V. Hvezda
  ;;;
  ;;; This program is free software; you can redistribute it and/or modify
  ;;; it under the terms of the GNU General Public License as published by
  ;;; the Free Software Foundation; either version 2 of the License, or
  ;;; (at your option) any later version.
  ;;;
  ;;; This program is distributed in the hope that it will be useful,
  ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ;;; GNU General Public License for more details.
  ;;;
  ;;; You should have received a copy of the GNU General Public License
  ;;; along with this program; if not, write to the Free Software
  ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  ;;  PCBboard format
  ;; JM Routoure & Stefan Petersen 
  ;; 15/01/99
  
  
  ;;
  ;;
  (define PCBboard:write-top-header
    (lambda (port)
      (display "# release: pcb 1.6.3\n" port)
      (display "PCB(\"\" 6000 5000)\n" port)
      (display "Grid(10 0 0)\n" port)
      (display "Cursor(10 270 3)\n" port)
      (display "Flags(0x000000d0)\n" port)
      (display "Groups(\"1,2,3,s:4,5,6,c:7:8:\")\n" port)
      (display "Styles(\"Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20\")\n" port)))
  
  
  ;;
  ;;
  (define PCBboard:write-bottom-footer
    (lambda (port)
      (display "Layer(1 \"solder\")\n(\n)\n" port)
      (display "Layer(2 \"GND-sldr\")\n(\n)\n" port)
      (display "Layer(3 \"Vcc-sldr\")\n(\n)\n" port)
      (display "Layer(4 \"component\")\n(\n)\n" port)
      (display "Layer(5 \"GND-comp\")\n(\n)\n" port)
      (display "Layer(6 \"Vcc-comp\")\n(\n)\n" port)
      (display "Layer(7 \"unused\")\n(\n)\n" port)
      (display "Layer(8 \"unused\")\n(\n)" port)
      (newline port)))
  
  ;;
  ;;
  
  ;; Split string at current split-char and returns
  ;; a pair with substrings. If string is not splitable
  ;; it returns #f.
  (define (string-split the-string split-char)
  ;;string-index is Guile specific
    (let ((split-index (string-index the-string split-char))
          (last-index (- (string-length the-string) 1)))
  ;;Check if split-char happens to be in the beginning or end of the string
      (cond ((not split-index)
             #f)
            ((= split-index 0)
             (string-split 
              (substring the-string 1 (string-length the-string)) 
              split-char))
            ((= split-index last-index)
             #f)
            (split-index
             (cons (substring the-string 0 split-index)
                   (substring the-string (+ split-index 1) 
                              (string-length the-string))))
            (else
             #f))))
  
  ;; Splits a string with space separated words and returns a list
  ;; of the words (still as strings).
  (define (split-to-list the-string)
    (let ((the-list (string-split the-string #\space)))
      (if the-list
          (cons (car the-list) (split-to-list (cdr the-list)))
          (list the-string))))
  
  
  ;; Check if the string has a space
  (define (has-space? the-string)
    (string-index the-string #\space))
  
  
  (define PCBboard:write-value-footprint
    (lambda (pipe ls)
      (if (not (null? ls))
  ;;       uref contains the first element of ls        
          (let* ((uref (car ls))
                 (value (gnetlist:get-package-attribute uref "value"))
  	       (device (gnetlist:get-package-attribute uref "device"))
  ;; The footprint attribute is used by gschem to indicate the footprint
                 (footprint (split-to-list 
                            (gnetlist:get-package-attribute uref  "footprint") ) ) )
  
  ;; Test if uref contains a space char
            (cond ((has-space? uref)
                   (display (string-append "ERROR!, space character found in the value of " uref))
                   (newline))
  ;; Test if device contains a space char
            	((has-space? device)
                   (display (string-append "ERROR!, space character found in the device attribute of " uref))
                   (newline))
  ;; Test if value contains a space char
                  ((has-space? value)
                   (display (string-append "ERROR!, space character found in the value of " uref))
                   (newline))
  ;; Test if value contains a space char
                  ((string=? (car footprint) "unknown")
                   (display (string-append "ERROR! no footprint attribute in " uref ))
                   (newline))
                  (else
                   (display (string-append "PKG_" (car footprint)) pipe)
                   (display (string-append "(`" device "',`" uref "',`") pipe)
                   (display value pipe)
                   (case (length footprint)                   
                     ((1) #f)  
                     ((2) (display (string-append "',`" (cadr footprint)) pipe))
                     ((3) (display (string-append "',`" (cadr footprint) 
                                           "',`" (caddr footprint)) pipe))
                     (else (display (string-append "ERROR!, no footprint in device " uref))))
                   (display "')" pipe)
                   (newline pipe)
                   (PCBboard:write-value-footprint pipe (cdr ls))))))))
  
  
  ;;
  ;;
  
  (define m4-command "@m4@")                  
  (define m4-files "")                  
  (define *m4-pcbdir* "@pcbm4dir@")
  (define *m4-pcbconfdir* "@pcbconfdir@")
  
  ;; To emulate popen. Guileish again.
  ; Needed after guile ver. 1.3.2. To save 1.3a users, wrap it in.
  ; This does not work with guile 1.6.3: (false-if-exception (use-modules ... ))
  ; The below should work everywhere.
  (use-modules (ice-9 popen))
  
  (define (PCBboard output-filename)
    (let ((port (open-output-file output-filename)))
      (PCBboard:write-top-header port)
         (close-port port))
         ;; pipe with the macro define in pcb program
  ;;  (let ((pipe (open-output-pipe (string-append "m4 " *m4-pcbdir* "/common.m4 - | sed '/^PKG/d' - >> " output-filename))))
  ;;  leave the packages that have not been found in the file.pcb
  ;;  will be process in the script gschem2pcb
  ;; Original pipe command commented out by AVH (bugfix by Rich Walker)
  ;;  (let ((pipe (open-output-pipe (string-append "m4 " *m4-pcbdir* "/common.m4 - >> " output-filename))))
  ;; Fixed pipe command (AVH 1/27/02)
     (let ((pipe (open-output-pipe (string-append m4-command " -d -I" *m4-pcbdir* " -I" *m4-pcbconfdir* " -I $HOME/.pcb -I. " *m4-pcbdir* "/common.m4 - >> " output-filename))))
  
  
         ;; packages is a list with the different uref value
      (PCBboard:write-value-footprint pipe packages)
         (close-pipe pipe))
    (let ((port (open output-filename (logior O_WRONLY O_APPEND))))
      (PCBboard:write-bottom-footer port)
         close-port port))
  
  
  
  1.1                  eda/geda/devel/gnetlist/scheme/gnet-gsch2pcb.scm.in
  
  Index: gnet-gsch2pcb.scm.in
  ===================================================================
  ;;; $Id: gnet-gsch2pcb.scm.in,v 1.1 2005/08/17 02:54:04 danmc Exp $
  ;;;
  
  ;;; gEDA - GNU Electronic Design Automation
  ;;; gnetlist - GNU Netlist
  ;;; Copyright (C) 1998-2000 Ales V. Hvezda
  ;;;
  ;;; This program is free software; you can redistribute it and/or modify
  ;;; it under the terms of the GNU General Public License as published by
  ;;; the Free Software Foundation; either version 2 of the License, or
  ;;; (at your option) any later version.
  ;;;
  ;;; This program is distributed in the hope that it will be useful,
  ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ;;; GNU General Public License for more details.
  ;;;
  ;;; You should have received a copy of the GNU General Public License
  ;;; along with this program; if not, write to the Free Software
  ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  ;;  gsch2pcb format  (based on PCBboard format by JM Routoure & Stefan Petersen)
  ;;  Bill Wilson    billw@xxxxxx
  ;;  6/17/2003
  
  
  ;;
  ;;
  (define gsch2pcb:write-top-header
    (lambda (port)
      (display "# release: pcb 1.6.3\n" port)
      (display "PCB(\"\" 6000 5000)\n" port)
      (display "Grid(10 0 0)\n" port)
      (display "Cursor(10 270 3)\n" port)
      (display "Flags(0x000000d0)\n" port)
      (display "Groups(\"1,2,3,s:4,5,6,c:7:8:\")\n" port)
      (display "Styles(\"Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20\")\n" port)))
  
  
  ;;
  ;;
  (define gsch2pcb:write-bottom-footer
    (lambda (port)
      (display "Layer(1 \"solder\")\n(\n)\n" port)
      (display "Layer(2 \"GND-sldr\")\n(\n)\n" port)
      (display "Layer(3 \"Vcc-sldr\")\n(\n)\n" port)
      (display "Layer(4 \"component\")\n(\n)\n" port)
      (display "Layer(5 \"GND-comp\")\n(\n)\n" port)
      (display "Layer(6 \"Vcc-comp\")\n(\n)\n" port)
      (display "Layer(7 \"unused\")\n(\n)\n" port)
      (display "Layer(8 \"unused\")\n(\n)" port)
      (newline port)))
  
  ;;
  ;;
  
  ;; Split string at current split-char and returns
  ;; a pair with substrings. If string is not splitable
  ;; it returns #f.
  (define (string-split the-string split-char)
  ;;string-index is Guile specific
    (let ((split-index (string-index the-string split-char))
          (last-index (- (string-length the-string) 1)))
  ;;Check if split-char happens to be in the beginning or end of the string
      (cond ((not split-index)
             #f)
            ((= split-index 0)
             (string-split 
              (substring the-string 1 (string-length the-string)) 
              split-char))
            ((= split-index last-index)
             #f)
            (split-index
             (cons (substring the-string 0 split-index)
                   (substring the-string (+ split-index 1) 
                              (string-length the-string))))
            (else
             #f))))
  
  ;; Splits a string with space separated words and returns a list
  ;; of the words (still as strings).
  (define (split-to-list the-string)
    (let ((the-list (string-split the-string #\space)))
      (if the-list
          (cons (car the-list) (split-to-list (cdr the-list)))
          (list the-string))))
  
  
  (define gsch2pcb:write-value-footprint
    (lambda (pipe ls)
      (if (not (null? ls))
  ;;       refdes contains the first element of ls        
          (let* ((refdes (car ls))
                 (value (gnetlist:get-package-attribute refdes "value"))
                 (footprint (split-to-list 
                            (gnetlist:get-package-attribute refdes  "footprint") ) ) )
  
                 (display (string-append "PKG_" (car footprint)) pipe)
                 (display (string-append "(`" (car footprint)) pipe)
                 (case (length footprint)
                   ((1) #f)
                   ((2) (display (string-append "-" (cadr footprint)) pipe))
                   ((3) (display (string-append "-" (cadr footprint) 
                                           "-" (caddr footprint)) pipe))
  ;; Cases 4 & 5 are a kludge to help with spaces in file element names
  ;; This makes up to 4 spaces possible and should be generalized
                   ((4) (display (string-append "-" (cadr footprint) 
                             "-" (caddr footprint) "-"
                             (caddr (cdr footprint))) pipe))
                   ((5) (display (string-append "-" (cadr footprint)
                             "-" (caddr footprint)
                             "-" (caddr (cdr footprint)) 
                             "-" (caddr (cdr (cdr footprint)) )) pipe)))
                 (display (string-append "',`" refdes "',`") pipe)
  
                 (display value pipe)
                 (case (length footprint)                   
                   ((1) #f)  
                   ((2) (display (string-append "',`" (cadr footprint)) pipe))
                   ((3) (display (string-append "',`" (cadr footprint) 
                                         "',`" (caddr footprint)) pipe))
                   ((4) (display (string-append "',`" (cadr footprint) 
                             "',`" (caddr footprint)
                             "',`" (caddr (cdr footprint))) pipe))
                   ((5) (display (string-append "," (cadr footprint)
                             "',`" (caddr footprint)
                             "',`" (caddr (cdr footprint)) 
                             "',`" (caddr (cdr (cdr footprint)) )) pipe))
                   (else (display
                      (string-append "ERROR!, no footprint in device " refdes))))
                 (display "')" pipe)
                 (newline pipe)
                 (gsch2pcb:write-value-footprint pipe (cdr ls))) )))
  
  ;;
  ;;
  
  (define m4-command "@m4@")
  (define m4-pcbdir "@pcbm4dir@")
  (define m4-pcbconfdir "@pcbconfdir@")
  (define m4-files "")
  
  ;; To emulate popen. Guileish again.
  ; Needed after guile ver. 1.3.2. To save 1.3a users, wrap it in.
  ; Doesn't work in guile 1.6 (false-if-exception (use-modules (ice-9 popen)))
  (use-modules (ice-9 popen))
  
  (define (gsch2pcb output-filename)
    (let ((port (open-output-file output-filename)))
      (gsch2pcb:write-top-header port)
         (close-port port))
    	;; pipe with the macro define in pcb program
    	(let ((pipe (open-output-pipe (string-append
  			m4-command " -d -I. -I" m4-pcbdir " "
  			" -I " m4-pcbconfdir " -I$HOME/.pcb -I. "
  			m4-pcbdir "/common.m4 " m4-files " - >> "
  			output-filename))))
  
  
  		;; packages is a list with the different refdes value
  		(gsch2pcb:write-value-footprint pipe packages)
  		(close-pipe pipe))
    (let ((port (open output-filename (logior O_WRONLY O_APPEND))))
      (gsch2pcb:write-bottom-footer port)
         close-port port))