Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / common.m4
blob4c1f494add5089aa05e54af454edc428c07420a4
1 divert(-1)
3 #                             COPYRIGHT
4
5 #   PCB, interactive printed circuit board design
6 #   Copyright (C) 1994,1995,1996 Thomas Nau
7
8 #   This program is free software; you can redistribute it and/or modify
9 #   it under the terms of the GNU General Public License as published by
10 #   the Free Software Foundation; either version 2 of the License, or
11 #   (at your option) any later version.
12
13 #   This program is distributed in the hope that it will be useful,
14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #   GNU General Public License for more details.
17
18 #   You should have received a copy of the GNU General Public License
19 #   along with this program; if not, write to the Free Software
20 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 #   Contact addresses for paper mail and Email:
23 #   Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
24 #   Thomas.Nau@rz.uni-ulm.de
25
27 # common defines for packages
29 # -------------------------------------------------------------------
30 # create a single object
31 # $1: mask name
32 # $2: 'value' of the new object
33 # $3: package of the circuit
35 define(`CreateObject',
36         `ifdef(`PinList_$1', `DefinePinList(PinList_$1)')'
37         `PKG_$3(`Description_$1', ,``$2'', Param1_$1, Param2_$1)'
40 # this one is used to show the correct value for the footprint attribute
41 # in a gschem (www.geda.seul.org) schematic.  See QueryLibrary.sh
42 define(`QueryObject',
43         `ifdef(`PinList_$1', `DefinePinList(PinList_$1)')'
44 `$3 ifdef(`Param1_$1', `Param1_$1') ifdef(`Param2_$1', `Param2_$1')'
47 # -------------------------------------------------------------------
48 # define for-loops like the manual tells us
50 define(`forloop',
51         `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
52 define(`_forloop',
53         `$4`'ifelse($1, `$3', ,
54         `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
56 # -------------------------------------------------------------------
57 # the following definitions evaluate the list of pin-names
58 # missing names will be defined as 'P_#'
60 # the first two arguments are skipped
62 define(`PIN', `Pin($1 $2 $3 $4 ifdef(`P_$5', "P_$5", "$5") ifelse($5, 1, 0x101, 0x01))')
63 define(`PAD', `Pad($1 $2 $3 $4 $5 ifdef(`P_$6', "P_$6", "$6") ifelse($6, 1, 0x00, 0x100))')
65 define(`EDGECONN', `Pad($1 $2 $3 $4 $5 ifdef(`P_$6', "P_$6", "$6") "$6" $7)')
66 define(`DEFPIN', `define(`count', incr(count))' `define(`P_'count, $1)')
67 define(`DefinePinList', `ifelse($#, 1, ,
68         `pushdef(`count')'
69         `define(`count', 0)'
70         `_DEFPINLIST($@)'
71         `popdef(`count')')')
72 define(`_DEFPINLIST', `ifelse($#, 0, , $#, 1, `DEFPIN(`$1')',
73         `DEFPIN(`$1')'`
74         _DEFPINLIST(shift($@))')')
76 define(`args',`
77         ifelse($#, 0, , $#, 1,`define(`arg'cnt,`$1')',
78         `define(`arg'cnt,`$1') define(`cnt',incr(cnt)) args(shift($@))')')
80 include(amp.inc)
81 include(amphenol.inc)
82 include(bga.inc)
83 include(bourns.inc)
84 include(candk.inc)
85 include(connector.inc)
86 include(cts.inc)
87 include(dil.inc)
88 include(geda.inc)
89 include(johnstech.inc)
90 include(minicircuits.inc)
91 include(misc.inc)
92 include(nichicon.inc)
93 include(optek.inc)
94 include(panasonic.inc)
95 include(pci.inc)
96 include(plcc.inc)
97 include(qfn.inc)
98 include(qfp.inc)
99 include(qfp2.inc)
100 include(qfpdj.inc)
101 include(resistor_adjust.inc)
102 include(rules.inc)
103 include(smt.inc)
104 include(to.inc)
105 include(zif.inc)
107 # if any of these files exist, then include them.  
108 # this makes it a bit easier to configure pcb without
109 # mucking with app-defaults every time you launch it
110 sinclude(site-config.inc)
111 sinclude(user-config.inc)
112 sinclude(proj-config.inc)
114 divert(0)dnl