>>
@end example
Examples:
@example
VCC 10 0 DC 6
VIN 13 2 0.001 AC 1 SIN(0 1 1MEG)
ISRC 23 21 AC 0.333 45.0 SFFM(0 1 10K 5 1K)
VMEAS 12 9
VCARRIER 1 0 DISTOF1 0.1 -90.0
VMODULATOR 2 0 DISTOF2 0.01
IIN1 1 5 AC 1 DISTOF1 DISTOF2 0.001
@end example
N+ and N- are the positive and negative nodes, respectively. Note that
voltage sources need not be grounded. Positive current is assumed to
flow from the positive node, through the source, to the negative node.
A current source of positive value forces current to flow out of the N+
node, through the source, and into the N- node. Voltage sources, in
addition to being used for circuit excitation, are the 'ammeters' for
NGSPICE, that is, zero valued voltage sources may be inserted into the
circuit for the purpose of measuring current. They of course have no
effect on circuit operation since they represent short-circuits.
DC/TRAN is the dc and transient analysis value of the source. If the
source value is zero both for dc and transient analyses, this value may
be omitted. If the source value is time-invariant (e.g., a power
supply), then the value may optionally be preceded by the letters DC.
ACMAG is the ac magnitude and ACPHASE is the ac phase. The source is
set to this value in the ac analysis. If ACMAG is omitted following the
keyword AC, a value of unity is assumed. If ACPHASE is omitted, a value
of zero is assumed. If the source is not an ac small-signal input, the
keyword AC and the ac values are omitted.
DISTOF1 and DISTOF2 are the keywords that specify that the independent
source has distortion inputs at the frequencies F1 and F2 respectively
(see the description of the .DISTO control line). The keywords may be
followed by an optional magnitude and phase. The default values of the
magnitude and phase are 1.0 and 0.0 respectively.
Any independent source can be assigned a time-dependent value for
transient analysis. If a source is assigned a time-dependent value, the
time-zero value is used for dc analysis. There are five independent
source functions: pulse, exponential, sinusoidal, piece-wise linear, and
single-frequency FM. If parameters other than source values are omitted
or set to zero, the default values shown are assumed. (TSTEP is the
printing increment and TSTOP is the final time (see the .TRAN control
line for explanation)).
@menu
* Pulse::
* Sinusoidal::
* Exponential::
* Piece-Wise Linear::
* Single-Frequency FM::
@end menu
@node Pulse, Sinusoidal, Independent Sources, Independent Sources
@subsubsection Pulse
General form:
@example
PULSE(V1 V2 TD TR TF PW PER)
@end example
Examples:
@example
VIN 3 0 PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)
@end example
@multitable @columnfractions .33 .33 .33
@item parameter @tab default value @tab units
@item V1 (initial value) @tab @tab Volts or Amps
@item V2 (pulsed value) @tab @tab Volts or Amps
@item TD (delay time) @tab 0.0 @tab seconds
@item TR (rise time) @tab TSTEP @tab seconds
@item TF (fall time) @tab TSTEP @tab seconds
@item PW (pulse width) @tab TSTOP @tab seconds
@item PER(period) @tab TSTOP @tab seconds
@end multitable
A single pulse so specified is described by the following table:
@multitable @columnfractions .3 .3
@item time @tab value
@item 0 @tab V1
@item TD @tab V1
@item TD+TR @tab V2
@item TD+TR+PW @tab V2
@item TD+TR+PW+TF @tab V1
@item TSTOP @tab V1
@end multitable
Intermediate points are determined by linear interpolation.
@node Sinusoidal, Exponential, Pulse, Independent Sources
@subsubsection Sinusoidal
General form:
@example
SIN(VO VA FREQ TD THETA)
@end example
Examples:
@example
VIN 3 0 SIN(0 1 100MEG 1NS 1E10)
@end example
@multitable @columnfractions .3 .3 .3
@item parameters @tab default value @tab units
@item VO (offset) @tab @tab Volts or Amps
@item VA (amplitude) @tab @tab Volts or Amps
@item FREQ (frequency) @tab 1/TSTOP @tab Hz
@item TD (delay) @tab 0.0 @tab seconds
@item THETA (damping factor) @tab 0.0 @tab 1/seconds
@end multitable
The shape of the waveform is described by the following table:
@tex
$$
V(t) = \cases{V0 ,&if $0\leq t)
@end example
Examples:
@example
VCLOCK 7 5 PWL(0 -7 10NS -7 11NS -3 17NS -3 18NS -7 50NS -7)
@end example
Each pair of values (Ti, Vi) specifies that the value of the source is
Vi (in Volts or Amps) at time=Ti. The value of the source at
intermediate values of time is determined by using linear interpolation
on the input values.
@node Single-Frequency FM, , Piece-Wise Linear, Independent Sources
@subsubsection Single-Frequency FM
General Form:
@example
SFFM(VO VA FC MDI FS)
@end example
Examples:
@example
V1 12 0 SFFM(0 1M 20K 5 1K)
@end example
@example
parameter default value units
------------------------------------------------------
VO (offset) Volts or Amps
VA (amplitude) Volts or Amps
FC (carrier frequency) 1/TSTOP Hz
MDI (modulation index)
FS (signal frequency) 1/TSTOP Hz
@end example
The shape of the waveform is described by the following equation:
@tex
$$
V(t)=V_O + V_A \sin\left| 2 J FC t + MDI \sin(2 J FS t)\right|
$$
@end tex
@ifnottex
@example
| |
V(t)=V + V sin 2 J FC t + MDI sin(2 J FS t)
O A | |
@end example
@end ifnottex
@node Linear Dependent Sources, Non-linear Dependent Sources, Independent Sources, Voltage and Current Sources
@subsection Linear Dependent Sources
NGSPICE allows circuits to contain linear dependent sources characterized
by any of the four equations
@tex
$$
i = g v \qquad v = e v \qquad i = f i \qquad v = h i
$$
@end tex
@ifnottex
@example
i = g v v = e v i = f i v = h i
@end example
@end ifnottex
where g, e, f, and h are constants representing transconductance,
voltage gain, current gain, and transresistance, respectively.
@menu
* Linear Voltage-Controlled Current Sources::
* Linear Voltage-Controlled Voltage Sources::
* Linear Current-Controlled Current Sources::
* Linear Current-Controlled Voltage Sources::
@end menu
@node Linear Voltage-Controlled Current Sources, Linear Voltage-Controlled Voltage Sources, Linear Dependent Sources, Linear Dependent Sources
@subsubsection Linear Voltage-Controlled Current Sources
General form:
@example
GXXXXXXX N+ N- NC+ NC- VALUE
@end example
Examples:
@example
G1 2 0 5 0 0.1MMHO
@end example
N+ and N- are the positive and negative nodes, respectively. Current
flow is from the positive node, through the source, to the negative
node. NC+ and NCare the positive and negative controlling nodes,
respectively. VALUE is the transconductance (in mhos).
@node Linear Voltage-Controlled Voltage Sources, Linear Current-Controlled Current Sources, Linear Voltage-Controlled Current Sources, Linear Dependent Sources
@subsubsection Linear Voltage-Controlled Voltage Sources
General form:
@example
EXXXXXXX N+ N- NC+ NC- VALUE
@end example
Examples:
@example
E1 2 3 14 1 2.0
@end example
N+ is the positive node, and N- is the negative node. NC+ and NC- are
the positive and negative controlling nodes, respectively. VALUE is the
voltage gain.
@node Linear Current-Controlled Current Sources, Linear Current-Controlled Voltage Sources, Linear Voltage-Controlled Voltage Sources, Linear Dependent Sources
@subsubsection Linear Current-Controlled Current Sources
General form:
@example
FXXXXXXX N+ N- VNAM VALUE
@end example
Examples:
@example
F1 13 5 VSENS 5
@end example
N+ and N- are the positive and negative nodes, respectively. Current
flow is from the positive node, through the source, to the negative
node. VNAM is the name of a voltage source through which the
controlling current flows. The direction of positive controlling
current flow is from the positive node, through the source, to the
negative node of VNAM. VALUE is the current gain.
@node Linear Current-Controlled Voltage Sources, , Linear Current-Controlled Current Sources, Linear Dependent Sources
@subsubsection Linear Current-Controlled Voltage Sources
General form:
@example
HXXXXXXX N+ N- VNAM VALUE
@end example
Examples:
@example
HX 5 17 VZ 0.5K
@end example
N+ and N- are the positive and negative nodes, respectively. VNAM is
the name of a voltage source through which the controlling current
flows. The direction of positive controlling current flow is from the
positive node, through the source, to the negative node of VNAM. VALUE
is the transresistance (in ohms).
@node Non-linear Dependent Sources, , Linear Dependent Sources, Voltage and Current Sources
@subsection Non-linear Dependent Sources
General form:
@example
BXXXXXXX N+ N-
@end example
Examples:
@example
B1 0 1 I=cos(v(1))+sin(v(2))
B1 0 1 V=ln(cos(log(v(1,2)^2)))-v(3)^4+v(2)^v(1)
B1 3 4 I=17
B1 3 4 V=exp(pi^i(vdd))
@end example
N+ is the positive node, and N- is the negative node. The values of the
V and I parameters determine the voltages and currents across and
through the device, respectively. If I is given then the device is a
current source, and if V is given the device is a voltage source. One
and only one of these parameters must be given.
The small-signal AC behaviour of the nonlinear source is a linear
dependent source (or sources) with a proportionality constant equal to
the derivative (or derivatives) of the source at the DC operating point.
The expressions given for V and I may be any function of voltages and
currents through voltage sources in the system. The following functions
of real variables are defined:
@multitable @columnfractions .2 .2 .2 .2
@item abs @tab asinh @tab cosh @tab sin
@item acos @tab atan @tab exp @tab sinh
@item acosh @tab atanh @tab ln @tab sqrt
@item asin @tab cos @tab log @tab tan
@end multitable
The function "u" is the unit step function, with a value of one for
arguments greater than zero and a value of zero for arguments less than
zero. The function "uramp" is the integral of the unit step: for an
input x, the value is zero if x is less than zero, or if x is greater
than zero the value is x. The function "u2" returns a value of zero for
arguments less than zero, one for arguments greater than one and assumes
the value of the argument between these limits .These three functions are
useful in sythesizing piece-wise non-linear functions, though convergence
may be adversely affected.
Note: "u2" function has been introduced in rework-11.
The following standard operators are defined:
@example
+ - * / @{ @} unary -
@end example
If the argument of log, ln, or sqrt becomes less than zero, the absolute
value of the argument is used. If a divisor becomes zero or the
argument of log or ln becomes zero, an error will result. Other
problems may occur when the argument for a function in a partial
derivative enters a region where that function is undefined.
To get time into the expression you can integrate the current from a
constant current source with a capacitor and use the resulting voltage
(don't forget to set the initial voltage across the capacitor).
Non-linear resistors, capacitors, and inductors may be synthesized with
the nonlinear dependent source. Non-linear resistors are obvious.
Nonlinear capacitors and inductors are implemented with their linear
counterparts by a change of variables implemented with the nonlinear
dependent source. The following subcircuit will implement a nonlinear
capacitor:
@example
.Subckt nlcap pos neg
* Bx: calculate f(input voltage)
Bx 1 0 v = f(v(pos,neg))
* Cx: linear capacitance
Cx 2 0 1
* Vx: Ammeter to measure current into the capacitor
Vx 2 1 DC 0Volts
* Drive the current through Cx back into the circuit
Fx pos neg Vx 1
.ends
@end example
Non-linear inductors are similar.
@node Transmission Lines, Transistors and Diodes, Voltage and Current Sources, Circuit Elements and Models
@section Transmission Lines
@menu
* Lossless Transmission Lines::
* Lossy Transmission Lines::
* Lossy Transmission Line Model (LTRA)::
* Uniform Distributed RC Lines (Lossy)::
* Uniform Distributed RC Model (URC)::
@end menu
@node Lossless Transmission Lines, Lossy Transmission Lines, Transmission Lines, Transmission Lines
@subsection Lossless Transmission Lines
General form:
@example
TXXXXXXX N1 N2 N3 N4 Z0=VALUE | >
+
@end example
Examples:
@example
T1 1 0 2 0 Z0=50 TD=10NS
@end example
N1 and N2 are the nodes at port 1; N3 and N4 are the nodes at port 2.
Z0 is the characteristic impedance. The length of the line may be
expressed in either of two forms. The transmission delay, TD, may be
specified directly (as TD=10ns, for example). Alternatively, a
frequency F may be given, together with NL, the normalized electrical
length of the transmission line with respect to the wavelength in the
line at the frequency F. If a frequency is specified but NL is omitted,
0.25 is assumed (that is, the frequency is assumed to be the
quarter-wave frequency). Note that although both forms for expressing
the line length are indicated as optional, one of the two must be
specified.
Note that this element models only one propagating mode. If all four
nodes are distinct in the actual circuit, then two modes may be excited.
To simulate such a situation, two transmission-line elements are
required. (see the example in Appendix A for further clarification.)
The (optional) initial condition specification consists of the voltage
and current at each of the transmission line ports. Note that the
initial conditions (if any) apply 'only' if the UIC option is specified
on the .TRAN control line.
Note that a lossy transmission line (see below) with zero loss may be
more accurate than than the lossless transmission line due to
implementation details.
@node Lossy Transmission Lines, Lossy Transmission Line Model (LTRA), Lossless Transmission Lines, Transmission Lines
@subsection Lossy Transmission Lines
General form:
@example
OXXXXXXX N1 N2 N3 N4 MNAME
@end example
Examples:
@example
O23 1 0 2 0 LOSSYMOD
OCONNECT 10 5 20 5 INTERCONNECT
@end example
This is a two-port convolution model for singleconductor lossy
transmission lines. N1 and N2 are the nodes at port 1; N3 and N4 are
the nodes at port 2. Note that a lossy transmission line with zero loss
may be more accurate than than the lossless transmission line due to
implementation details.
@node Lossy Transmission Line Model (LTRA), Uniform Distributed RC Lines (Lossy), Lossy Transmission Lines, Transmission Lines
@subsection Lossy Transmission Line Model (LTRA)
The uniform RLC/RC/LC/RG transmission line model (referred to as the
LTRA model henceforth) models a uniform constant-parameter distributed
transmission line. The RC and LC cases may also be modelled using the
URC and TRA models; however, the newer LTRA model is usually faster and
more accurate than the others. The operation of the LTRA model is based
on the convolution of the transmission line's impulse responses with its
inputs (see [8]).
The LTRA model takes a number of parameters, some of which must be given
and some of which are optional.
@multitable @columnfractions .15 .4 .2 .1 .1
@item name @tab parameter @tab units/type @tab default @tab example
@item name @tab parameter @tab units/type @tab default @tab example
@item R @tab resistance/length @tab Z/unit @tab 0.0 @tab 0.2
@item L @tab inductance/length @tab henrys/unit @tab 0.0 @tab 9.13e-9
@item G @tab conductance/length @tab mhos/unit @tab 0.0 @tab 0.0
@item C @tab capacitance/length @tab farads/unit @tab 0.0 @tab 3.65e-12
@item LEN @tab length of line @tab no default @tab 1.0
@item REL @tab breakpoint control @tab arbitrary unit @tab 1 @tab 0.5
@item ABS @tab breakpoint control @tab 1 @tab 5
@item NOSTEPLIMIT @tab don't limit timestep to less than line delay
@tab flag @tab not set @tab set
@item NOCONTROL @tab don't do complex timestep control
@tab flag @tab not set @tab set
@item LININTERP @tab use linear interpolation
@tab flag @tab not set @tab set
@item MIXEDINTERP @tab use linear when quadratic seems bad
@tab not set @tab set
@item COMPACTREL @tab special reltol for history compaction
@tab flag @tab RELTOL @tab 1.0e-3
@item COMPACTABS @tab special abstol for history compaction
@tab ABSTOL @tab 1.0e-9
@item TRUNCNR @tab use Newton-Raphson method for timestep control
@tab flag @tab not set @tab set
@item TRUNCDONTCUT @tab don't limit timestep to keep impulse-response
errors low @tab flag @tab not set @tab set
@end multitable
The following types of lines have been implemented so far: RLC (uniform
transmission line with series loss only), RC (uniform RC line), LC
(lossless transmission line), and RG (distributed series resistance and
parallel conductance only). Any other combination will yield erroneous
results and should not be tried. The length LEN of the line must be
specified.
NOSTEPLIMIT is a flag that will remove the default restriction of
limiting time-steps to less than the line delay in the RLC case.
NOCONTROL is a flag that prevents the default limiting of the time-step
based on convolution error criteria in the RLC and RC cases. This
speeds up simulation but may in some cases reduce the accuracy of
results. LININTERP is a flag that, when specified, will use linear
interpolation instead of the default quadratic interpolation for
calculating delayed signals. MIXEDINTERP is a flag that, when
specified, uses a metric for judging whether quadratic interpolation is
not applicable and if so uses linear interpolation; otherwise it uses
the default quadratic interpolation. TRUNCDONTCUT is a flag that
removes the default cutting of the time-step to limit errors in the
actual calculation of impulse-response related quantities. COMPACTREL
and COMPACTABS are quantities that control the compaction of the past
history of values stored for convolution. Larger values of these lower
accuracy but usually increase simulation speed. These are to be used
with the TRYTOCOMPACT option, described in the .OPTIONS section.
TRUNCNR is a flag that turns on the use of Newton-Raphson iterations to
determine an appropriate timestep in the timestep control routines. The
default is a trial and error procedure by cutting the previous timestep
in half. REL and ABS are quantities that control the setting of
breakpoints.
The option most worth experimenting with for increasing the speed of
simulation is REL. The default value of 1 is usually safe from the
point of view of accuracy but occasionally increases computation time.
A value greater than 2 eliminates all breakpoints and may be worth
trying depending on the nature of the rest of the circuit, keeping in
mind that it might not be safe from the viewpoint of accuracy.
Breakpoints may usually be entirely eliminated if it is expected the
circuit will not display sharp discontinuities. Values between 0 and 1
are usually not required but may be used for setting many breakpoints.
COMPACTREL may also be experimented with when the option TRYTOCOMPACT is
specified in a .OPTIONS card. The legal range is between 0 and 1.
Larger values usually decrease the accuracy of the simulation but in
some cases improve speed. If TRYTOCOMPACT is not specified on a
.OPTIONS card, history compaction is not attempted and accuracy is high.
NOCONTROL, TRUNCDONTCUT and NOSTEPLIMIT also tend to increase speed at
the expense of accuracy.
@node Uniform Distributed RC Lines (Lossy), Uniform Distributed RC Model (URC), Lossy Transmission Line Model (LTRA), Transmission Lines
@subsection Uniform Distributed RC Lines (Lossy)
General form:
@example
UXXXXXXX N1 N2 N3 MNAME L=LEN
@end example
Examples:
@example
U1 1 2 0 URCMOD L=50U
URC2 1 12 2 UMODL l=1MIL N=6
@end example
N1 and N2 are the two element nodes the RC line connects, while N3 is
the node to which the capacitances are connected. MNAME is the model
name, LEN is the length of the RC line in meters. LUMPS, if specified,
is the number of lumped segments to use in modelling the RC line (see the
model description for the action taken if this parameter is omitted).
@node Uniform Distributed RC Model (URC), , Uniform Distributed RC Lines (Lossy), Transmission Lines
@subsection Uniform Distributed RC Model (URC)
The URC model is derived from a model proposed by L. Gertzberrg in
1974. The model is accomplished by a subcircuit type expansion of the
URC line into a network of lumped RC segments with internally generated
nodes. The RC segments are in a geometric progression, increasing
toward the middle of the URC line, with @math{K} as a proportionality
constant. The number of lumped segments used, if not specified for the
URC line device, is determined by the following formula:
@tex
$$
N = { \log \left|
F_{\rm max} {R\over L}{C \over L} 2 J L^2
\left| (K - 1) \over K \right|^2
\right| \over \log K }
$$
@end tex
@ifnottex
@example
2
| R C |(K-1)| |
_ _ 2
log|F 2 J L |-----| |
max
| L L | K | |
N = ------------------------------
log K
@end example
@end ifnottex
The URC line is made up strictly of resistor and capacitor segments
unless the ISPERL parameter is given a nonzero value, in which case the
capacitors are replaced with reverse biased diodes with a zero-bias
junction capacitance equivalent to the capacitance replaced, and with a
saturation current of ISPERL amps per meter of transmission line and an
optional series resistance equivalent to RSPERL ohms per meter.
@multitable @columnfractions .1 .45 .1 .15 .1 .1
@item name @tab parameter
@tab units @tab default @tab example
@item K @tab Propagation Constant
@tab - @tab 2.0 @tab 1.2
@item FMAX @tab Maximum Frequency of interest
@tab Hz @tab 1.0G @tab 6.5Meg
@item RPERL @tab Resistance per unit length
@tab Z/m @tab 1000 @tab 10
@item CPERL @tab Capacitance per unit length
@tab F/m @tab 1.0e-15 @tab 1pF
@item ISPERL @tab Saturation Current per unit length
@tab A/m @tab 0 @tab -
@item RSPERL @tab Diode Resistance per unit length
@tab Z/m @tab 0 @tab -
@end multitable
@node Transistors and Diodes, , Transmission Lines, Circuit Elements and Models
@section Transistors and Diodes
The area factor used on the diode, BJT, JFET, and MESFET devices
determines the number of equivalent parallel devices of a specified
model. The affected parameters are marked with an asterisk under the
heading 'area' in the model descriptions below. Several geometric
factors associated with the channel and the drain and source diffusions
can be specified on the MOSFET device line.
Two different forms of initial conditions may be specified for some
devices. The first form is included to improve the dc convergence for
circuits that contain more than one stable state. If a device is
specified OFF, the dc operating point is determined with the terminal
voltages for that device set to zero. After convergence is obtained,
the program continues to iterate to obtain the exact value for the
terminal voltages. If a circuit has more than one dc stable state, the
OFF option can be used to force the solution to correspond to a desired
state. If a device is specified OFF when in reality the device is
conducting, the program still obtains the correct solution (assuming the
solutions converge) but more iterations are required since the program
must independently converge to two separate solutions. The .NODESET
control line serves a similar purpose as the OFF option. The .NODESET
option is easier to apply and is the preferred means to aid convergence.
The second form of initial conditions are specified for use with the
transient analysis. These are true 'initial conditions' as opposed to
the convergence aids above. See the description of the .IC control line
and the .TRAN control line for a detailed explanation of initial
conditions.
@menu
* Junction Diodes::
* Diode Model (D)::
* Diode Equations::
* Bipolar Junction Transistors (BJTs)::
* BJT Models (NPN/PNP)::
* Junction Field-Effect Transistors (JFETs)::
* JFET Models (NJF/PJF)::
* MOSFETs::
* MOSFET Models (NMOS/PMOS)::
* MESFETs::
* MESFET Models (NMF/PMF)::
@end menu
@node Junction Diodes, Diode Model (D), Transistors and Diodes, Transistors and Diodes
@subsection Junction Diodes
General form:
@example
DXXXXXXX n+ n- mname
+
@end example
Examples:
@example
DBRIDGE 2 10 DIODE1
DCLMP 3 7 DMOD 3.0 IC=0.2
@end example
The pn junction (diode) implemented in NGSPICE expands the original
spice's implementation. Perimetral effects and high injection level
have been introduced into the original model and temperature dependence
of some parameters has been added.
@option{n+} and @option{n-} are the positive and negative nodes, respectively.
@option{mname} is the model name, @option{area} is the area factor, @option{pj}
is the perimeter factor, and @option{off} indicates an (optional)starting
condition on the device for dc analysis. If the area factor is omitted,
a value of 1.0 is assumed. The (optional) initial condition specification
using @option{ic} is intended for use with the @option{uic} option on
the @code{.tran} control line, when a transient analysis is desired starting
from other than the quiescent operating point. You should supply the inital
voltage across the diode there. The (optional) @option{temp} value is
the temperature at which this device is to operate, and overrides the
temperature specification on the @code{.option} control line. As always,
instance temperature can be specified as an offset to the circuit
temperature with the @option{dtemp} option.
@node Diode Model (D), Diode Equations, Junction Diodes, Transistors and Diodes
@subsection Diode Model (D)
The dc characteristics of the diode are determined by the parameters
@option{IS} and @option{N}. An ohmic resistance, @option{RS}, is
included. Charge storage effects are modelled by a transit time,
@option{TT}, and a nonlinear depletion layer capacitance which is
determined by the parameters @option{CJO}, @option{VJ}, and @option{M}.
The temperature dependence of the saturation current is defined by the
parameters @option{EG}, the energy and @option{XTI}, the saturation
current temperature exponent. The nominal temperature at which these
parameters were measured is @option{TNOM}, which defaults to the
circuit-wide value specified on the @code{.options} control line.
Reverse breakdown is modelled by an exponential increase in the
reverse diode current and is determined by the parameters @option{BV}
and @option{IBV} (both of which are positive numbers).
@sc{Junction DC parameters}
@multitable @columnfractions .10 .40 .1 .15 .15 .10
@item name @tab parameter @tab units @tab default @tab example @tab scale factor
@item BV @tab reverse breakdown voltage @tab V @tab infinite @tab 40.0
@item IBV @tab current at breakdown voltage @tab A @tab 1.0e-3 @tab 1.0e-4
@item IK (IKF) @tab forward knee current @tab A @tab 1.0e-3 @tab 1.0e-6
@item IK @tab reverse knee current @tab A @tab 1.0e-3 @tab 1.0e-6
@item IS (JS) @tab saturation current @tab A @tab 1.0e-14 @tab 1.0e-16 @tab area
@item JSW @tab Sidewall saturation current @tab A @tab 1.0e-14 @tab 1.0e-15 @tab perim.
@item N @tab emission coefficient @tab - @tab 1 @tab 1.5
@item RS @tab ohmic resistance @tab Ohm @tab 0 @tab 100 @tab 1/area
@end multitable
@sc{Junction capacitance parameters}
@multitable @columnfractions .10 .40 .1 .15 .15 .10
@item name @tab parameter @tab units @tab default @tab example @tab scale factor
@item CJO (CJ0) @tab zero-bias junction bottowall capacitance @tab F @tab 0.0 @tab 2pF @tab area
@item CJP (CJSW) @tab zero-bias junction sidewall capacitance @tab F @tab 0.0 @tab .1pF @tab perim.
@item FC @tab coefficient for forward-bias depletion bottomwall capacitance formula
@tab - @tab 0.5 @tab -
@item FCS @tab coefficient for forward-bias depletion sidewall capacitance formula
@tab - @tab 0.5 @tab -
@item M (MJ) @tab Area junction grading coefficient @tab - @tab 0.5 @tab 0.5
@item MJSW @tab Periphery junction grading coefficient @tab - @tab 0.33 @tab 0.5
@item VJ @tab junction potential @tab V @tab 1 @tab 0.6
@item PHP @tab Periphery junction potential @tab V @tab 1 @tab 0.6
@item TT @tab transit-time @tab sec @tab 0 @tab 0.1ns
@end multitable
@sc{Temperature effects}
@multitable @columnfractions .10 .40 .1 .15 .15 .10
@item name @tab parameter @tab units @tab default @tab example @tab scale factor
@item EG @tab activation energy @tab eV @tab 1.11 @tab 1.11 Si
@item @tab @tab @tab @tab 0.69 Sbd
@item @tab @tab @tab @tab 0.67 Ge
@item TM1 @tab 1st order tempco for MJ @tab 1/@math{^o}C @tab 0.0 @tab -
@item TM2 @tab 2nd order tempco for MJ @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab -
@item TNOM @tab parameter measurement temperature @tab C @tab 27 @tab 50
@item TRS @tab 1st order tempco for RS @tab 1/@math{^o}C @tab 0.0 @tab -
@item TRS2 @tab 2nd order tempco for RS @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab -
@item TTT1 @tab 1st order tempco for TT @tab 1/@math{^o}C @tab 0.0 @tab -
@item TTT2 @tab 2nd order tempco for TT @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab -
@item XTI @tab saturation-current temp. exp @tab - @tab 3.0 @tab 3.0 pn
@item @tab @tab @tab @tab 2.0 Sbd
@end multitable
@sc{Noise modeling}
@multitable @columnfractions .10 .40 .1 .15 .15 .10
@item name @tab parameter @tab units @tab default @tab example @tab scale factor
@item KF @tab flicker noise coefficient @tab - @tab 0
@item AF @tab flicker noise exponent @tab - @tab 1
@end multitable
@node Diode Equations, Bipolar Junction Transistors (BJTs), Diode Model (D), Transistors and Diodes
@subsection Diode Equations
The junction diode is the the basic semiconductor device and the simplest
one modeled in NGSPICE, but it's model is quite complex, even if not
all the physical phenomena affecting a pn junction are modelled. The diode
is modeled in three different regions:
@itemize @bullet
@item
Forward bias: the anode is more positive than the cathode, the
diode is "on" and can conduct large currents. To avoid convergence
problems and unrealistic high current, it is better to specify a
series resistance to limit current with @option{RS} model parameter.
@item
Reverse bias: the cathode is more positive than the anode and
the diode is "off". A reverse bias diode conducts a small leakage
current.
@item
Breakdown: the breakdown region is modelled only if the @option{BV}
model parameter is given. When a diode enters breakdown the current
increase exponentially (remember to limit it). @option{BV} is a
positive value.
@end itemize
@sc{Parameters Scaling}
Model parameters are scaled using the unitless parameters @option{AREA}
and @option{PJ} and the multiplier @option{M} as depicted below:
@tex
$$AREA_{eff} = {\rm AREA}\cdot{\rm M} $$
$$PJ_{eff} = {\rm PJ}\cdot{\rm M} $$
$$IS_{eff} = {\rm IS} \cdot AREA_{eff} + {\rm JSW} * PJ_{eff} $$
$$IBV_{eff} = {\rm IBV}\cdot AREA_{eff}$$
$$IK_{eff} = {\rm IK}\cdot AREA_{eff} $$
$$IKR_{eff} = {\rm IKR}\cdot AREA_{eff} $$
$$CJ_{eff} = {\rm CJ0}\cdot AREA_{eff} $$
$$CJP_{eff} = {\rm CJP}\cdot PJ_{eff} $$
@end tex
@ifnottex
@example
AREAeff = AREA * M
PJeff = PJ * M
ISeff = IS * AREAeff + JSW * PJeff
IKeff = IK * AREAeff
IKReff = IKR * AREAeff
CJeff = CJ0 * AREAeff
CJPeff = CJP * PJeff
@end example
@end ifnottex
@sc{Diode DC, Transient and AC model equations}
@tex
$$
I_D= \cases{IS_{eff} ( e^{q V_D \over N k T} - 1) + V_D * GMIN, &if $V_D \geq -3{NkT \over q}$\cr
-IS_{eff} [1 + ({3NkT \over q V_D e })^3] + V_D * GMIN , &if $-BV_{eff} mname
+
@end example
Examples:
@example
Q23 10 24 13 QMOD IC=0.6, 5.0
Q50A 11 26 4 20 MOD1
@end example
@option{nc}, @option{nb}, and @option{ne} are the collector, base, and
emitter nodes, respectively. @option{ns} is the (optional) substrate
node.If unspecified, ground is used. @option{mname} is the model name,
@option{area}, @option{areab}, @option{areac} are the area factors, and
@option{off} indicates an (optional) initial condition on the device
for the dc analysis. If the area factor is omitted, a value of 1.0 is
assumed. The (optional) initial condition specification using
@option{ic=vbe, vce} is intended for use with the @option{uic}
@command{.tran} control line, when a transient analysis is desired
starting from other than the quiescent operating point. See the
@command{.ic} control line description for a better way to set
transient initial conditions. The (optional) @option{temp} value is
the temperature at which this device is to operate, and overrides the
temperature specification on the @command{.option} control line. Using
@option{dtemp} option you can specify instance's temperature relative
to the circuit temperature.
@node BJT Models (NPN/PNP), Junction Field-Effect Transistors (JFETs), Bipolar Junction Transistors (BJTs), Transistors and Diodes
@subsection BJT Models (NPN/PNP)
NGSPICE provides two BJT device models. The @option{level} specifies the
model to be used:
@itemize @bullet
@item level=1 : This is the original spice BJT model, and it is the
default model if the @option{level} keyword is not
specified on the @command{.model} line.
@item level=2 : This is a modified version of the original spice
BJT that models both vertical and lateral devices and
includes temperature corrections of collector,
emitter and base resistors.
@end itemize
The bipolar junction transistor model in NGSPICE is an adaptation of the
integral charge control model of Gummel and Poon. This modified
Gummel-Poon model extends the original model to include several effects
at high bias levels. The model automatically simplifies to the simpler
Ebers-Moll model when certain parameters are not specified. The
parameter names used in the modified Gummel-Poon model have been chosen
to be more easily understood by the program user, and to reflect better
both physical and circuit design thinking.
The dc model is defined by the parameters @option{IS}, @option{BF},
@option{NF}, @option{ISE}, @option{IKF}, amd @option{NE} which determine
the forward current gain characteristics, @option{IS}, @option{BR},
@option{NR}, @option{ISC}, @option{IKR}, and @option{NC} which determine
the reverse current gain characteristics, and @option{VAF} and @option{VAR}
which determine the output conductance for forward and reverse regions.
Level 2 model includes substrate saturation current @option{ISS}.
Three ohmic resistances @option{RB}, @option{RC}, and @option{RE}
are included, where @option{RB} can be high current dependent. Base charge
storage is modelled by forward and reverse transit times, @option{TF} and
@option{TR}, the forward transit time @option{TF} being bias dependent if
desired, and nonlinear depletion layer capacitances which are determined by
@option{CJE}, @option{VJE}, and @option{NJE} for the B-E junction, @option{CJC},
@option{VJC}, and @option{NJC} for the B-C junction and @option{CJS},
@option{VJS}, and @option{MJS} for the C-S (Collector-Substrate) junction.
Level 2 model defines a substrate capacitance that will be connected to
device's base or collector, to model lateral or vertical devices.
The temperature dependence of the saturation currents, @option{IS} and
@option{ISS} (for level 2 model), is determined by the energy-gap,
@option{EG}, and the saturation current temperature exponent, @option{XTI}.
Additionally base current temperature dependence is modelled by the beta
temperature exponent @option{XTB} in the new model. The values specified
are assumed to have been measured at the temperature @option{TNOM}, which
can be specified on the @command{.options} control line or overridden by
a specification on the @command{.model} line.
The BJT parameters used in the modified Gummel-Poon model are listed
below. The parameter names used in earlier versions of SPICE2 are still
accepted.
Modified Gummel-Poon BJT Parameters:
@multitable @columnfractions .1 .40 .10 .15 .15 .1
@item name @tab parameter @tab units @tab default @tab example @tab scale factor
@item SUBS @tab substrate connection: 1 for
vertical geometry, -1 for
lateral geometry.
(level 2 only) @tab 1 @tab
@tab 1.0e-15 @tab
@item IS @tab transport saturation current @tab A @tab 1.0e-16
@tab 1.0e-15 @tab area
@item ISS @tab reverse saturation current,
substrate-to-collector for
vertical device or
substrate-to-base for lateral
(level 2 only) @tab A @tab 1.0e-16
@tab 1.0e-15 @tab area
@item BF @tab ideal maximum forward beta @tab - @tab 100 @tab 100
@item NF @tab forward current emission
coefficient @tab - @tab 1.0 @tab 1
@item VAF @tab forward Early voltage @tab V @tab infinite @tab 200
@item IKF @tab corner for forward beta
current roll-off @tab A @tab infinite
@tab 0.01 @tab area
@item ISE @tab B-E leakage saturation current @tab A @tab 0 @tab 1.0e-13
@tab area
@item NE @tab B-E leakage emission coefficient @tab - @tab 1.5 @tab 2
@item BR @tab ideal maximum reverse beta @tab - @tab 1 @tab 0.1
@item NR @tab reverse current emission coefficient @tab - @tab 1
@tab 1
@item VAR @tab reverse Early voltage @tab V @tab infinite @tab 200
@item IKR @tab corner for reverse beta high current roll-off
@tab A @tab infinite @tab 0.01 @tab area
@item ISC @tab B-C leakage saturation current
(area is "areab" for vertical
devices and "areac" for lateral) @tab A @tab 0
@tab 1.0e-13 @tab area
@item NC @tab B-C leakage emission coefficient @tab - @tab 2 @tab 1.5
@item RB @tab zero bias base resistance @tab Z @tab 0 @tab 100 @tab area
@item IRB @tab current where base
resistance falls halfway
to its min value @tab A @tab infinite @tab 0.1 @tab area
@item RBM @tab minimum base resistance at high currents @tab Z
@tab RB 10 @tab area
@item RE @tab emitter resistance @tab Z @tab 0 @tab 1 @tab area
@item RC @tab collector resistance @tab Z @tab 0 @tab 10 @tab area
@item CJE @tab B-E zero-bias depletion capacitance @tab F @tab 0
@tab 2pF @tab area
@item VJE @tab B-E built-in potential @tab V @tab 0.75 @tab 0.6
@item MJE @tab B-E junction exponential factor @tab - @tab 0.33 @tab 0.33
@item TF @tab ideal forward transit time @tab sec @tab 0 @tab 0.1ns
@item XTF @tab coefficient for bias dependence of TF @tab - @tab 0
@item VTF @tab voltage describing VBC dependence of TF @tab V @tab infinite
@item ITF @tab high-current parameter for effect on TF @tab A
@tab 0 @tab - @tab area
@item PTF @tab excess phase at freq=1.0/(TF*2PI) Hz @tab deg @tab 0
@item CJC @tab B-C zero-bias depletion capacitance
(area is "areab" for vertical
devices and "areac" for lateral) @tab F @tab 0
@tab 2pF @tab area
@item VJC @tab B-C built-in potential @tab V @tab 0.75 @tab 0.5
@item MJC @tab B-C junction exponential factor @tab - @tab 0.33 @tab 0.5
@item XCJC @tab fraction of B-C depletion capacitance connected to
internal base node @tab - @tab 1
@item TR @tab ideal reverse transit time @tab sec @tab 0 @tab 10ns
@item CJS @tab zero-bias collector-substrate capacitance
(area is "areac" for vertical devices and
"areab" for lateral) @tab F @tab 0
@tab 2pF @tab area
@item VJS @tab substrate junction built-in potential @tab V @tab 0.75
@item MJS @tab substrate junction exponential factor @tab - @tab 0 @tab 0.5
@item XTB @tab forward and reverse beta temperature exponent @tab - @tab
0
@item EG @tab energy gap for temperature effect on IS @tab eV @tab 1.11
@item XTI @tab temperature exponent for effect on IS @tab - @tab 3
@item KF @tab flicker-noise coefficient @tab - @tab 0
@item AF @tab flicker-noise exponent @tab - @tab 1
@item FC @tab coefficient for forward-bias depletion capacitance formula
@tab - @tab 0.5 @tab o
@item TNOM @tab Parameter measurement temperature @tab @math{^o}C @tab 27 @tab 50
@item TRE1 @tab 1st order temperature coefficient for RE
(level 2 only) @tab 1/@math{^o}C @tab 0.0 @tab 1e-3
@item TRE2 @tab 2nd order temperature coefficient for RE
(level 2 only) @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab 1e-5
@item TRC1 @tab 1st order temperature coefficient for RC
(level 2 only )@tab 1/@math{^o}C @tab 0.0 @tab 1e-3
@item TRC2 @tab 2nd order temperature coefficient for RC
(level 2 only) @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab 1e-5
@item TRB1 @tab 1st order temperature coefficient for RB
(level 2 only) @tab 1/@math{^o}C @tab 0.0 @tab 1e-3
@item TRB2 @tab 2nd order temperature coefficient for RB
(level 2 only) @tab 1/@math{^o}C@math{^2} @tab 0.0 @tab 1e-5
@item TRB1 @tab 1st order temperature coefficient for RBM
(level 2 only) @tab 1/@math{^o}C @tab TRB1 @tab 1e-3
@item TRB2 @tab 2nd order temperature coefficient for RBM
(level 2 only) @tab 1/@math{^o}C@math{^2} @tab TRB2 @tab 1e-5
@end multitable
@node Junction Field-Effect Transistors (JFETs), JFET Models (NJF/PJF), BJT Models (NPN/PNP), Transistors and Diodes
@subsection Junction Field-Effect Transistors (JFETs)
General form:
@example
JXXXXXXX ND NG NS MNAME
@end example
Examples:
@example
J1 7 2 3 JM1 OFF
@end example
ND, NG, and NS are the drain, gate, and source nodes, respectively.
MNAME is the model name, AREA is the area factor, and OFF indicates an
(optional) initial condition on the device for dc analysis. If the area
factor is omitted, a value of 1.0 is assumed. The (optional) initial
condition specification, using IC=VDS, VGS is intended for use with the
UIC option on the .TRAN control line, when a transient analysis is
desired starting from other than the quiescent operating point. See the
.IC control line for a better way to set initial conditions. The
(optional) TEMP value is the temperature at which this device is to
operate, and overrides the temperature specification on the .OPTION
control line.
@node JFET Models (NJF/PJF), MOSFETs, Junction Field-Effect Transistors (JFETs), Transistors and Diodes
@subsection JFET Models (NJF/PJF)
The JFET model is derived from the FET model of Shichman and Hodges.
The dc characteristics are defined by the parameters VTO and BETA, which
determine the variation of drain current with gate voltage, LAMBDA,
which determines the output conductance, and IS, the saturation current
of the two gate junctions. Two ohmic resistances, RD and RS, are
included. Charge storage is modelled by nonlinear depletion layer
capacitances for both gate junctions which vary as the -1/2 power of
junction voltage and are defined by the parameters CGS, CGD, and PB.
Note that in Spice3f and later, a fitting parameter B has been added.
For details, see [9].
@multitable @columnfractions .1 .45 .15 .15 .15 .1
@item name @tab parameter @tab units @tab default @tab example @tab area
@item VTO @tab threshold voltage (@math{V_T0}) @tab V @tab -2.0 @tab -2.0
@item BETA @tab transconductance parameter (B)
@tab A/V@math{^2} @tab 1.0e-4 @tab 1.0e-3 @tab *
@item LAMBDA @tab channel-length modulation parameter (L)
@tab 1/V @tab 0 @tab 1.0e-4
@item RD @tab drain ohmic resistance @tab Z @tab 0 @tab 100 @tab *
@item RS @tab source ohmic resistance @tab Z @tab 0 @tab 100 @tab *
@item CGS @tab zero-bias G-S junction capacitance (@math{C_gs})
@tab F @tab 0 @tab 5pF @tab *
@item CGD @tab zero-bias G-D junction capacitance (@math{C_gs})
@tab F @tab 0 @tab 1pF @tab *
@item PB @tab gate junction potential @tab V @tab 1 @tab 0.6
@item IS @tab gate junction saturation current (@math{I_S})
@tab A @tab 1.0e-14 @tab 1.0e-14 @tab *
@item B @tab doping tail parameter @tab - @tab 1 @tab 1.1
@item KF @tab flicker noise coefficient @tab - @tab 0
@item AF @tab flicker noise exponent @tab - @tab 1
@item FC @tab coefficient for forward-bias depletion capacitance formula
@tab - @tab 0.5
@item TNOM @tab parameter measurement temperature
@tab @math{^o}C @tab 27 @tab 50
@end multitable
@node MOSFETs, MOSFET Models (NMOS/PMOS), JFET Models (NJF/PJF), Transistors and Diodes
@subsection MOSFETs
General form:
@example
MXXXXXXX ND NG NS NB MNAME
+
+
@end example
Examples:
@example
M1 24 2 0 20 TYPE1
M31 2 17 6 10 MODM L=5U W=2U
M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
@end example
ND, NG, NS, and NB are the drain, gate, source, and bulk (substrate)
nodes, respectively. MNAME is the model name. M is the multiplicity
parameter, which simulates m paralleled devices. All MOS models
support the "M" parameter. L and W are the channel length and width,
in meters. AD and AS are the areas of the drain and source diffusions,
in meters@math{^2}.
Note that the suffix U specifies microns (1e-6 m) and P sq-microns
(1e-12 m@math{^2}). If any of L, W, AD, or AS are not specified,
default values are used. The use of defaults simplifies input file
preparation, as well as the editing required if device geometries are
to be changed. PD and PS are the perimeters of the drain and source
junctions, in meters. NRD and NRS designate the equivalent number of
squares of the drain and source diffusions; these values multiply the
sheet resistance RSH specified on the .MODEL control line for an
accurate representation of the parasitic series drain and source
resistance of each transistor. PD and PS default to 0.0 while NRD
and NRS to 1.0. OFF indicates an (optional) initial condition on the
device for dc analysis. The (optional) initial condition specification
using IC=VDS, VGS, VBS is intended for use with the UIC option on the
.TRAN control line, when a transient analysis is desired starting from
other than the quiescent operating point. See the .IC control line for
a better and more convenient way to specify transient initial conditions.
The (optional) TEMP value is the temperature at which this device is to
operate, and overrides the temperature specification on the .OPTION
control line. The temperature specification is ONLY valid for level 1,
2, 3, and 6 MOSFETs, not for level 4 or 5 (BSIM) devices.
@node MOSFET Models (NMOS/PMOS), MESFETs, MOSFETs, Transistors and Diodes
@subsection MOSFET Models (NMOS/PMOS)
MOSFET models are the central part of NGSPICE, probably because they are
the most widely used devices in the electronics world. NGSPICE provides
all the MOSFETs implemented in the original Spice3f and adds several models
developed by Berkeley's Device Group and other independent groups. Not all
models below are included in the standard NGSPICE distribution because of
copyright restrictions.
NGSPICE provides four MOSFET device models, which differ in the
formulation of the I-V characteristic. The variable LEVEL specifies the
model to be used:
@multitable @columnfractions .10 .33 .50
@item LEVEL @tab Model @tab Notes
@item 1 @tab Shichman-Hodges @tab The classical model
@item 2 @tab MOS2 @tab Described in [2]
@item 3 @tab MOS3 @tab A semi-empirical model (see [1])
@item 4 @tab BSIM @tab Described in [3]
@item 5 @tab BSIM2 @tab Described in [5]
@item 6 @tab MOS6 @tab Described in [2]
@item 8 @tab BSIM3 @tab Described in [13]
@item 9 @tab MOS9 @tab n/a
@item 10 @tab B3SOI @tab n/a
@item 14 @tab BSIM4 @tab n/a
@item 17 @tab HiSIM1 @tab n/a
@item 29 @tab B3SOIPD @tab n/a
@item 30 @tab B3SOIFD @tab n/a
@item 31 @tab B3SOIDD @tab n/a
@item 14 @tab BSIM4 @tab n/a
@item 44 @tab EKV @tab n/a
@item 49 @tab BSIM3v1s @tab n/a (Serban Version)
@item 50 @tab BSIM3v1 @tab n/a (Berkeley Version)
@item 51 @tab BSIM3v1a @tab n/a (Alan Version)
@item 52 @tab BSIM3v0 @tab n/a (Berkeley Version)
@item 62 @tab STAG @tab n/a
@end multitable
Level 44 model (EKV) is not available in the standard distribution since
it is not released in source form. To obtain the code please refer to
the @uref{http://legwww.epfl.ch/ekv/, EKV group home page}.
The dc characteristics of the level 1 through level 3 MOSFETs are
defined by the device parameters VTO, KP, LAMBDA, PHI and GAMMA. These
parameters are computed by NGSPICE if process parameters (NSUB, TOX, ...)
are given, but users specified values always override. VTO is positive
(negative) for enhancement mode and negative (positive) for depletion
mode N-channel (P-channel) devices. Charge storage is modelled by three
constant capacitors, CGSO, CGDO, and CGBO which represent overlap
capacitances, by the nonlinear thin-oxide capacitance which is
distributed among the gate, source, drain, and bulk regions, and by the
nonlinear depletion-layer capacitances for both substrate junctions
divided into bottom and periphery, which vary as the MJ and MJSW power
of junction voltage respectively, and are determined by the parameters
CBD, CBS, CJ, CJSW, MJ, MJSW and PB. Charge storage effects are modelled
by the piecewise linear voltages-dependent capacitance model proposed by
Meyer. The thin-oxide charge-storage effects are treated slightly
different for the LEVEL=1 model. These voltage-dependent capacitances
are included only if TOX is specified in the input description and they
are represented using Meyer's formulation.
There is some overlap among the parameters describing the junctions,
e.g. the reverse current can be input either as IS (in A) or as JS (in
A/m@math{^2}). Whereas the first is an absolute value the second is
multiplied by AD and AS to give the reverse current of the drain and
source junctions respectively. This methodology has been chosen since
there is no sense in relating always junction characteristics with AD
and AS entered on the device line; the areas can be defaulted. The same
idea applies also to the zero-bias junction capacitances CBD and CBS (in
F) on one hand, and CJ (in F/m@math{^2}) on the other. The parasitic
drain and source series resistance can be expressed as either RD and RS
(in ohms) or RSH (in ohms/sq.), the latter being multiplied by the
number of squares NRD and NRS input on the device line.
A discontinuity in the MOS level 3 model with respect to the KAPPA
parameter has been detected (see [10]). The supplied fix has been
implemented in Spice3f2 and later. Since this fix may affect parameter
fitting, the option "BADMOS3" may be set to use the old implementation
(see the section on simulation variables and the ".OPTIONS" line).
NGSPICE level 1, 2, 3 and 6 parameters:
@multitable @columnfractions .1 .45 .15 .15 .15
@item name @tab parameter
@tab units @tab default @tab example
@item LEVEL @tab model index
@tab - @tab 1
@item VTO @tab zero-bias threshold voltage (@math{V_T0})
@tab V @tab 0.0 @tab 1.0
@item KP @tab transconductance parameter
@tab @math{A/V^2} @tab 2.0e-5 @tab 3.1e-5
@item GAMMA @tab bulk threshold parameter
@tab @math{V^1/2} @tab 0.0 @tab 0.37
@item PHI @tab surface potential (U)
@tab V @tab 0.6 @tab 0.65
@item LAMBDA @tab channel-length modulation (MOS1 and MOS2 only) (L)
@tab 1/V @tab 0.0 @tab 0.02
@item RD @tab drain ohmic resistance
@tab Z @tab 0.0 @tab 1.0
@item RS @tab source ohmic resistance
@tab Z @tab 0.0 @tab 1.0
@item CBD @tab zero-bias B-D junction capacitance
@tab F @tab 0.0 @tab 20fF
@item CBS @tab zero-bias B-S junction capacitance
@tab F @tab 0.0 @tab 20fF
@item IS @tab bulk junction saturation current (@math{I_S})
@tab A @tab 1.0e-14 @tab 1.0e-15
@item PB @tab bulk junction potential
@tab V @tab 0.8 @tab 0.87
@item CGSO @tab gate-source overlap capacitance per meter channel width
@tab F/m @tab 0.0 @tab 4.0e-11
@item CGDO @tab gate-drain overlap capacitance per meter channel width
@tab F/m @tab 0.0 @tab 4.0e-11
@item CGBO @tab gate-bulk overlap capacitance per meter channel length
@tab F/m @tab 0.0 @tab 2.0e-10
@item RSH @tab drain and source diffusion sheet resistance
@tab Z/[] @tab 0.0 @tab 10.0
@item CJ @tab zero-bias bulk junction bottom cap. per sq-meter of junction area
@tab @math{F/m^2} @tab 0.0 @tab 2.0e-4
@item MJ @tab bulk junction bottom grading coeff.
@tab - @tab 0.5 @tab 0.5
@item CJSW @tab zero-bias bulk junction sidewall cap. per meter of junction perimeter
@tab F/m @tab 0.0 @tab 1.0e-9
@item MJSW @tab bulk junction sidewall grading coeff.
@tab - @tab 0.50(level1), 0.33(level2, 3)
@item JS @tab bulk junction saturation current per sq-meter of junction area
@tab @math{A/m^2} @tab 1.0e-8
@item TOX @tab oxide thickness
@tab meter @tab 1.0e-7 @tab 1.0e-7
@item NSUB @tab substrate doping
@tab @math{1/cm^3} @tab 0.0 @tab 4.0e15
@item NSS @tab surface state density
@tab @math{1/cm^2} @tab 0.0 @tab 1.0e10
@item NFS @tab fast surface state density
@tab @math{1/cm^2} @tab 0.0 @tab 1.0e10
@item TPG @tab type of gate material:
+1 opp. to substrate, -1 same as substrate, 0 Al gate
@tab - @tab 1.0
@item XJ @tab metallurgical junction depth
@tab meter @tab 0.0 @tab 1M
@item LD @tab lateral diffusion
@tab meter @tab 0.0 @tab 0.8M
@item UO @tab surface mobility
@tab @math{cm^2/Vs} @tab 600 @tab 700
@item UCRIT @tab critical field for mobility degradation (MOS2 only)
@tab V/cm @tab 1.0e4 @tab 1.0e4
@item UEXP @tab critical field exponent in mobility degradation (MOS2 only)
@tab - @tab 0.0 @tab 0.1
@item UTRA @tab transverse field coeff. (mobility) (deleted for MOS2)
@tab - @tab 0.0 @tab 0.3
@item VMAX @tab maximum drift velocity of carriers
@tab m/s @tab 0.0 @tab 5.0e4
@item NEFF @tab total channel-charge (fixed and mobile) coefficient (MOS2 only)
@tab - @tab 1.0 @tab 5.0
@item KF @tab flicker noise coefficient
@tab - @tab 0.0 @tab 1.0e-26
@item AF @tab flicker noise exponent
@tab - @tab 1.0 @tab 1.2
@item FC @tab coefficient for forward-bias depletion capacitance formula
@tab - @tab 0.5
@item DELTA @tab width effect on threshold voltage (MOS2 and MOS3)
@tab - @tab 0.0 @tab 1.0
@item THETA @tab mobility modulation (MOS3 only)
@tab 1/V @tab 0.0 @tab 0.1
@item ETA @tab static feedback (MOS3 only)
@tab - @tab 0.0 @tab 1.0
@item KAPPA @tab saturation field factor (MOS3 only)
@tab - @tab 0.2 @tab 0.5
@item TNOM @tab parameter measurement temperature
@tab @math{^o}C @tab 27 @tab 50
@end multitable
The level 3 model available into ngspice takes into account
length and width mask adjustments (@code{xl} and @code{xw})
and device width narrowing due to diffusion (@code{wd}).
The level 4 and level 5 (BSIM1 and BSIM2) parameters are all values
obtained from process characterization, and can be generated
automatically. J. Pierret [4] describes a means of generating a
'process' file, and the program Proc2Mod provided with NGSPICE converts
this file into a sequence of BSIM1 ".MODEL" lines suitable for inclusion
in a NGSPICE input file. Parameters marked below with an * in the l/w
column also have corresponding parameters with a length and width
dependency. For example, VFB is the basic parameter with units of
Volts, and LVFB and WVFB also exist and have units of Volt-Mmeter The
formula
@tex
$$
P = P_0 + { P_L \over L_{\rm effective} } + { P_W \over W_{\rm effective} }
$$
@end tex
@ifnottex
@example
P P
L W
P = P + ---------- + ----------
0
L W
effective effective
@end example
@end ifnottex
is used to evaluate the parameter for the actual device specified with
@tex
$$
L_{\rm effective} = L_{\rm input} - DL
$$
@end tex
@ifnottex
@example
L = L - DL
effective input
@end example
@end ifnottex
and
@tex
$$
W_{\rm effective} = W_{\rm input} - DW
$$
@end tex
@ifnottex
@example
W = W - DW
effective input
@end example
@end ifnottex
Note that unlike the other models in NGSPICE, the BSIM model is designed
for use with a process characterization system that provides all the
parameters, thus there are no defaults for the parameters, and leaving
one out is considered an error. For an example set of parameters and
the format of a process file, see the SPICE2 implementation notes[3].
For more information on BSIM2, see reference [5].
NGSPICE BSIM (level 4) parameters.
@multitable @columnfractions .15 .55 .20 .10
@item name @tab parameter @tab units @tab l/w
@item VFB @tab flat-band voltage @tab V @tab *
@item PHI @tab surface inversion potential @tab V @tab *
@item K1 @tab body effect coefficient @tab V@math{^(1/2)} @tab *
@item K2 @tab drain/source depletion charge-sharing coefficient @tab - @tab *
@item ETA @tab zero-bias drain-induced barrier-lowering coefficient @tab - @tab *
@item MUZ @tab zero-bias mobility @tab cm@math{^2}/V-s @tab
@item DL @tab shortening of channel @tab Mm @tab
@item DW @tab narrowing of channel @tab Mm @tab
@item U0 @tab zero-bias transverse-field mobility degradation
coefficient @tab V@math{^-1} @tab *
@item U1 @tab zero-bias velocity saturation coefficient @tab Mm/V @tab *
@item X2MZ @tab sens. of mobility to substrate bias at V_ds=0 @tab cm@math{^2}/V-s @tab *
@item X2E @tab sens. of drain-induced barrier lowering effect to
substrate bias @tab V@math{^-1} @tab *
@item X3E @tab sens. of drain-induced barrier lowering effect to
drain bias at V_ds=V_dd @tab V@math{^-1} @tab *
@item X2U0 @tab sens. of transverse field mobility degradation
effect to substrate bias @tab V@math{^2} @tab *
@item X2U1 @tab sens. of velocity saturation effect to substrate
bias @tab MmV@math{^2} @tab *
@item MUS @tab mobility at zero substrate bias and at V_ds=V_dd @tab cm@math{^2}/V@math{^2}-s @tab
@item X2MS @tab sens. of mobility to substrate bias at V_ds=V_dd @tab cm@math{^2}/V@math{^2}-s @tab *
@item X3MS @tab sens. of mobility to drain bias at V_ds=V_dd @tab cm@math{^2}/V@math{^2}-s @tab *
@item X3U1 @tab sens. of velocity saturation effect on drain bias
at V_ds=V_dd @tab MmV@math{^2} @tab *
@item TOX @tab gate oxide thickness @tab Mm @tab
@item TEMP @tab temperature at which parameters were measured @tab C @tab
@item VDD @tab measurement bias range @tab V @tab
@item CGDO @tab gate-drain overlap capacitance per meter channel
width @tab F/m @tab
@item CGSO @tab gate-source overlap capacitance per meter channel
width @tab F/m @tab
@item CGBO @tab gate-bulk overlap capacitance per meter channel
length @tab F/m @tab
@item XPART @tab gate-oxide capacitance-charge model flag @tab - @tab
@item N0 @tab zero-bias subthreshold slope coefficient @tab - @tab *
@item NB @tab sens. of subthreshold slope to substrate bias @tab - @tab *
@item ND @tab sens. of subthreshold slope to drain bias @tab - @tab *
@item RSH @tab drain and source diffusion sheet resistance @tab Z/[] @tab
@item JS @tab source drain junction current density @tab A/m@math{^2} @tab
@item PB @tab built in potential of source drain junction @tab V @tab
@item MJ @tab Grading coefficient of source drain junction @tab - @tab
@item BSW @tab built in potential of source, drain junction
sidewall @tab V @tab
@item MJSW @tab grading coefficient of source drain junction
sidewall @tab - @tab
@item CJ @tab Source drain junction capacitance per unit area @tab F/m@math{^2} @tab
@item CJSW @tab source drain junction sidewall capacitance per
unit length @tab F/m @tab
@item WDF @tab source drain junction default width @tab m @tab
@item DELL @tab Source drain junction length reduction @tab m @tab
@end multitable
XPART = 0 selects a 40/60 drain/source charge partition in saturation,
while XPART=1 selects a 0/100 drain/source charge partition.
ND, NG, and NS are the drain, gate, and source nodes, respectively.
MNAME is the model name, AREA is the area factor, and OFF indicates an
(optional) initial condition on the device for dc analysis. If the area
factor is omitted, a value of 1.0 is assumed. The (optional) initial
condition specification, using IC=VDS, VGS is intended for use with the
UIC option on the .TRAN control line, when a transient analysis is
desired starting from other than the quiescent operating point. See the
.IC control line for a better way to set initial conditions.
@node MESFETs, MESFET Models (NMF/PMF), MOSFET Models (NMOS/PMOS), Transistors and Diodes
@subsection MESFETs
General form:
@example
ZXXXXXXX ND NG NS MNAME
@end example
Examples:
@example
Z1 7 2 3 ZM1 OFF
@end example
@node MESFET Models (NMF/PMF), , MESFETs, Transistors and Diodes
@subsection MESFET Models (NMF/PMF)
The MESFET model is derived from the GaAs FET model of Statz et al. as
described in [11]. The dc characteristics are defined by the parameters
VTO, B, and BETA, which determine the variation of drain current with
gate voltage, ALPHA, which determines saturation voltage, and LAMBDA,
which determines the output conductance. The formula are given by:
@tex
$$
\cases{I_d = {B (V_{gs} - V_T)^2 \over 1 + b(V_{gs} - V_T)}
\left| 1 - \left| 1 - A {V_{ds} \over 3 } \right|^3 \right|
(1 + L V_{ds}) & for $0 < V_{ds} < 3/A$ \cr
I_d = {B (V_{gs} - V_T)^2 \over 1 + b(V_{gs} - V_T)}
(1 + L V_{ds}) & for $V_{ds} > 3/A$ \cr}
$$
@end tex
@ifnottex
@example
3
2
B (V -V ) | | V | | 3
gs T ds _
I = --------------- |1 - |1-A---| |(1 + L V ) for 0 < V <
d ds ds
1 + b(V - V ) | | 3 | | A
gs T
2
B (V -V ) 3
gs T _
I = ---------------(1 + L V ) for V >
d ds ds
1 + b(V - V ) A
gs T
@end example
@end ifnottex
Two ohmic resistances, RD and RS, are included. Charge storage is
modeled by total gate charge as a function of gate-drain and gate-source
voltages and is defined by the parameters CGS, CGD, and PB.
@multitable {LAMBDA} {channel-length modulation parameter} {units} {default} {example} {area}
@item name @tab parameter @tab units @tab default @tab example @tab area
@item VTO @tab pinch-off voltage @tab V @tab -2.0 @tab -2.0
@item BETA @tab transconductance parameter @tab A/V@math{^2} @tab 1.0e-4 @tab 1.0e-3 @tab *
@item B @tab doping tail extending parameter @tab 1/V @tab 0.3 @tab 0.3 @tab *
@item ALPHA @tab saturation voltage parameter @tab 1/V @tab 2 @tab 2 @tab *
@item LAMBDA @tab channel-length modulation parameter @tab 1/V @tab 0 @tab 1.0e-4
@item RD @tab drain ohmic resistance @tab Z @tab 0 @tab 100 @tab *
@item RS @tab source ohmic resistance @tab Z @tab 0 @tab 100 @tab *
@item CGS @tab zero-bias G-S junction capacitance @tab F @tab 0 @tab 5pF @tab *
@item CGD @tab zero-bias G-D junction capacitance @tab F @tab 0 @tab 1pF @tab *
@item PB @tab gate junction potential @tab V @tab 1 @tab 0.6
@item KF @tab flicker noise coefficient @tab - @tab 0
@item AF @tab flicker noise exponent @tab - @tab 1
@item FC @tab coefficient for forward-bias
depletion capacitance formula @tab - @tab 0.5
@end multitable
@node Analyses and Output Control, Interactive Interpreter, Circuit Elements and Models, Top
@chapter Analyses and Output Control
The following command lines are for specifying analyses or plots within
the circuit description file. Parallel commands exist in the
interactive command interpreter (detailed in the following section).
Specifying analyses and plots (or tables) in the input file is useful
for batch runs. Batch mode is entered when either the -b option is
given or when the default input source is redirected from a file. In
batch mode, the analyses specified by the control lines in the input
file (e.g. ".ac", ".tran", etc.) are immediately executed (unless
".control" lines exists; see the section on the interactive command
interpreter). If the -r rawfile option is given then all data generated
is written to a Ngspice rawfile. The rawfile may be read by either the
interactive mode of Ngspice or by nutmeg; see the previous section for
details. In this case, the .SAVE line (see below) may be used to record
the value of internal device variables (see Appendix B).
If a rawfile is not specified, then output plots (in "line-printer"
form) and tables can be printed according to the .PRINT, .PLOT, and
.FOUR control lines, described next. .PLOT, .PRINT, and .FOUR lines are
meant for compatibility with Spice2.
@menu
* Simulator Variables (.OPTIONS)::
* Initial Conditions::
* Analyses::
* Batch Output::
@end menu
@node Simulator Variables (.OPTIONS), Initial Conditions, Analyses and Output Control, Analyses and Output Control
@section Simulator Variables (.OPTIONS)
Various parameters of the simulations available in Ngspice can be altered
to control the accuracy, speed, or default values for some devices.
These parameters may be changed via the "set" command (described later
in the section on the interactive front-end) or via the ".OPTIONS" line:
General form:
@example
.OPTIONS OPT1 OPT2 ... (or OPT=OPTVAL ...)
@end example
Examples:
@example
.OPTIONS RELTOL=.005 TRTOL=8
@end example
The options line allows the user to reset program control and user
options for specific simulation purposes. Additional options for Nutmeg
may be specified as well and take effect when Nutmeg reads the input
file. Options specified to Nutmeg via the 'set' command are also passed
on to NGSPICE as if specified on a .OPTIONS line. See the following
section on the interactive command interpreter for the parameters which
may be set with a .OPTIONS line and the format of the 'set' command.
Any combination of the following options may be included, in any order.
'x' (below) represents some positive number.
@vtable @code
@item ABSTOL=x
resets the absolute current error tolerance of the program. The default
value is 1 picoamp.
@item BADMOS3
Use the older version of the MOS3 model with the "kappa" discontinuity.
@item CHGTOL=x
resets the charge tolerance of the program. The default value is
1.0e-14.
@item DEFAD=x
resets the value for MOS drain diffusion area; the default is 0.0.
@item DEFAS=x
resets the value for MOS source diffusion area; the default is 0.0.
@item DEFL=x
resets the value for MOS channel length; the default is 100.0
micrometer.
@item DEFW=x
resets the value for MOS channel width; the default is 100.0 micrometer.
@item GMIN=x
resets the value of GMIN, the minimum conductance allowed by the
program. The default value is 1.0e-12.
@item ITL1=x
resets the dc iteration limit. The default is 100.
@item ITL2=x
resets the dc transfer curve iteration limit. The default is 50.
@item ITL3=x
resets the lower transient analysis iteration limit. the default value
is 4. (Note: not implemented in Ngspice).
@item ITL4=x
resets the transient analysis timepoint iteration limit. the default is
10.
@item ITL5=x
resets the transient analysis total iteration limit. the default is
5000. Set ITL5=0 to omit this test. (Note: not implemented in Ngspice).
@item KEEPOPINFO
Retain the operating point information when either an AC, Distortion, or
Pole-Zero analysis is run. This is particularly useful if the circuit
is large and you do not want to run a (redundant) ".OP" analysis.
@item METHOD=name
sets the numerical integration method used by NGSPICE. Possible names are
"Gear" or "trapezoidal" (or just "trap"). The default is trapezoidal.
@item PIVREL=x
resets the relative ratio between the largest column entry and an
acceptable pivot value. The default value is 1.0e-3. In the numerical
pivoting algorithm the allowed minimum pivot value is determined by
EPSREL=AMAX1(PIVREL*MAXVAL, PIVTOL) where MAXVAL is the maximum element
in the column where a pivot is sought (partial pivoting).
@item PIVTOL=x
resets the absolute minimum value for a matrix entry to be accepted as a
pivot. The default value is 1.0e-13.
@item RELTOL=x
resets the relative error tolerance of the program. The default value
is 0.001 (0.1%).
@item TEMP=x
Resets the operating temperature of the circuit. The default value is
27 deg C (300 deg K). TEMP can be overridden by a temperature
specification on any temperature dependent instance.
@item TNOM=x
resets the nominal temperature at which device parameters are measured.
The default value is 27 deg C (300 deg K). TNOM can be overridden by a
specification on any temperature dependent device model.
@item TRTOL=x
resets the transient error tolerance. The default value is 7.0. This
parameter is an estimate of the factor by which NGSPICE overestimates the
actual truncation error.
@item TRYTOCOMPACT
Applicable only to the LTRA model. When specified, the simulator tries
to condense LTRA transmission lines' past history of input voltages and
currents.
@item VNTOL=x
resets the absolute voltage error tolerance of the program. The default
value is 1 microvolt.
@end vtable
In addition, the following options have the listed effect when operating
in spice2 emulation mode:
@table @code
@item ACCT
causes accounting and run time statistics to be printed
@item LIST
causes the summary listing of the input data to be printed
@item NOMOD
suppresses the printout of the model parameters
@item NOPAGE
suppresses page ejects
@item NODE
causes the printing of the node table.
@item OPTS
causes the option values to be printed.
@end table
@node Initial Conditions, Analyses, Simulator Variables (.OPTIONS), Analyses and Output Control
@section Initial Conditions
@menu
* Specify Initial Node Voltage Guesses::
* Set Initial Conditions::
@end menu
@node Specify Initial Node Voltage Guesses, Set Initial Conditions, Initial Conditions, Initial Conditions
@subsection .NODESET: Specify Initial Node Voltage Guesses
General form:
@example
.NODESET V(NODNUM)=VAL V(NODNUM)=VAL ...
@end example
Examples:
@example
.NODESET V(12)=4.5 V(4)=2.23
@end example
The Nodeset line helps the program find the dc or initial transient
solution by making a preliminary pass with the specified nodes held to
the given voltages. The restriction is then released and the iteration
continues to the true solution. The .NODESET line may be necessary for
convergence on bistable or a-stable circuits. In general, this line
should not be necessary.
@node Set Initial Conditions, , Specify Initial Node Voltage Guesses, Initial Conditions
@subsection .IC: Set Initial Conditions
General form:
@example
.IC V(NODNUM)=VAL V(NODNUM)=VAL ...
@end example
Examples:
@example
.IC V(11)=5 V(4)=-5 V(2)=2.2
@end example
The IC line is for setting transient initial conditions. It has two
different interpretations, depending on whether the UIC parameter is
specified on the .TRAN control line. Also, one should not confuse this
line with the .NODESET line. The .NODESET line is only to help dc
convergence, and does not affect final bias solution (except for
multi-stable circuits). The two interpretations of this line are as
follows:
@enumerate
@item
When the UIC parameter is specified on the .TRAN line, then the node
voltages specified on the .IC control line are used to compute the
capacitor, diode, BJT, JFET, and MOSFET initial conditions. This is
equivalent to specifying the IC=... parameter on each device line, but
is much more convenient. The IC=... parameter can still be specified
and takes precedence over the .IC values. Since no dc bias (initial
transient) solution is computed before the transient analysis, one
should take care to specify all dc source voltages on the .IC control
line if they are to be used to compute device initial conditions.
@item
When the UIC parameter is not specified on the .TRAN control line, the
dc bias (initial transient) solution is computed before the transient
analysis. In this case, the node voltages specified on the .IC control
line is forced to the desired initial values during the bias solution.
During transient analysis, the constraint on these node voltages is
removed. This is the preferred method since it allows NGSPICE to compute
a consistent dc solution.
@end enumerate
@node Analyses, Batch Output, Initial Conditions, Analyses and Output Control
@section Analyses
@menu
* AC Small-Signal AC Analysis::
* DC Transfer Function::
* DISTRO Distortion Analysis::
* NOISE Noise Analysis::
* OP Operating Point Analysis::
* PZ Pole-Zero Analysis::
* SENS; DC or Small-Signal AC Sensitivity Analysis::
* TF Transfer Function Analysis::
* TRAN Transient Analysis::
@end menu
@node AC Small-Signal AC Analysis, DC Transfer Function, Analyses, Analyses
@subsection .AC: Small-Signal AC Analysis
General form:
@example
.AC DEC ND FSTART FSTOP
.AC OCT NO FSTART FSTOP
.AC LIN NP FSTART FSTOP
@end example
Examples:
@example
.AC DEC 10 1 10K
.AC DEC 10 1K 100MEG
.AC LIN 100 1 100HZ
@end example
DEC stands for decade variation, and ND is the number of points per
decade. OCT stands for octave variation, and NO is the number of points
per octave. LIN stands for linear variation, and NP is the number of
points. FSTART is the starting frequency, and FSTOP is the final
frequency. If this line is included in the input file, NGSPICE performs
an AC analysis of the circuit over the specified frequency range. Note
that in order for this analysis to be meaningful, at least one
independent source must have been specified with an ac value.
@node DC Transfer Function, DISTRO Distortion Analysis, AC Small-Signal AC Analysis, Analyses
@subsection .DC: DC Transfer Function
General form:
@example
.DC SRCNAM VSTART VSTOP VINCR [SRC2 START2 STOP2 INCR2]
@end example
Examples:
@example
.DC VIN 0.25 5.0 0.25
.DC VDS 0 10 .5 VGS 0 5 1
.DC VCE 0 10 .25 IB 0 10U 1U
.DC RLoad 1k 2k 100
.DC TEMP -15 75 5
@end example
The DC line defines the dc transfer curve source and sweep limits (again
with capacitors open and inductors shorted). SRCNAM is the name of an
independent voltage or current source, a resistor or the circuit temperature.
VSTART, VSTOP, and VINCR are the starting, final, and incrementing values
respectively. The first example causes the value of the voltage source VIN
to be swept from 0.25 Volts to 5.0 Volts in increments of 0.25 Volts. A
second source (SRC2) may optionally be specified with associated sweep
parameters. In this case, the first source is swept over its range for each
value of the second source. This option can be useful for obtaining
semiconductor device output characteristics. See the second example circuit
description in Appendix A.
@node DISTRO Distortion Analysis, NOISE Noise Analysis, DC Transfer Function, Analyses
@subsection .DISTO: Distortion Analysis
General form:
@example
.DISTO DEC ND FSTART FSTOP
.DISTO OCT NO FSTART FSTOP
.DISTO LIN NP FSTART FSTOP
@end example
Examples:
@example
.DISTO DEC 10 1kHz 100Mhz
.DISTO DEC 10 1kHz 100Mhz 0.9
@end example
The Disto line does a small-signal distortion analysis of the circuit.
A multi-dimensional Volterra series analysis is done using
multi-dimensional Taylor series to represent the nonlinearities at the
operating point. Terms of up to third order are used in the series
expansions.
If the optional parameter F2OVERF1 is not specified, .DISTO does a
harmonic analysis - i.e., it analyses distortion in the circuit using
only a single input frequency @math{F_1}, which is swept as specified by
arguments of the .DISTO command exactly as in the .AC command. Inputs
at this frequency may be present at more than one input source, and
their magnitudes and phases are specified by the arguments of the
DISTOF1 keyword in the input file lines for the input sources (see the
description for independent sources). (The arguments of the DISTOF2
keyword are not relevant in this case).
The analysis produces information about the A.C. values of all node
voltages and branch currents at the harmonic frequencies @math{2F_1} and
@math{3F_1}, vs. the input frequency @math{F_1} as it is swept. (A
value of 1 (as a complex distortion output) signifies
@math{\cos(2J(2F_1)t)} at @math{2F_1} and @math{\cos(2J(3F_1)t)} at
@math{3F_1}, using the convention that 1 at the input fundamental
frequency is equivalent to @math{\cos(2JF_1t)}.) The distortion
component desired (@math{2F_1} or @math{3F_1}) can be selected using
commands in nutmeg, and then printed or plotted. (Normally, one is
interested primarily in the magnitude of the harmonic components, so the
magnitude of the AC distortion value is looked at). It should be noted
that these are the A.C. values of the actual harmonic components, and
are not equal to HD2 and HD3. To obtain HD2 and HD3, one must divide by
the corresponding A.C. values at @math{F_1}, obtained from an .AC line.
This division can be done using nutmeg commands.
If the optional F2OVERF1 parameter is specified, it should be a real
number between (and not equal to) 0.0 and 1.0; in this case, .DISTO does
a spectral analysis. It considers the circuit with sinusoidal inputs at
two different frequencies @math{F_1} and F_2. @math{F_1} is swept
according to the .DISTO control line options exactly as in the .AC
control line. @math{F_2} is kept fixed at a single frequency as @math{F_1}
sweeps - the value at which it is kept fixed is equal to F2OVERF1 times
FSTART. Each independent source in the circuit may potentially have two
(superimposed) sinusoidal inputs for distortion, at the frequencies
@math{F_1} and F_2. The magnitude and phase of the @math{F_1} component
are specified by the arguments of the DISTOF1 keyword in the source's
input line (see the description of independent sources); the magnitude
and phase of the @math{F_2} component are specified by the arguments of the
DISTOF2 keyword. The analysis produces plots of all node
voltages/branch currents at the intermodulation product frequencies
@math{F_1 + F_2}, @math{F_1 - F_2}, and @math{(2 F_1) - F_2}, vs the
swept frequency @math{F_1}. The IM product of interest may be selected
using the setplot command, and displayed with the print and plot
commands. It is to be noted as in the harmonic analysis case, the
results are the actual AC voltages and currents at the intermodulation
frequencies, and need to be normalized with respect to .AC values to
obtain the IM parameters.
If the DISTOF1 or DISTOF2 keywords are missing from the description of
an independent source, then that source is assumed to have no input at
the corresponding frequency. The default values of the magnitude and
phase are 1.0 and 0.0 respectively. The phase should be specified in
degrees.
It should be carefully noted that the number F2OVERF1 should ideally be
an irrational number, and that since this is not possible in practice,
efforts should be made to keep the denominator in its fractional
representation as large as possible, certainly above 3, for accurate
results (i.e., if F2OVERF1 is represented as a fraction @math{A/B},
where @math{A} and @math{B} are integers with no common factors,
@math{B} should be as large as possible; note that @math{A < B} because
F2OVERF1 is constrained to be @math{< 1}). To illustrate why, consider
the cases where F2OVERF1 is 49/100 and 1/2. In a spectral analysis, the
outputs produced are at @math{F_1 + F_2}, @math{F_1 - F_2} and @math{2
F_1 - F_2}. In the latter case, @math{F_1 - F_2 = F_2}, so the result
at the @math{F_1 - F_2} component is erroneous because there is the
strong fundamental @math{F_2} component at the same frequency. Also,
@math{F_1 + F_2 = 2 F_1 - F_2} in the latter case, and each result is
erroneous individually. This problem is not there in the case where
F2OVERF1 = 49/100, because @math{F_1-F_2 = 51/100} @math{F_1 < > 49/100}
@math{F_1 = F_2}. In this case, there are two very closely spaced
frequency components at @math{F_2} and @math{F_1 - F_2}. One of the
advantages of the Volterra series technique is that it computes
distortions at mix frequencies expressed symbolically (i.e. @math{n F_1
+ m F_2}), therefore one is able to obtain the strengths of distortion
components accurately even if the separation between them is very small,
as opposed to transient analysis for example. The disadvantage is of
course that if two of the mix frequencies coincide, the results are not
merged together and presented (though this could presumably be done as a
postprocessing step). Currently, the interested user should keep track
of the mix frequencies himself or herself and add the distortions at
coinciding mix frequencies together should it be necessary.
@node NOISE Noise Analysis, OP Operating Point Analysis, DISTRO Distortion Analysis, Analyses
@subsection .NOISE: Noise Analysis
General form:
@example
.NOISE V(OUTPUT <,REF>) SRC ( DEC | LIN | OCT ) PTS FSTART FSTOP
+
@end example
Examples:
@example
.NOISE V(5) VIN DEC 10 1kHZ 100Mhz
.NOISE V(5,3) V1 OCT 8 1.0 1.0e6 1
@end example
The Noise line does a noise analysis of the circuit. OUTPUT is the node
at which the total output noise is desired; if REF is specified, then
the noise voltage V(OUTPUT) - V(REF) is calculated. By default, REF is
assumed to be ground. SRC is the name of an independent source to which
input noise is referred. PTS, FSTART and FSTOP are .AC type parameters
that specify the frequency range over which plots are desired.
PTS_PER_SUMMARY is an optional integer; if specified, the noise
contributions of each noise generator is produced every PTS_PER_SUMMARY
frequency points.
The .NOISE control line produces two plots - one for the Noise Spectral
Density curves and one for the total Integrated Noise over the specified
frequency range. All noise voltages/currents are in squared units
(V@math{^2} /Hz and A@math{^2}/Hz for spectral density, V@math{^2} and
A@math{^2} for integrated noise).
@node OP Operating Point Analysis, PZ Pole-Zero Analysis, NOISE Noise Analysis, Analyses
@subsection .OP: Operating Point Analysis
General form:
@example
.OP
@end example
The inclusion of this line in an input file directs NGSPICE to determine
the dc operating point of the circuit with inductors shorted and
capacitors opened. Note: a DC analysis is automatically performed prior
to a transient analysis to determine the transient initial conditions,
and prior to an AC small-signal, Noise, and Pole-Zero analysis to
determine the linearized, small-signal models for nonlinear devices (see
the KEEPOPINFO variable above).
@node PZ Pole-Zero Analysis, SENS; DC or Small-Signal AC Sensitivity Analysis, OP Operating Point Analysis, Analyses
@subsection .PZ: Pole-Zero Analysis
General form:
@example
.PZ NODE1 NODE2 NODE3 NODE4 CUR POL
.PZ NODE1 NODE2 NODE3 NODE4 CUR ZER
.PZ NODE1 NODE2 NODE3 NODE4 CUR PZ
.PZ NODE1 NODE2 NODE3 NODE4 VOL POL
.PZ NODE1 NODE2 NODE3 NODE4 VOL ZER
.PZ NODE1 NODE2 NODE3 NODE4 VOL PZ
@end example
Examples:
@example
.PZ 1 0 3 0 CUR POL
.PZ 2 3 5 0 VOL ZER
.PZ 4 1 4 1 CUR PZ
@end example
CUR stands for a transfer function of the type (output voltage)/(input
current) while VOL stands for a transfer function of the type (output
voltage)/(input voltage). POL stands for pole analysis only, ZER for
zero analysis only and PZ for both. This feature is provided mainly
because if there is a nonconvergence in finding poles or zeros, then, at
least the other can be found. Finally, NODE1 and NODE2 are the two
input nodes and NODE3 and NODE4 are the two output nodes. Thus, there
is complete freedom regarding the output and input ports and the type of
transfer function.
In interactive mode, the command syntax is the same except that the
first field is PZ instead of .PZ. To print the results, one should use
the command 'print all'.
@node SENS; DC or Small-Signal AC Sensitivity Analysis, TF Transfer Function Analysis, PZ Pole-Zero Analysis, Analyses
@subsection .SENS: DC or Small-Signal AC Sensitivity Analysis
General form:
@example
.SENS OUTVAR
.SENS OUTVAR AC DEC ND FSTART FSTOP
.SENS OUTVAR AC OCT NO FSTART FSTOP
.SENS OUTVAR AC LIN NP FSTART FSTOP
@end example
Examples:
@example
.SENS V(1,OUT)
.SENS V(OUT) AC DEC 10 100 100k
.SENS I(VTEST)
@end example
The sensitivity of OUTVAR to all non-zero device parameters is
calculated when the SENS analysis is specified. OUTVAR is a circuit
variable (node voltage or voltage-source branch current). The first
form calculates sensitivity of the DC operating-point value of OUTVAR.
The second form calculates sensitivity of the AC values of OUTVAR. The
parameters listed for AC sensitivity are the same as in an AC analysis
(see ".AC" above). The output values are in dimensions of change in
output per unit change of input (as opposed to percent change in output
or per percent change of input).
@node TF Transfer Function Analysis, TRAN Transient Analysis, SENS; DC or Small-Signal AC Sensitivity Analysis, Analyses
@subsection .TF: Transfer Function Analysis
General form:
@example
.TF OUTVAR INSRC
@end example
Examples:
@example
.TF V(5, 3) VIN
.TF I(VLOAD) VIN
@end example
The TF line defines the small-signal output and input for the dc
small-signal analysis. OUTVAR is the smallsignal output variable and
INSRC is the small-signal input source. If this line is included, NGSPICE
computes the dc small-signal value of the transfer function
(output/input), input resistance, and output resistance. For the first
example, NGSPICE would compute the ratio of V(5, 3) to VIN, the
small-signal input resistance at VIN, and the smallsignal output
resistance measured across nodes 5 and 3.
@node TRAN Transient Analysis, , TF Transfer Function Analysis, Analyses
@subsection .TRAN: Transient Analysis
General form:
@example
.TRAN TSTEP TSTOP >
@end example
Examples:
@example
.TRAN 1NS 100NS
.TRAN 1NS 1000NS 500NS
.TRAN 10NS 1US
@end example
TSTEP is the printing or plotting increment for lineprinter output. For
use with the post-processor, TSTEP is the suggested computing increment.
TSTOP is the final time, and TSTART is the initial time. If TSTART is
omitted, it is assumed to be zero. The transient analysis always begins
at time zero. In the interval , the circuit is analyzed
(to reach a steady state), but no outputs are stored. In the interval
, the circuit is analyzed and outputs are stored. TMAX
is the maximum stepsize that NGSPICE uses; for default, the program
chooses either TSTEP or (TSTOP-TSTART)/50.0, whichever is smaller. TMAX
is useful when one wishes to guarantee a computing interval which is
smaller than the printer increment, TSTEP.
UIC (use initial conditions) is an optional keyword which indicates that
the user does not want NGSPICE to solve for the quiescent operating point
before beginning the transient analysis. If this keyword is specified,
NGSPICE uses the values specified using IC=... on the various elements as
the initial transient condition and proceeds with the analysis. If the
.IC control line has been specified, then the node voltages on the .IC
line are used to compute the initial conditions for the devices. Look
at the description on the .IC control line for its interpretation when
UIC is not specified.
@node Batch Output, , Analyses, Analyses and Output Control
@section Batch Output
@menu
* SAVE::
* PRINT::
* PLOT::
* FOUR Fourier Analysis of Transient Analysis Output::
@end menu
@node SAVE, PRINT, Batch Output, Batch Output
@subsection .SAVE Lines
General form:
@example
.SAVE vector vector vector ...
@end example
Examples:
@example
.SAVE i(vin) input output
.SAVE @@m1[id]
@end example
The vectors listed on the .SAVE line are recorded in the rawfile for use
later with ngspice or nutmeg (nutmeg is just the data-analysis half of
ngspice, without the ability to simulate). The standard vector names are
accepted. If no .SAVE line is given, then the default set of vectors
are saved (node voltages and voltage source branch currents). If .SAVE
lines are given, only those vectors specified are saved. For more
discussion on internal device data, see Appendix B. See also the
section on the interactive command interpreter for information on how to
use the rawfile.
@node PRINT, PLOT, SAVE, Batch Output
@subsection .PRINT Lines
General form:
@example
.PRINT PRTYPE OV1
@end example
Examples:
@example
.PRINT TRAN V(4) I(VIN)
.PRINT DC V(2) I(VSRC) V(23, 17)
.PRINT AC VM(4, 2) VR(7) VP(8, 3)
@end example
The Print line defines the contents of a tabular listing of one to eight
output variables. PRTYPE is the type of the analysis (DC, AC, TRAN,
NOISE, or DISTO) for which the specified outputs are desired. The form
for voltage or current output variables is the same as given in the
previous section for the print command; Spice2 restricts the output
variable to the following forms (though this restriction is not enforced
by Ngspice):
@table @code
@item V(N1<,N2>)
specifies the voltage difference between nodes N1 and N2. If N2 (and
the preceding comma) is omitted, ground (0) is assumed. See the print
command in the previous section for more details. For compatibility
with spice2, the following five additional values can be accessed for
the ac analysis by replacing the "V" in V(N1,N2) with:
@example
VR - real part
VI - imaginary part
VM - magnitude
VP - phase
VDB - 20 log10(magnitude)
@end example
@item I(VXXXXXXX)
specifies the current flowing in the independent voltage source named
VXXXXXXX. Positive current flows from the positive node, through the
source, to the negative node. For the ac analysis, the corresponding
replacements for the letter I may be made in the same way as described
for voltage outputs.
@end table
Output variables for the noise and distortion analyses have a different
general form from that of the other analyses.
There is no limit on the number of .PRINT lines for each type of
analysis.
@node PLOT, FOUR Fourier Analysis of Transient Analysis Output, PRINT, Batch Output
@subsection .PLOT Lines
General form:
@example
.PLOT PLTYPE OV1 <(PLO1, PHI1)> ... OV8>
@end example
Examples:
@example
.PLOT DC V(4) V(5) V(1)
.PLOT TRAN V(17, 5) (2, 5) I(VIN) V(17) (1, 9)
.PLOT AC VM(5) VM(31, 24) VDB(5) VP(5)
.PLOT DISTO HD2 HD3(R) SIM2
.PLOT TRAN V(5, 3) V(4) (0, 5) V(7) (0, 10)
@end example
The Plot line defines the contents of one plot of from one to eight
output variables. PLTYPE is the type of analysis (DC, AC, TRAN, NOISE,
or DISTO) for which the specified outputs are desired. The syntax for
the OVI is identical to that for the .PRINT line and for the plot
command in the interactive mode.
The overlap of two or more traces on any plot is indicated by the letter
X.
When more than one output variable appears on the same plot, the first
variable specified is printed as well as plotted. If a printout of all
variables is desired, then a companion .PRINT line should be included.
There is no limit on the number of .PLOT lines specified for each type of analysis.
@node FOUR Fourier Analysis of Transient Analysis Output, , PLOT, Batch Output
@subsection .FOUR: Fourier Analysis of Transient Analysis Output
General form:
@example
.FOUR FREQ OV1
@end example
Examples:
@example
.FOUR 100K V(5)
@end example
The Four (or Fourier) line controls whether NGSPICE performs a Fourier
analysis as a part of the transient analysis. FREQ is the fundamental
frequency, and OV1, desired. The Fourier analysis is performed over the
interval , where TSTOP is the final time specified
for the transient analysis, and period is one period of the fundamental
frequency. The dc component and the first nine harmonics are
determined. For maximum accuracy, TMAX (see the .TRAN line) should be
set to period/100.0 (or less for very high-Q circuits).
@node Interactive Interpreter, Bibliography, Analyses and Output Control, Top
@chapter Interactive Interpreter
Ngspice consists of a simulator and a front-end for data analysis and
plotting. The front-end may be run as a separate "stand-alone" program
under the name Nutmeg.
Nutmeg will read in the "raw" data output file created by ngspice -r or
with the write command in an interactive Ngspice session. Nutmeg or
interactive Ngspice can plot data from a simulation on a graphics
terminal or a workstation display. Most of the commands available in
the interactive Ngspice front end are available in nutmeg; where this is
not the case, ngspice-only commands have been marked with an asterisk
("*"). Note that the raw output file is different from the data that
Spice2 writes to the standard output, which may also be produced by
ngspice with the "-b" command line option.
Ngspice and Nutmeg use the X Window System for plotting if they find the
environment variable DISPLAY. Otherwise, a graphics-terminal
independent interface (MFB) is used. If you are using X on a
workstation, the DISPLAY variable should already be set; if you want to
display graphics on a system different from the one you are running
Ngspice or Nutmeg on, DISPLAY should be of the form "machine:0.0". See
the appropriate documentation on the X Window System for more details.
Command Synopsis
@example
ngspice [ -n ] [ -t term ] [ -r rawfile] [ -b ] [ -i ] [ input file ... ]
nutmeg [ - ] [ -n ] [ -t term ] [ datafile ... ]
@end example
Options are:
@table @code
@item -
Don't try to load the default data file ("rawspice.raw") if no other
files are given. Nutmeg only.
@item -n (or -N)
Don't try to source the file ".spiceinit" upon startup. Normally ngspice
and nutmeg try to find the file in the current directory, and if it is
not found then in the user's home directory.
@item -t term (or -T term)
The program is being run on a terminal with mfb name term.
@item -b (or -B)
Run in batch mode. Ngspice reads the default input source (e.g.
keyboard) or reads the given input file and performs the analyses
specified; output is either Spice2-like line-printer plots ("ascii
plots") or a ngspice rawfile. See the following section for details.
Note that if the input source is not a terminal (e.g. using the IO
redirection notation of "<") Ngspice defaults to batch mode (-i
overrides). This option is valid for Ngspice only.
@item -s (or -S)
Run in server mode. This is like batch mode, except that a temporary
rawfile is used and then written to the standard output, preceded by a
line with a single "@@", after the simulation is done. This mode is used
by the ngspice daemon. This option is valid for Ngspice only.
@item -i (or -I)
Run in interactive mode. This is useful if the standard input is not a
terminal but interactive mode is desired. Command completion is not
available unless the standard input is a terminal, however. This option
is valid for Ngspice only.
@item -r rawfile (or -P rawfile)
Use rawfile as the default file into which the results of the simulation
are saved. This option is valid for Ngspice only.
@end table
Further arguments to ngspice are taken to be Ngspice input files, which are
read and saved (if running in batch mode then they are run immediately).
Ngspice accepts most Spice2 input file, and output ascii plots, fourier
analyses, and node printouts as specified in .plot, .four, and .print
cards. If an out parameter is given on a .width card, the effect is the
same as set width = .... Since Ngspice ascii plots do not use multiple
ranges, however, if vectors together on a .plot card have different
ranges they are not provide as much information as they would in Spice2.
The output of Ngspice is also much less verbose than Spice2, in that the
only data printed is that requested by the above cards.
For nutmeg, further arguments are taken to be data files in binary or
ascii format (see sconvert(1)) which are loaded into nutmeg. If the
file is in binary format, it may be only partially completed (useful for
examining Spice2 output before the simulation is finished). One file
may contain any number of data sets from different analyses.
@menu
* Expressions::
* Command Interpretation::
* Commands::
* Variables::
* Bugs::
@end menu
@node Expressions, Command Interpretation, Interactive Interpreter, Interactive Interpreter
@section Expressions, Functions, and Constants
Ngspice and Nutmeg data is in the form of vectors: time, voltage, etc.
Each vector has a type, and vectors can be operated on and combined
algebraically in ways consistent with their types. Vectors are normally
created when a data file is read in (see the load command below), and
when the initial datafile is loaded. They can also be created with the
let command.
An expression is an algebraic formula involving vectors and scalars (a
scalar is a vector of length 1) and the following operations:
@example
+ - * / ^ %
@end example
% is the modulo operator, and the comma operator has two meanings: if it
is present in the argument list of a user definable function, it serves
to separate the arguments. Otherwise, the term @code{x , y} is
synonymous with @code{x + j(y)}.
Also available are the logical operations & (and), | (or), ! (not), and
the relational operations <, >, >=, <=, =, and <> (not equal). If used
in an algebraic expression they work like they would in C, producing
values of 0 or 1. The relational operators have the following synonyms:
@example
gt >
lt <
ge >=
le <=
ne <>
eq =
and &
or |
not !
@end example
These are useful when < and > might be confused with IO redirection
(which is almost always).
The following functions are available:
@ftable @code
@item mag(vector)
The magnitude of vector
@item ph(vector)
The phase of vector
@item j(vector)
i (sqrt(-1)) times vector
@item real(vector)
The real component of vector
@item imag(vector)
The imaginary part of vector
@item db(vector)
20 log10(mag(vector))
@item log(vector)
The logarithm (base 10) of vector
@item ln(vector)
The natural logarithm (base e) of vector
@item exp(vector)
e to the vector power
@item abs(vector)
The absolute value of vector.
@item sqrt(vector)
The square root of vector.
@item sin(vector)
The sine of vector.
@item cos(vector)
The cosine of vector.
@item tan(vector)
The tangent of vector.
@item atan(vector)
The inverse tangent of vector.
@item norm(vector)
The vector normalized to 1 (i.e, the largest magnitude of any component
is 1).
@item rnd(vector)
A vector with each component a random integer between 0 and the absolute
value of the vectors's corresponding component.
@item mean(vector)
The result is a scalar (a length 1 vec tor) that is the mean of the
elements of vector.
@item vector(number)
The result is a vector of length number, with elements 0, 1, ... number
- 1. If number is a vector then just the first element is taken, and if
it isn't an integer then the floor of the magnitude is used.
@item length(vector)
The length of vector.
@item interpolate(plot.vector)
The result of interpolating the named vector onto the scale of
the current plot. This function uses the variable polydegree to
determine the degree of interpolation.
@item deriv(vector)
Calculates the derivative of the given vector. This uses numeric
differentiation by interpolating a polynomial and may not produce
satisfactory results (particularly with iterated differentiation). The
implementation only calculates the derivative with respect to the real
component of that vector's scale.
@end ftable
A vector may be either the name of a vector already defined or a
floating-point number (a scalar). A number may be written in any format
acceptable to NGSPICE, such as 14.6Meg or -1.231e-4. Note that you can
either use scientific notation or one of the abbreviations like MEG or
G, but not both. As with NGSPICE, a number may have trailing alphabetic
characters after it.
The notation expr [num] denotes the num'th element of expr. For
multi-dimensional vectors, a vector of one less dimension is returned.
Also for multi-dimensional vectors, the notation expr[m][n] will return
the nth element of the mth subvector. To get a subrange of a vector,
use the form expr[lower, upper].
To reference vectors in a plot that is not the current plot (see the
setplot command, below), the notation plotname.vecname can be used.
Either a plotname or a vector name may be the wildcard all. If the
plotname is all, matching vectors from all plots are specified, and if
the vector name is all, all vectors in the specified plots are
referenced. Note that you may not use binary operations on expressions
involving wildcards - it is not obvious what all + all should denote,
for instance. Thus some (contrived) examples of expressions are:
@example
cos(TIME) + db(v(3))
sin(cos(log([1 2 3 4 5 6 7 8 9 10])))
TIME * rnd(v(9)) - 15 * cos(vin#branch) ^ [7.9e5 8]
not ((ac3.FREQ[32] & tran1.TIME[10]) gt 3)
@end example
Vector names in ngspice may have a name such as @@name[param], where name
is either the name of a device instance or model. This denotes the
value of the param parameter of the device or model. See Appendix B for
details of what parameters are available. The value is a vector of
length 1. This function is also available with the show command, and is
available with variables for convenience for command scripts.
There are a number of pre-defined constants in nutmeg. They are:
@vtable @code
@item pi
J (3.14159...)
@item e
The base of natural logarithms (2.71828...)
@item c
The speed of light (299,792,500 m/sec)
@item i
The square root of -1
@item kelvin
Absolute 0 in Centigrade (-273.15 @math{^o}C)
@item echarge
The charge on an electron (1.6021918e-19 C)
@item boltz
Boltzman's constant (1.3806226e-23)
@item planck
Planck's constant (h = 6.626200e-34)
@end vtable
These are all in MKS units. If you have another variable with a name
that conflicts with one of these then it takes precedence.
@menu
* Command Interpretation::
* Commands::
* Variables::
* Bugs::
@end menu
@node Command Interpretation, Commands, Expressions, Interactive Interpreter
@section Command Interpretation
If a word is typed as a command, and there is no built-in command with
that name, the directories in the sourcepath list are searched in order
for the file. If it is found, it is read in as a command file (as if it
were sourced). Before it is read, however, the variables argc and argv
are set to the number of words following the filename on the command
line, and a list of those words respectively. After the file is
finished, these variables are unset. Note that if a command file calls
another, it must save its argv and argc since they are altered. Also,
command files may not be re-entrant since there are no local variables.
(Of course, the procedures may explicitly manipulate a stack...) This
way one can write scripts analogous to shell scripts for nutmeg and
Ngspice.
Note that for the script to work with Ngspice, it must begin with a blank
line (or whatever else, since it is thrown away) and then a line with
.control on it. This is an unfortunate result of the source command
being used for both circuit input and command file execution. Note also
that this allows the user to merely type the name of a circuit file as a
command and it is automatically run. The commands are executed
immediately, without running any analyses that may be specified in the
circuit (to execute the analyses before the script executes, include a
"run" command in the script).
There are various command scripts installed in
/usr/local/lib/spice/scripts (or whatever the path is on your machine),
and the default sourcepath includes this directory, so you can use these
command files (almost) like builtin commands.
@node Commands, Variables, Command Interpretation, Interactive Interpreter
@section Commands
@menu
* AC::
* Alias::
* Alter::
* Asciiplot::
* Aspice::
* Bug::
* Cd::
* Destroy::
* DC::
* Define::
* Delete::
* Diff::
* Display::
* Echo::
* Edit::
* Fourier::
* Hardcopy::
* Help::
* History::
* Iplot::
* Jobs::
* Let::
* Linearize::
* Listing::
* Load::
* Op::
* Plot::
* Print::
* Quit::
* Rehash::
* Reset::
* Reshape::
* Resume::
* Rspice::
* Run::
* Rusage::
* Save::
* Sens::
* Set::
* Setcirc::
* Setplot::
* Settype::
* Shell::
* Shift::
* Show::
* Showmod::
* Source::
* Status::
* Step::
* Stop::
* Tf::
* Trace::
* Tran::
* Transpose::
* Unalias::
* Undefine::
* Unset::
* Version::
* Where::
* Write::
* Xgraph::
* While - End::
* Repeat - End::
* Dowhile - End::
* Foreach - End::
* If - Then - Else::
* Label::
* Goto::
* Continue::
* Break::
@end menu
@node AC, Alias, Commands, Commands
@subsection Ac*: Perform an AC, small-signal frequency response analysis
General Form:
@example
ac ( DEC | OCT | LIN ) N Fstart Fstop
@end example
Do an ac analysis. See the previous sections of this manual for more
details.
@node Alias, Alter, AC, Commands
@subsection Alias: Create an alias for a command
General Form:
@example
alias [word] [text ...]
@end example
Causes word to be aliased to text. History substitutions may be used,
as in C-shell aliases.
@node Alter, Asciiplot, Alias, Commands
@subsection Alter*: Change a device or model parameter
General Form:
@example
alter device value
alter device parameter value [ parameter value ]
@end example
Alter changes the value for a device or a specified parameter of a
device or model. The first form is used by simple devices which have
one principal value (resistors, capacitors, etc.) where the second form
is for more complex devices (bjt's, etc.). Model parameters can be
changed with the second form if the name contains a "#".
For specifying vectors as values, start the vector with "[", followed by
the values in the vector, and end with "]". Be sure to place a space
between each of the values and before and after the "[" and "]".
@node Asciiplot, Aspice, Alter, Commands
@subsection Asciiplot: Plot values using old-style character plots
General Form:
@example
asciiplot plotargs
@end example
Produce a line printer plot of the vectors. The plot is sent to the
standard output, so you can put it into a file with asciiplot args ... >
file. The set options width, height, and nobreak determine the width
and height of the plot, and whether there are page breaks, respectively.
Note that you will have problems if you try to asciiplot something with
an X-scale that isn't monotonic (i.e, something like sin(TIME) ),
because asciiplot uses a simple-minded linear interpolation.
@node Aspice, Bug, Asciiplot, Commands
@subsection Aspice: Asynchronous ngspice run
General Form:
@example
aspice input-file [output-file]
@end example
Start a NGSPICE run, and when it is finished load the resulting data.
The raw data is kept in a temporary file. If output-file is specified
then the diagnostic output is directed into that file, otherwise it is
thrown away.
@node Bug, Cd, Aspice, Commands
@subsection Bug: Mail a bug report
General Form:
@example
bug
@end example
Send a bug report. Please include a short summary of the problem, the
version number and name of the operating system that you are running,
the version of ngspice that you are running, and the relevant ngspice input
file. (If you have defined BUGADDR, the mail is delivered to there.)
@node Cd, Destroy, Bug, Commands
@subsection Cd: Change directory
General Form:
@example
cd [directory]
@end example
Change the current working directory to directory, or to the user's home
directory if none is given.
@node Destroy, DC, Cd, Commands
@subsection Destroy: Delete a data set
General Form:
@example
destroy [plotnames | all]
@end example
Release the memory holding the data for the specified runs.
@node DC, Define, Destroy, Commands
@subsection Dc*: Perform a DC-sweep analysis
General Form:
@example
dc Source-Name Vstart Vstop Vincr [ Source2 Vstart2 Vstop2 Vincr2 ]
@end example
Do a dc transfer curve analysis. See the previous sections of this
manual for more details.
@node Define, Delete, DC, Commands
@subsection Define: Define a function
General Form:
@example
define function(arg1, arg2, ...) expression
@end example
Define the user-definable function with the name function and arguments
arg1, arg2, ... to be expression, which may involve the arguments. When
the function is later used, the arguments it is given are substituted
for the formal arguments when it is parsed. If expression is not
present, any definition for function is printed, and if there are no
arguments to define then all currently active definitions are printed.
Note that you may have different functions defined with the same name
but different arities.
Some useful definitions are:
@example
define max(x,y) (x > y) * x + (x <= y) * y
define min(x,y) (x < y) * x + (x >= y) * y
@end example
@node Delete, Diff, Define, Commands
@subsection Delete*: Remove a trace or breakpoint
General Form:
@example
delete [ debug-number ... ]
@end example
Delete the specified breakpoints and traces. The debug numbers are
those shown by the status command (unless you do status > file, in which
case the debug numbers are not printed).
@node Diff, Display, Delete, Commands
@subsection Diff: Compare vectors
General Form:
@example
diff plot1 plot2 [vec ...]
@end example
Compare all the vectors in the specified plots, or only the named
vectors if any are given. There are different vectors in the two plots,
or any values in the vectors differ significantly the difference is
reported. The variable diff_abstol, diff_reltol, and diff_vntol are
used to determine a significant difference.
@node Display, Echo, Diff, Commands
@subsection Display: List known vectors and types
General Form:
@example
display [varname ...]
@end example
Prints a summary of currently defined vectors, or of the names
specified. The vectors are sorted by name unless the variable nosort is
set. The information given is the name of the vector, the length, the
type of the vector, and whether it is real or complex data.
Additionally, one vector is labelled [scale]. When a command such as
plot is given without a vs argument, this scale is used for the X-axis.
It is always the first vector in a rawfile, or the first vector defined
in a new plot. If you undefine the scale (i.e, let TIME = []), one of
the remaining vectors becomes the new scale (which is undetermined).
@node Echo, Edit, Display, Commands
@subsection Echo: Print text
General Form:
@example
echo [text...]
@end example
Echos the given text to the screen.
@node Edit, Fourier, Echo, Commands
@subsection Edit*: Edit the current circuit
General Form:
@example
edit [ file ]
@end example
Print the current Ngspice input file into a file, call up the editor on
that file and allow the user to modify it, and then read it back in,
replacing the original file. If a filename is given, then edit that
file and load it, making the circuit the current one.
@node Fourier, Hardcopy, Edit, Commands
@subsection Fourier: Perform a fourier transform
General Form:
@example
fourier fundamental_frequency [value ...]
@end example
Does a fourier analysis of each of the given values, using the first 10
multiples of the fundamental frequency (or the first nfreqs, if that
variable is set - see below). The output is like that of the .four
Ngspice line. The values may be any valid expression. The values are
interpolated onto a fixed-space grid with the number of points given by
the fourgridsize variable, or 200 if it is not set. The interpolation
is of degree polydegree if that variable is set, or 1. If polydegree is
0, then no interpolation is done. This is likely to give erroneous
results if the time scale is not monotonic, though.
@node Hardcopy, Help, Fourier, Commands
@subsection Hardcopy: Save a plot to a file for printing
General Form:
@example
hardcopy file plotargs
@end example
Just like plot, except creates a file called file containing the plot.
The file is an image in plot(5) format, and can be printed by either the
plot(1) program or lpr with the -g flag.
@node Help, History, Hardcopy, Commands
@subsection Help: Print summaries of Ngspice commands
General Form:
@example
help [all] [command ...]
@end example
Prints help. If the argument all is given, a short description of
everything you could possibly type is printed. If commands are given,
descriptions of those commands are printed. Otherwise help for only a
few major commands is printed.
@node History, Iplot, Help, Commands
@subsection History: Review previous commands
General Form:
@example
history [number]
@end example
Print out the history, or the last number commands typed at the
keyboard. Note: in Ngspice version 3a7 and earlier, all commands
(including ones read from files) were saved.
@node Iplot, Jobs, History, Commands
@subsection Iplot*: Incremental plot
General Form:
@example
iplot [ node ...]
@end example
Incrementally plot the values of the nodes while Ngspice runs. The iplot
command can be used with the where command to find trouble spots in a
transient simulation.
@node Jobs, Let, Iplot, Commands
@subsection Jobs: List active asynchronous ngspice runs
General Form:
@example
jobs
@end example
Report on the asynchronous NGSPICE jobs currently running. Nutmeg
checks to see if the jobs are finished every time you execute a command.
If it is done then the data is loaded and becomes available.
@node Let, Linearize, Jobs, Commands
@subsection Let: Assign a value to a vector
General Form:
@example
let name = expr
@end example
Creates a new vector called name with the value specified by expr, an
expression as described above. If expr is [] (a zero-length vector)
then the vector becomes undefined. Individual elements of a vector may
be modified by appending a subscript to name (ex. name[0]). If there
are no arguments, let is the same as display.
@node Linearize, Listing, Let, Commands
@subsection Linearize*: Interpolate to a linear scale
General Form:
@example
linearize vec ...
@end example
Create a new plot with all of the vectors in the current plot, or only
those mentioned if arguments are given. The new vectors are
interpolated onto a linear time scale, which is determined by the values
of tstep, tstart, and tstop in the currently active transient analysis.
The currently loaded input file must include a transient analysis (a
tran command may be run interactively before the last reset,
alternately), and the current plot must be from this transient analysis.
This command is needed because Ngspice doesn't output the results from a
transient analysis in the same manner that Spice2 did.
@node Listing, Load, Linearize, Commands
@subsection Listing*: Print a listing of the current circuit
General Form:
@example
listing [logical] [physical] [deck] [expand]
@end example
If the logical argument is given, the listing is with all continuation
lines collapsed into one line, and if the physical argument is given the
lines are printed out as they were found in the file. The default is
logical. A deck listing is just like the physical listing, except
without the line numbers it recreates the input file verbatim (except
that it does not preserve case). If the word expand is present, the
circuit is printed with all subcircuits expanded.
@node Load, Op, Listing, Commands
@subsection Load: Load rawfile data
General Form:
@example
load [filename] ...
@end example
Loads either binary or ascii format rawfile data from the files named.
The default filename is rawspice.raw, or the argument to the -r flag if
there was one.
@node Op, Plot, Load, Commands
@subsection Op*: Perform an operating point analysis
General Form:
@example
op
@end example
Do an operating point analysis. See the previous sections of this
manual for more details.
@node Plot, Print, Op, Commands
@subsection Plot: Plot values on the display
General Form:
@example
plot exprs [ylimit ylo yhi] [xlimit xlo xhi] [xindices xilo xihi]
[xcompress comp] [xdelta xdel] [ydelta ydel] [xlog] [ylog] [loglog]
[vs xname] [xlabel word] [ylabel word] [title word] [samep]
[linear]
@end example
Plot the given exprs on the screen (if you are on a graphics terminal).
The xlimit and ylimit arguments determine the high and low x- and
y-limits of the axes, respectively. The xindices arguments determine
what range of points are to be plotted - everything between the xilo'th
point and the xihi'th point is plotted. The xcompress argument
specifies that only one out of every comp points should be plotted. If
an xdelta or a ydelta parameter is present, it specifies the spacing
between grid lines on the X- and Y-axis. These parameter names may be
abbreviated to xl, yl, xind, xcomp, xdel, and ydel respectively.
The xname argument is an expression to use as the scale on the
x-axis. If xlog or ylog are present then the X or Y scale, respectively,
is logarithmic (loglog is the same as specifying both). The xlabel and
ylabel arguments cause the specified labels to be used for the X and Y
axes, respectively.
If samep is given, the values of the other parameters (other than xname)
from the previous plot, hardcopy, or asciiplot command is used unless
re-defined on the command line.
The title argument is used in the place of the plot name at the bottom
of the graph.
The linear keyword is used to override a default logscale plot (as in
the output for an AC analysis).
Finally, the keyword polar to generate a polar plot. To produce a smith
plot, use the keyword smith. Note that the data is transformed, so for
smith plots you will see the data transformed by the function
(x-1)/(x+1). To produce a polar plot with a smith grid but without
performing the smith transform, use the keyword smithgrid.
@node Print, Quit, Plot, Commands
@subsection Print: Print values
General Form:
@example
print [col] [line] expr ...
@end example
Prints the vector described by the expression expr. If the col argument
is present, print the vectors named side by side. If line is given, the
vectors are printed horizontally. col is the default, unless all the
vectors named have a length of one, in which case line is the default.
The options width, length, and nobreak are effective for this command
(see asciiplot). If the expression is all, all of the vectors available
are printed. Thus print col all > file prints everything in the file in
SPICE2 format. The scale vector (time, frequency) is always in the
first column unless the variable noprintscale is true.
@node Quit, Rehash, Print, Commands
@subsection Quit: Leave Ngspice or Nutmeg
General Form:
@example
quit
@end example
Quit nutmeg or ngspice.
@node Rehash, Reset, Quit, Commands
@subsection Rehash: Reset internal hash tables
General Form:
@example
rehash
@end example
Recalculate the internal hash tables used when looking up UNIX commands,
and make all UNIX commands in the user's PATH available for command
completion. This is useless unless you have set unixcom first (see
above).
@node Reset, Reshape, Rehash, Commands
@subsection Reset*: Reset an analysis
General Form:
@example
reset
@end example
Throw out any intermediate data in the circuit (e.g, after a breakpoint
or after one or more analyses have been done already), and re-parse the
input file. The circuit can then be re-run from it's initial state,
overriding the affect of any set or alter commands. In Spice-3e and
earlier versions this was done automatically by the run command.
@node Reshape, Resume, Reset, Commands
@subsection Reshape: Alter the dimensionality or dimensions of
a vector
General Form:
@example
reshape vector vector ...
or
reshape vector vector ... [ dimension, dimension, ... ]
or
reshape vector vector ... [ dimension ][ dimension ] ...
@end example
This command changes the dimensions of a vector or a set of vectors.
The final dimension may be left off and it will be filled in
automatically. If no dimensions are specified, then the dimensions of
the first vector are copied to the other vectors. An error message of
the form 'dimensions of x were inconsistent' can be ignored.
@node Resume, Rspice, Reshape, Commands
@subsection Resume*: Continue a simulation after a stop
General Form:
@example
resume
@end example
Resume a simulation after a stop or interruption (control-C).
@node Rspice, Run, Resume, Commands
@subsection Rspice: Remote ngspice submission
General Form:
@example
rspice input file
@end example
Runs a NGSPICE remotely taking the input file as a NGSPICE input file,
or the current circuit if no argument is given. Nutmeg or Ngspice waits
for the job to complete, and passes output from the remote job to the
user's standard output. When the job is finished the data is loaded in
as with aspice. If the variable rhost is set, nutmeg connects to this
host instead of the default remote Ngspice server machine. This command
uses the "rsh" command and thereby requires authentication via a
".rhosts" file or other equivalent method. Note that "rsh" refers to
the "remote shell" program, which may be "remsh" on your system; to
override the default name of "rsh", set the variable remote_shell. If
the variable rprogram is set, then rspice uses this as the pathname to
the program to run on the remote system.
Note: rspice will not acknowledge elements that have been changed via
the "alter" or "altermod" commands.
@node Run, Rusage, Rspice, Commands
@subsection Run*: Run analysis from the input file
General Form:
@example
run [rawfile]
@end example
Run the simulation as specified in the input file. If there were any of
the control lines .ac, .op, .tran, or .dc, they are executed. The
output is put in rawfile if it was given, in addition to being available
interactively. In Spice-3e and earlier versions, the input file would
be re-read and any affects of the set or alter commands would be
reversed. This is no longer the affect.
@node Rusage, Save, Run, Commands
@subsection Rusage: Resource usage
General Form:
@example
rusage [resource ...]
@end example
Print resource usage statistics. If any resources are given, just print
the usage of that resource. Most resources require that a circuit be
loaded. Currently valid resources are:
elapsed The amount of time elapsed since the last rusage
elapsed call.
faults Number of page faults and context switches (BSD only).
space Data space used.
time CPU time used so far.
temp Operating temperature.
tnom Temperature at which device parameters were measured.
equations Circuit Equations
time Total Analysis Time
totiter Total iterations
accept Accepted timepoints
rejected Rejected timepoints
loadtime Time spent loading the circuit matrix and RHS.
reordertime Matrix reordering time
lutime L-U decomposition time
solvetime Matrix solve time
trantime Transient analysis time
tranpoints Transient timepoints
traniter Transient iterations
trancuriters Transient iterations for the last time point*
tranlutime Transient L-U decomposition time
transolvetime Transient matrix solve time
everything All of the above.
* listed incorrectly as "Transient iterations per point".
@node Save, Sens, Rusage, Commands
@subsection Save*: Save a set of outputs
General Form:
@example
save [all | allv | alli | output ...]
.save [all | allv | alli | output ...]
@end example
Save a set of outputs, discarding the rest. If a node has been
mentioned in a save command, it appears in the working plot after a run
has completed, or in the rawfile if ngspice is run in batch mode. If a
node is traced or plotted (see below) it is also saved. For backward
compatibility, if there are no save commands given, all outputs are
saved.
When the keyword "all" or the keyword "allv", appears in the save command,
all node voltages, voltage source currents and inductor currents are saved
in addition to any other values listed. If the keyword "alli" appears in
the save command, all devices currents are saved.
Note: the current implementation saves only the currents of devices which
have internal nodes, i.e. MOSFETs with non zero RD and RS; BJTs with
non-zero RC, RB and RE; DIODEs with non-zero RS; etc. Resistor and
capacitor currents are not saved with this option. These deficiencies
will be addressed in a later revision.
@node Sens, Set, Save, Commands
@subsection Sens*: Run a sensitivity analysis
General Form:
@example
sens output_variable
sens output_variable ac ( DEC | OCT | LIN ) N Fstart Fstop
@end example
Perform a Sensitivity analysis. output_variable is either a node
voltage (ex. "v(1)" or "v(A,out)") or a current through a voltage source
(ex. "i(vtest)"). The first form calculates DC sensitivities, the
second form calculates AC sensitivies. The output values are in
dimensions of change in output per unit change of input (as opposed to
percent change in output or per percent change of input).
@node Set, Setcirc, Sens, Commands
@subsection Set: Set the value of a variable
General Form:
@example
set [word]
set [word = value] ...
@end example
Set the value of word to be value, if it is present. You can set any
word to be any value, numeric or string. If no value is given then the
value is the boolean 'true'.
The value of word may be inserted into a command by writing $word. If a
variable is set to a list of values that are enclosed in parentheses
(which must be separated from their values by white space), the value of
the variable is the list.
The variables used by nutmeg are listed in the following section.
@node Setcirc, Setplot, Set, Commands
@subsection Setcirc*: Change the current circuit
General Form:
@example
setcirc [circuit name]
@end example
The current circuit is the one that is used for the simulation commands
below. When a circuit is loaded with the source command (see below) it
becomes the current circuit.
@node Setplot, Settype, Setcirc, Commands
@subsection Setplot: Switch the current set of vectors
General Form:
@example
setplot [plotname]
@end example
Set the current plot to the plot with the given name, or if no name is
given, prompt the user with a menu. (Note that the plots are named as
they are loaded, with names like tran1 or op2. These names are shown by
the setplot and display commands and are used by diff, below.) If the
"New plot" item is selected, the current plot becomes one with no
vectors defined.
Note that here the word "plot" refers to a group of vectors that are the
result of one NGSPICE run. When more than one file is loaded in, or more
than one plot is present in one file, nutmeg keeps them separate and
only shows you the vectors in the current plot.
@node Settype, Shell, Setplot, Commands
@subsection Settype: Set the type of a vector
General Form:
@example
settype type vector ...
@end example
Change the type of the named vectors to type. Type names can be found
in the manual page for sconvert.
@node Shell, Shift, Settype, Commands
@subsection Shell: Call the command interpreter
General Form:
@example
shell [ command ]
@end example
Call the operating system's command interpreter; execute the specified
command or call for interactive use.
@node Shift, Show, Shell, Commands
@subsection Shift: Alter a list variable
General Form:
@example
shift [varname] [number]
@end example
If varname is the name of a list variable, it is shifted to the left by
number elements (i.e, the number leftmost elements are removed). The
default varname is argv, and the default number is 1.
@node Show, Showmod, Shift, Commands
@subsection Show*: List device state
General Form:
@example
show devices [ : parameters ] , ...
@end example
The show command prints out tables summarizing the operating condition
of selected devices (much like the spice2 operation point summary). If
device is missing, a default set of devices are listed, if device is a
single letter, devices of that type are listed; if device is a
subcircuit name (beginning and ending in ":") only devices in that
subcircuit are shown (end the name in a double-":" to get devices within
sub-subcircuits recursively). The second and third forms may be
combined ("letter:subcircuit:") or "letter:subcircuit::") to select a
specific type of device from a subcircuit. A device's full name may be
specified to list only that device. Finally, devices may be selected by
model by using the form "#modelname" or ":subcircuit#modelname" or
"letter:subcircuit#modelname".
If no parameters are specified, the values for a standard set of
parameters are listed. If the list of parameters contains a "+", the
default set of parameters is listed along with any other specified
parameters.
For both devices and parameters, the word "all" has the obvious meaning.
Note: there must be spaces separating the ":" that divides the device
list from the parameter list.
@node Showmod, Source, Show, Commands
@subsection Showmod*: List model parameter values
General Form:
@example
showmod models [ : parameters ] , ...
@end example
The showmod command operates like the show command (above) but prints
out model parameter values. The applicable forms for models are a
single letter specifying the device type letter, "letter:subckt:",
"modelname", ":subckt:modelname", or "letter:subcircuit:modelname".
@node Source, Status, Showmod, Commands
@subsection Source: Read a Ngspice input file
General Form:
@example
source file
@end example
For Ngspice: Read the Ngspice input file file. Nutmeg and Ngspice commands
may be included in the file, and must be enclosed between the lines
.control and .endc. These commands are executed immediately after the
circuit is loaded, so a control line of ac ... works the same as the
corresponding .ac card. The first line in any input file is considered
a title line and not parsed but kept as the name of the circuit. The
exception to this rule is the file .spiceinit. Thus, a Ngspice command
script must begin with a blank line and then with a acters *# is
considered a control line. This makes it possible to imbed commands in
Ngspice input files that are ignored by earlier versions of Spice2
For Nutmeg: Reads commands from the file filename. Lines beginning with
the character * are considered comments and ignored.
@node Status, Step, Source, Commands
@subsection Status*: Display breakpoint information
General Form:
@example
status
@end example
Display all of the traces and breakpoints currently in effect.
@node Step, Stop, Status, Commands
@subsection Step*: Run a fixed number of timepoints
General Form:
@example
step [number]
@end example
Iterate number times, or once, and then stop.
@node Stop, Tf, Step, Commands
@subsection Stop*: Set a breakpoint
General Form:
@example
stop [ after n] [ when value cond value ] ...
@end example
Set a breakpoint. The argument after n means stop after n iteration
number n, and the argument when value cond value means stop when the
first value is in the given relation with the second value, the possible
relations being
@example
eq or = equal to
ne or <> not equal to
gt or > greater than
lt or < less than
ge or >= greater than or equal to
le or <= less than or equal to
@end example
IO redirection is disabled for the stop command, since the relational
operations conflict with it (it doesn't produce any output anyway). The
values above may be node names in the running circuit, or real values.
If more than one condition is given, e.g. stop after 4 when @math{v(1) > 4}
when @math{v(2) < 2}, the conjunction of the conditions is implied.
@subsection Sysinfo: Print system information
General Form:
@example
sysinfo
@end example
The command prints system information useful for sending bug report
to developers. Information consists of:
@itemize @bullet
@item Name of the operating system,
@item Name of the node,
@item Current release of the operating system,
@item Current version of this release,
@item Name of hardware type.
@end itemize
The example below shows the use of this command.
@example
ngspice 1 -> sysinfo
Linux janus.wayout.net 2.4.20 #1 SMP Tue Jun 10 18:58:26 CEST 2003 i686
ngspice 2 ->
@end example
@quotation Note
This command may not be available on your environment, if
it is not available, please send analogous information when submitting
bug reports.
@end quotation
@node Tf, Trace, Stop, Commands
@subsection Tf*: Run a Transfer Function analysis
General Form:
@example
tf output_node input_source
@end example
The tf command performs a transfer function analysis, returning the
transfer function (output/input), output resistance, and input
resistance between the given output node and the given input source.
The analysis assumes a small-signal DC (slowly varying) input.
@node Trace, Tran, Tf, Commands
@subsection Trace*: Trace nodes
General Form:
@example
trace [ node ...]
@end example
For every step of an analysis, the value of the node is printed.
Several traces may be active at once. Tracing is not applicable for all
analyses. To remove a trace, use the delete command.
@node Tran, Transpose, Trace, Commands
@subsection Tran*: Perform a transient analysis
General Form:
@example
tran Tstep Tstop [ Tstart [ Tmax ] ] [ UIC ]
@end example
Perform a transient analysis. See the previous sections of this manual
for more details.
@node Transpose, Unalias, Tran, Commands
@subsection Transpose: Swap the elements in a multi-dimensional data set
General Form:
@example
transpose vector vector ...
@end example
This command transposes a multidimensional vector. No analysis in
Ngspice produces multidimensional vectors, although the DC transfer curve
may be run with two varying sources. You must use the "reshape" command
to reform the one-dimensional vectors into two dimensional vectors. In
addition, the default scale is incorrect for plotting. You must plot
versus the vector corresponding to the second source, but you must also
refer only to the first segment of this second source vector. For
example (circuit to produce the transfer characteristic of a MOS
transistor):
@example
ngspice > dc vgg 0 5 1 vdd 0 5 1
ngspice > plot i(vdd)
ngspice > reshape all [6,6]
ngspice > transpose i(vdd) v(drain)
ngspice > plot i(vdd) vs v(drain)[0]
@end example
@node Unalias, Undefine, Transpose, Commands
@subsection Unalias: Retract an alias
General Form:
@example
unalias [word ...]
@end example
Removes any aliases present for the words.
@node Undefine, Unset, Unalias, Commands
@subsection Undefine: Retract a definition
General Form:
@example
undefine function
@end example
Definitions for the named user-defined functions are deleted.
@node Unset, Version, Undefine, Commands
@subsection Unset: Clear a variable
General Form:
@example
unset [word ...]
@end example
Clear the value of the specified variable(s) (word).
@node Version, Where, Unset, Commands
@subsection Version: Print the version of ngspice
General Form:
@example
version [-s | -f | ]
@end example
Print out the version of @emph{nutmeg} that is running, if invoked without argument
or with @code{-s} or @code{-f}. If the argument is a @code{} (any string different
from @code{-s} or @code{-f} is considered a @code{} ), the command checks to make
sure that the arguments match the current version of NGSPICE.
(This is mainly used as a @code{Command:} line in rawfiles.)
@emph{Options description}
@itemize @bullet
@item No option: The output of the command is the message you can see when running NGSPICE
from the command line, no more no less.
@item @code{-s}(hort): A shorter version of the message you see when calling NGSPICE from the
command line.
@item @code{-f}(ull): You may want to use this option if you want to know what extensions
are included into the simulator and what compilation switches are
active. A list of compilation options and included extensions is
appended to the normal (not short) message. May be useful when sending
bug reports.
@end itemize
The following example shows what the command returns is some situations:
@example
ngspice 10 -> version
******
** ngspice-15 : Circuit level simulation program
** The U. C. Berkeley CAD Group
** Copyright 1985-1994, Regents of the University of California.
** Please submit bug-reports to: ngspice-devel@@lists.sourceforge.net
** Creation Date: Sun Aug 24 00:35:57 CEST 2003
******
ngspice 11 -> version 14
Note: rawfile is version 14 (current version is 15)
ngspice 12 -> version 15
ngspice 13 ->
@end example
@strong{Note for developers:} The option listing returned when @code{version} is called with the
@code{-f} option is built at compile time using @code{#ifdef} blocks. When new compile switch are
added, if you want them to appear on the list, you have to modify the code in @file{misccoms.c}.
@node Where, Write, Version, Commands
@subsection Where: Identify troublesome node or device
General Form:
@example
where
@end example
When performing a transient or operating point analysis, the name of the
last node or device to cause non-convergence is saved. The where
command prints out this information so that you can examine the circuit
and either correct the problem or make a bug report. You may do this
either in the middle of a run or after the simulator has given up on the
analysis. For transient simulation, the iplot command can be used to
monitor the progress of the analysis. When the analysis slows down
severly or hangs, interrupt the simulator (with control-C) and issue the
where command. Note that only one node or device is printed; there may
be problems with more than one node.
@node Write, Xgraph, Where, Commands
@subsection Write: Write data to a file
General Form:
@example
write [file] [exprs]
@end example
Writes out the expressions to file.
First vectors are grouped together by plots, and written out as such
(i.e, if the expression list contained three vectors from one plot and
two from another, then two plots are written, one with three vectors and
one with two). Additionally, if the scale for a vector isn't present,
it is automatically written out as well.
The default format is ascii, but this can be changed with the set
filetype command. The default filename is rawspice.raw, or the argument
to the -r flag on the command line, if there was one, and the default
expression list is all.
@node Xgraph, While - End, Write, Commands
@subsection Xgraph: use the xgraph(1) program for plotting.
General Form:
@example
xgraph file [exprs] [plot options]
@end example
The ngspice/nutmeg xgraph command plots data like the plot command but
via xgraph, a popular X11 plotting program.
If file is either "temp" or "tmp" a temporary file is used to hold the
data while being plotted. For available plot options, see the plot
command. All options except for polar or smith plots are supported.
@section Control Structures
@node While - End, Repeat - End, Xgraph, Commands
@subsection While - End
General Form:
@example
while condition
statement
...
end
@end example
While condition, an arbitrary algebraic expression, is true, execute the
statements.
@node Repeat - End, Dowhile - End, While - End, Commands
@subsection Repeat - End
General Form:
@example
repeat [number]
statement
...
end
@end example
Execute the statements number times, or forever if no argument is given.
@node Dowhile - End, Foreach - End, Repeat - End, Commands
@subsection Dowhile - End
General Form:
@example
dowhile condition
statement
...
end
@end example
The same as while, except that the condition is tested after the
statements are executed.
@node Foreach - End, If - Then - Else, Dowhile - End, Commands
@subsection Foreach - End
General Form:
@example
foreach var value ...
statement
...
end
@end example
The statements are executed once for each of the values, each time with
the variable var set to the current one. (var can be accessed by the
$var notation - see below).
@node If - Then - Else, Label, Foreach - End, Commands
@subsection If - Then - Else
General Form:
@example
if condition
statement
...
else
statement
...
end
@end example
If the condition is non-zero then the first set of statements are
executed, otherwise the second set. The else and the second set of
statements may be omitted.
@node Label, Goto, If - Then - Else, Commands
@subsection Label
General Form:
@example
label word
@end example
If a statement of the form goto word is encountered, control is
transferred to this point, otherwise this is a no-op.
@node Goto, Continue, Label, Commands
@subsection Goto
General Form:
@example
goto word
@end example
If a statement of the form label word is present in the block or an
enclosing block, control is transferred there. Note that if the label
is at the top level, it must be before the goto statement (i.e, a
forward goto may occur only within a block).
@node Continue, Break, Goto, Commands
@subsection Continue
General Form:
@example
continue
@end example
If there is a while, dowhile, or foreach block enclosing this statement,
control passes to the test, or in the case of foreach, the next value is
taken. Otherwise an error results.
@node Break, , Continue, Commands
@subsection Break
General Form:
@example
break
@end example
If there is a while, dowhile, or foreach block enclosing this statement,
control passes out of the block. Otherwise an error results.
Of course, control structures may be nested. When a block is entered
and the input is the terminal, the prompt becomes a number of >'s
corresponding to the number of blocks the user has entered. The current
control structures may be examined with the debugging command cdump.
@node Variables, Bugs, Commands, Interactive Interpreter
@section Variables
The operation of both Nutmeg and Ngspice may be affected by setting
variables with the "set" command. In addition to the variables
mentioned below, the set command in Ngspice also affect the behaviour of
the simulator via the options previously described under the section on
".OPTIONS".
The variables meaningful to nutmeg which may be altered by the set
command are:
@vtable @code
@item diff_abstol
The absolute tolerance used by the diff command. appendwrite Append to
the file when a write command is is sued, if one already exists.
@item colorN
These variables determine the colors used, if X is being run on a color
display. N may be between 0 and 15. Color 0 is the background, color 1
is the grid and text color, and colors 2 through 15 are used in order
for vectors plot ted. The value of the color variables should be names
of colors, which may be found in the file /usr/lib/rgb.txt.
@item combplot
Plot vectors by drawing a vertical line from each point to the X-axis,
as opposed to joining the points. Note that this option is subsumed in
the plottype option, below.
@item cpdebug
Print cshpar debugging information (must be com plied with the -DCPDEBUG
flag). Unsupported in the current release.
@item debug
If set then a lot of debugging information is printed (must be compiled
with the -DFTEDEBUG flag). Unsupported in the current release.
@item device
The name (@code{/dev/tty??}) of the graphics device. If this variable
isn't set then the user's terminal is used. To do plotting on another
monitor you probably have to set both the device and term variables.
(If device is set to the name of a file, nutmeg dumps the graphics
control codes into this file -- this is useful for saving plots.)
@item echo
Print out each command before it is executed.
@item filetype
This can be either ascii or binary, and determines what format are. The
default is ascii.
@item fourgridsize
How many points to use for interpolating into when doing fourier
analysis.
@item gridsize
If this variable is set to an integer, this number is used as the number
of equally spaced points to use for the Y axis when plotting. Otherwise
the current scale is used (which may not have equally spaced points).
If the current scale isn't strictly monotonic, then this option has no
effect.
@item hcopydev
If this is set, when the hardcopy command is run the resulting file is
automatically printed on the printer named hcopydev with the command
@code{lpr -Phcopydev -g file}.
@item hcopyfont
This variable specifies the font name for hardcopy output plots. The
value is device dependent.
@item hcopyfontsize
This is a scaling factor for the font used in hardcopy plots.
@item hcopydevtype
This variable specifies the type of the printer output to use in the
hardcopy command. If hcopydevtype is not set, plot (5) format is
assumed. The standard distribution currently recognizes postscript as
an alternative output for mat. When used in conjunction with hcopydev,
hcopydevtype should specify a format supported by the printer.
@item height
The length of the page for asciiplot and print col.
@item history
The number of events to save in the his tory list.
@item lprplot5
This is a printf(3s) style format string used to specify the command to
use for sending plot(5)-style plots to a printer or plotter. The first
parameter sup plied is the printer name, the second parameter supplied
is a file name containing the plot. Both parameters are strings. It
is trivial to cause Ngspice to abort by supplying a unreasonable format
string.
@item lprps
This is a printf(3s) style format string used to specify the command to
use for sending PostScript plots to a printer or plotter. The first
parameter supplied is the printer name, the second parameter supplied
is a file name containing the plot. Both parameters are strings. It is
trivial to cause Ngspice to abort by supplying a unreasonable format
string.
@item nfreqs
The number of frequencies to compute in the fourier command. (Defaults
to 10.)
@item nobreak
Don't have asciiplot and print col break between pages.
@item noasciiplotvalue
Don't print the first vector plotted to the left when doing an
asciiplot.
@item noclobber
Don't overwrite existing files when do ing IO redirection.
@item noglob
Don't expand the global characters `*', `?', `[', and `]'. This is the
default.
@item nogrid
Don't plot a grid when graphing curves (but do label the axes).
@item nomoremode
If nomoremode is not set, whenever a large amount of data is being
printed to the screen (e.g, the print or asciiplot commands), the output
is stopped every screenful and continues when a carriage return is
typed. If nomoremode is set then data scrolls off the screen without
check.
@item nonomatch
If noglob is unset and a global expression cannot be matched, use the
global characters literally instead of complaining.
@item nosort
Don't have display sort the variable names.
@item noprintscale
Don't print the scale in the leftmost column when a print col command is
given.
@item numdgt
The number of digits to print when printing tables of data (fourier,
print col). The default precision is 6 digits. On the VAX,
approximately 16 decimal digits are avail able using double precision,
so numdgt should not be more than 16. If the number is negative, one
fewer digit is printed to ensure constant widths in tables.
@item plottype
This should be one of normal, comb, or point:chars. normal, the
default, causes points to be plotted as parts of connected lines. comb
causes a comb plot to be done (see the description of the combplot
variable above). point causes each point to be plotted separately - the
chars are a list of characters that are used for each vector plotted.
If they are omitted then a de fault set is used.
@item polydegree
The degree of the polynomial that the plot command should fit to the
data. If polydegree is N, then nutmeg fits a degree N polynomial to
every set of N points and draw 10 intermediate points in between each
end point. If the points aren't monotonic, then it tries rotating the
curve and reducing the degree until a fit is achieved.
@item polysteps
The number of points to interpolate between every pair of points
available when doing curve fitting. The default is 10.
@item program
The name of the current program (argv[0]).
@item prompt
The prompt, with the character `!' replaced by the current event number.
@item rawfile
The default name for rawfiles created.
@item diff_reltol
The relative tolerance used by the diff command.
@item remote_shell
Overrides the name used for generating rspice runs (default is
"rsh").
@item rhost
The machine to use for remote NGSPICE runs, in stead of the default one
(see the description of the rspice command, below).
@item rprogram
The name of the remote program to use in the rspice command.
@item slowplot
Stop between each graph plotted and wait for the user to type return
before continuing.
@item sourcepath
A list of the directories to search when a source command is given. The
default is the current directory and the standard ngspice library
(/usr/local/lib/ngspice, or whatever LIBPATH is #defined to in the Ngspice
source.
@item spicepath
The program to use for the aspice command. The default is
/cad/bin/spice.
@item term
The mfb name of the current terminal.
@item units
If this is degrees, then all the trig functions will use degrees instead
of radians.
@item unixcom
If a command isn't defined, try to execute it as a UNIX command.
Setting this option has the effect of giving a rehash command, below.
This is useful for people who want to use nutmeg as a login shell.
@item verbose
Be verbose. This is midway between echo and de bug / cpdebug.
@item diff _vntol
The absolute voltage tolerance used by the diff command.
@item width
The width of the page for asciiplot and print col.
@item x11lineararcs
Some X11 implementations have poor arc drawing. If you set this option,
Ngspice will plot using an approximation to the curve using straight
lines.
@item xbrushheight
The height of the brush to use if X is being run.
@item xbrushwidth
The width of the brush to use if X is being run.
@item xfont
The name of the X font to use when plotting data and entering labels.
The plot may not look good if this is a variable-width font.
@end vtable
There are several set variables that Ngspice uses but Nutmeg does
not. They are:
@vtable @code
@item editor
The editor to use for the edit command.
@item modelcard
The name of the model card (normally
@item noaskquit
Do not check to make sure that there are no circuits suspended and no
plots un saved. Normally Ngspice warns the user when he tries to quit if
this is the case.
@item nobjthack
Assume that BJTs have 4 nodes.
@item noparse
Don't attempt to parse input files when they are read in (useful for
debugging). Of course, they cannot be run if they are not parsed.
nosubckt Don't expand subcircuits.
@item renumber
Renumber input lines when an input file has .include's. subend The card
to end subcircuits (normally
@item subinvoke
The prefix to invoke subcircuits (nor mally x). substart The card to
begin subcircuits (normally
@end vtable
@section INIT FILES
Ngspice reads some initialization information and paths from a file called
"spinit" or "tclspinit" (the latter if you have compiled tclspice). The init
file is read by ngspice or ngnutmeg as they start. The init script contains
spice commands (interactive commands). The following example show the standard
ngspice init file.
@example
* Standard spice and nutmeg init file
alias exit quit
alias acct rusage all
set x11lineararcs
*unset brief
strcmp __flag $program "ngspice"
if $__flag = 0
*set numparams
* For SPICE2 POLYs, edit the below line to point to the location
* of your codemode.
codemodel /usr/local/lib/spice/spice2poly.cm
* The other codemodels
codemodel /usr/local/lib/spice/analog.cm
codemodel /usr/local/lib/spice/digital.cm
codemodel /usr/local/lib/spice/xtradev.cm
codemodel /usr/local/lib/spice/xtraevt.cm
end
unset __flag
@end example
The spice init file location depends of the operating system you are running
and the configuration parameters.
The init file is the best place to put commands you always input when the
simulator starts.
@section MISCELLANEOUS
If there are subcircuits in the input file, Ngspice expands instances of
them. A subcircuit is delimited by the cards .subckt and .ends, or
whatever the value of the variables substart and subend is,
respectively. An instance of a subcircuit is created by specifying a
device with type 'x' - the device line is written
@example
xname node1 node2 ... subcktname
@end example
where the nodes are the node names that replace the formal parameters on
the .subckt line. All nodes that are not formal parameters are
prepended with the name given to the instance and a ':', as are the
names of the devices in the subcircuit. If there are several nested
subcircuits, node and device names look like subckt1:subckt2:...:name.
If the variable subinvoke is set, then it is used as the prefix that
specifies instances of subcircuits, instead of 'x'.
Nutmeg occasionally checks to see if it is getting close to running out
of space, and warns the user if this is the case. (This is more likely
to be useful with the NGSPICE front end.)
C-shell type quoting with "" and '', and backquote substitution may be
used. Within single quotes, no further substitution (like history
substitution) is done, and within double quotes, the words are kept
together but further substitution is done. Any text between backquotes
is replaced by the result of executing the text as a command to the
shell.
Tenex-style ('set filec' in the 4.3 C-shell) command, filename, and
keyword completion is possible: If EOF (control-D) is typed after the
first character on the line, a list of the commands or possible
arguments is printed (If it is alone on the line it exits nutmeg). If
escape is typed, then nutmeg tries to complete what the user has already
typed. To get a list of all commands, the user should type ^D.
The values of variables may be used in commands by writing $varname
where the value of the variable is to appear. The special variables $$
and $< refer to the process ID of the program and a line of input which
is read from the terminal when the variable is evaluated, respectively.
If a variable has a name of the form $&word, then word is considered a
vector (see above), and its value is taken to be the value of the
variable. If $foo is a valid variable, and is of type list, then the
expression $foo[low-high] represents a range of elements. Either the
upper index or the lower may be left out, and the reverse of a list may
be obtained with $foo[len-0]. Also, the notation $?foo evaluates to 1
if the variable foo is defined, 0 otherwise, and $#foo evaluates to the
number of elements in foo if it is a list, 1 if it is a number or
string, and 0 if it is a boolean variable.
History substitutions, similar to C-shell history substitutions, are
also available - see the C-shell manual page for all of the details.
The characters ~, @{, and @} have the same effects as they do in the
C-Shell, i.e., home directory and alternative expansion. It is possible
to use the wildcard characters *, ?, [, and ] also, but only if you
unset noglob first. This makes them rather useless for typing algebraic
expressions, so you should set noglob again after you are done with
wildcard expansion. Note that the pattern [^abc] matchs all characters
except a, b, and c.
IO redirection is available - the symbols >, >>, >&, >>&, and < have the
same effects as in the C-shell.
You may type multiple commands on one line, separated by semicolons.
If you want to use a different mfbcap file than the default (usually
~cad/lib/mfbcap), you have to set the environment variable SPICE_MFBCAP
before you start nutmeg or ngspice. The -m option and the mfbcap variable
no longer work.
If X is being used, the cursor may be positioned at any point on the
screen when the window is up and characters typed at the keyboard are
added to the window at that point. The window may then be sent to a
printer using the xpr(1) program.
Nutmeg can be run under VAX/VMS, as well as several other operating
systems. Some features like command completion, expansion of *, ?, and
[], backquote substitution, the shell command, and so forth do not work.
On some systems you have to respond to the -moreprompt during plot with
a carriage return instead of any key as you can do on UNIX.
@node Bugs, , Variables, Interactive Interpreter
@section Bugs
The label entry facilities are primitive. You must be careful to type
slowly when entering labels -- nutmeg checks for input once every
second, and can get confused if characters arrive faster.
If you redefine colors after creating a plot window with X, and then
cause the window to be redrawn, it does not redraw in the correct
colors.
When defining aliases like
@example
alias pdb plot db( '!:1' - '!:2' )
@end example
you must be careful to quote the argument list substitutions in this
manner. If you quote the whole argument it might not work properly.
In a user-defined function, the arguments cannot be part of a name that
uses the plot.vec syntax. For example:
@example
define check(v(1)) cos(tran1.v(1))
@end example
does not work.
If you type plot all all, or otherwise use a wildcard reference for one
plot twice in a command, the effect is unpredictable.
The asciiplot command doesn't deal with log scales or the delta
keywords.
Often the names of terminals recognized by MFB are different from those
in /etc/termcap. Thus you may have to reset your terminal type with the
command
@example
set term = termname
@end example
where termname is the name in the mfbcap file.
The hardcopy command is useless on VMS and other systems without the
plot command, unless the user has a program that understands plot(5)
format.
Ngspice recognizes all the notations used in SPICE2 .plot cards, and
translates vp(1) into ph(v(1)), and so forth. However, if there are
spaces in these names it won't work. Hence v(1, 2) and (-.5, .5) aren't
recognized.
BJTs can have either 3 or 4 nodes, which makes it difficult for the
subcircuit expansion routines to decide what to rename. If the fourth
parameter has been declared as a model name, then it is assumed that
there are 3 nodes, otherwise it is considered a node. To disable this,
you can set the variable "nobjthack" which forces BJTs to have 4 nodes
(for the purposes of subcircuit expansion, at least).
The @@name[param] notation might not work with trace, iplot, etc. yet.
The first line of a command file (except for the .spiceinit file) should
be a comment, otherwise NGSPICE may create an empty circuit.
Files specified on the command line are read before .spiceinit is read.
@node Bibliography, Example Circuits, Interactive Interpreter, Top
@chapter Bibliography
[1] A. Vladimirescu and S. Liu, The Simulation of MOS Integrated
Circuits Using SPICE2 ERL Memo No. ERL M80/7, Electronics Research
Laboratory University of California, Berkeley, October 1980
[2] T. Sakurai and A. R. Newton, A Simple MOSFET Model for Circuit
Analysis and its application to CMOS gate delay analysis and
series-connected MOSFET Structure ERL Memo No. ERL M90/19, Electronics
Research Labora tory, University of California, Berkeley, March 1990
[3] B. J. Sheu, D. L. Scharfetter, and P. K. Ko, SPICE2
Implementation of BSIM ERL Memo No. ERL M85/42, Electronics Research
Labora tory University of California, Berkeley, May 1985
[4] J. R. Pierret, A MOS Parameter Extraction Program for the BSIM
Model ERL Memo Nos. ERL M84/99 and M84/100, Electronics Research
Laboratory University of California, Berkeley, November 1984
[5] Min-Chie Jeng, Design and Modeling of Deep Submicrometer MOSFETSs
ERL Memo Nos. ERL M90/90, Electronics Research Labora tory University of
California, Berkeley, October 1990
[6] Soyeon Park, Analysis and SPICE implementation of High Temperature
Effects on MOSFET, Master's thesis, University of California, Berkeley,
December 1986.
[7] Clement Szeto, Simulator of Temperature Effects in MOS FETs
(STEIM), Master's thesis, University of California, Berkeley, May 1988.
[8] J.S. Roychowdhury and D.O. Pederson, Efficient Tran sient
Simulation of Lossy Interconnect, Proc. of the 28th ACM/IEEE Design
Automation Confer ence, June 17-21 1991, San Francisco
[9] A. E. Parker and D. J. Skellern, An Improved FET Model for Computer
Simulators, IEEE Trans CAD, vol. 9, no. 5, pp. 551-553, May 1990.
[10] R. Saleh and A. Yang, Editors, Simulation and Modeling, IEEE
Circuits and Devices, vol. 8, no. 3, pp. 7-8 and 49, May 1992
[11] H.Statz et al., GaAs FET Device and Circuit Simulation in SPICE,
IEEE Transactions on Electron Devices, V34, Number 2, February, 1987
pp160-169.
[12] Weidong Liu et al., BSIM3v3.2.2 MOSFET Model Users' Manual,
http://www-device.eecs.berkeley.edu/~bsim3/ftpv322/Mod_doc/V322manu.tar.Z
[13] Weidong Lui et al. BSIM3.v3.2.3 MOSFET Model Users' Manual,
http://www-device.eecs.berkeley.edu/~bsim3/ftpv323/Mod_doc/BSIM323_manu.tar
@node Example Circuits, Model and Device Parameters, Bibliography, Top
@chapter Example Circuits
@menu
* Differential Pair::
* MOSFET Characterization::
* RTL Inverter::
* Four-Bit Binary Adder::
* Transmission-Line Inverter::
@end menu
@node Differential Pair, MOSFET Characterization, Example Circuits, Example Circuits
@section Differential Pair
The following deck determines the dc operating point of a simple
differential pair. In addition, the ac small-signal response is computed
over the frequency range 1Hz to 100MEGHz.
@example
SIMPLE DIFFERENTIAL PAIR
VCC 7 0 12
VEE 8 0 -12
VIN 1 0 AC 1
RS1 1 2 1K
RS2 6 0 1K
Q1 3 2 4 MOD1
Q2 5 6 4 MOD1
RC1 7 3 10K
RC2 7 5 10K
RE 4 8 10K
.MODEL MOD1 NPN BF=50 VAF=50 IS=1.E-12 RB=100 CJC=.5PF TF=.6NS
.TF V(5) VIN
.AC DEC 10 1 100MEG
.END
@end example
@node MOSFET Characterization, RTL Inverter, Differential Pair, Example Circuits
@section MOSFET Characterization
The following deck computes the output characteristics of a MOSFET
device over the range 0-10V for VDS and 0-5V for VGS.
@example
MOS OUTPUT CHARACTERISTICS
.OPTIONS NODE NOPAGE
VDS 3 0
VGS 2 0
M1 1 2 0 0 MOD1 L=4U W=6U AD=10P AS=10P
* VIDS MEASURES ID, WE COULD HAVE USED VDS, BUT ID WOULD BE NEGATIVE
VIDS 3 1
.MODEL MOD1 NMOS VTO=-2 NSUB=1.0E15 UO=550
.DC VDS 0 10 .5 VGS 0 5 1
.END
@end example
@node RTL Inverter, Four-Bit Binary Adder, MOSFET Characterization, Example Circuits
@section RTL Inverter
The following deck determines the dc transfer curve and the transient
pulse response of a simple RTL inverter. The input is a pulse from 0 to
5 Volts with delay, rise, and fall times of 2ns and a pulse width of
30ns. The transient interval is 0 to 100ns, with printing to be done
every nanosecond.
@example
SIMPLE RTL INVERTER
VCC 4 0 5
VIN 1 0 PULSE 0 5 2NS 2NS 2NS 30NS
RB 1 2 10K
Q1 3 2 0 Q1
RC 3 4 1K
.MODEL Q1 NPN BF 20 RB 100 TF .1NS CJC 2PF
.DC VIN 0 5 0.1
.TRAN 1NS 100NS
.END
@end example
@node Four-Bit Binary Adder, Transmission-Line Inverter, RTL Inverter, Example Circuits
@section Four-Bit Binary Adder
The following deck simulates a four-bit binary adder, using several
subcircuits to describe various pieces of the overall circuit.
@example
ADDER - 4 BIT ALL-NAND-GATE BINARY ADDER
*** SUBCIRCUIT DEFINITIONS
.SUBCKT NAND 1 2 3 4
* NODES: INPUT(2), OUTPUT, VCC
Q1 9 5 1 QMOD
D1CLAMP 0 1 DMOD
Q2 9 5 2 QMOD
D2CLAMP 0 2 DMOD
RB 4 5 4K
R1 4 6 1.6K
Q3 6 9 8 QMOD
R2 8 0 1K
RC 4 7 130
Q4 7 6 10 QMOD
DVBEDROP 10 3 DMOD
Q5 3 8 0 QMOD
.ENDS NAND
.SUBCKT ONEBIT 1 2 3 4 5 6
* NODES: INPUT(2), CARRY-IN, OUTPUT, CARRY-OUT, VCC
X1 1 2 7 6 NAND
X2 1 7 8 6 NAND
X3 2 7 9 6 NAND
X4 8 9 10 6 NAND
X5 3 10 11 6 NAND
X6 3 11 12 6 NAND
X7 10 11 13 6 NAND
X8 12 13 4 6 NAND
X9 11 7 5 6 NAND
.ENDS ONEBIT
.SUBCKT TWOBIT 1 2 3 4 5 6 7 8 9
* NODES: INPUT - BIT0(2) / BIT1(2), OUTPUT - BIT0 / BIT1,
* CARRY-IN, CARRY-OUT, VCC
X1 1 2 7 5 10 9 ONEBIT
X2 3 4 10 6 8 9 ONEBIT
.ENDS TWOBIT
.SUBCKT FOURBIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* NODES: INPUT - BIT0(2) / BIT1(2) / BIT2(2) / BIT3(2),
* OUTPUT - BIT0 / BIT1 / BIT2 / BIT3, CARRY-IN, CARRY-OUT, VCC
X1 1 2 3 4 9 10 13 16 15 TWOBIT
X2 5 6 7 8 11 12 16 14 15 TWOBIT
.ENDS FOURBIT
*** DEFINE NOMINAL CIRCUIT
.MODEL DMOD D
.MODEL QMOD NPN(BF=75 RB=100 CJE=1PF CJC=3PF)
VCC 99 0 DC 5V
VIN1A 1 0 PULSE(0 3 0 10NS 10NS 10NS 50NS)
VIN1B 2 0 PULSE(0 3 0 10NS 10NS 20NS 100NS)
VIN2A 3 0 PULSE(0 3 0 10NS 10NS 40NS 200NS)
VIN2B 4 0 PULSE(0 3 0 10NS 10NS 80NS 400NS)
VIN3A 5 0 PULSE(0 3 0 10NS 10NS 160NS 800NS)
VIN3B 6 0 PULSE(0 3 0 10NS 10NS 320NS 1600NS)
VIN4A 7 0 PULSE(0 3 0 10NS 10NS 640NS 3200NS)
VIN4B 8 0 PULSE(0 3 0 10NS 10NS 1280NS 6400NS)
X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 FOURBIT
RBIT0 9 0 1K
RBIT1 10 0 1K
RBIT2 11 0 1K
RBIT3 12 0 1K
RCOUT 13 0 1K
*** (FOR THOSE WITH MONEY (AND MEMORY) TO BURN)
.TRAN 1NS 6400NS
.END
@end example
@node Transmission-Line Inverter, , Four-Bit Binary Adder, Example Circuits
@section Transmission-Line Inverter
The following deck simulates a transmission-line inverter. Two
transmission-line elements are required since two propagation modes are
excited. In the case of a coaxial line, the first line (T1) models the
inner conductor with respect to the shield, and the second line (T2)
models the shield with respect to the outside world.
@example
TRANSMISSION-LINE INVERTER
V1 1 0 PULSE(0 1 0 0.1N)
R1 1 2 50
X1 2 0 0 4 TLINE
R2 4 0 50
.SUBCKT TLINE 1 2 3 4
T1 1 2 3 4 Z0=50 TD=1.5NS
T2 2 0 4 0 Z0=100 TD=1NS
.ENDS TLINE
.TRAN 0.1NS 20NS
.END
@end example
@node Model and Device Parameters, , Example Circuits, Top
@chapter Model and Device Parameters
The following tables summarize the parameters available on each of the
devices and models in (note that for some systems with limited memory,
output parameters are not available). There are several tables for each
type of device supported by . Input parameters to instances and models
are parameters that can occur on an instance or model definition line in
the form "keyword=value" where "keyword" is the parameter name as given
in the tables. Default input parameters (such as the resistance of a
resistor or the capacitance of a capacitor) obviously do not need the
keyword specified.
Output parameters are those additional parameters which are available
for many types of instances for the output of operating point and
debugging information. These parameters are specified as
"@@device[keyword]" and are available for the most recent point computed
or, if specified in a ".save" statement, for an entire simulation as a
normal output vector. Thus, to monitor the gate-to-source capacitance
of a MOSFET, a command
@example
save @@m1[cgs]
@end example
given before a transient simulation causes the specified capacitance
value to be saved at each timepoint, and a subsequent command such as
@example
plot @@m1[cgs]
@end example
produces the desired plot. (Note that the show command does not use
this format).
Some variables are listed as both input and output, and their output
simply returns the previously input value, or the default value after
the simulation has been run. Some parameter are input only because the
output system can not handle variables of the given type yet, or the
need for them as output variables has not been apparent. Many such
input variables are available as output variables in a different format,
such as the initial condition vectors that can be retrieved as
individual initial condition values. Finally, internally derived values
are output only and are provided for debugging and operating point
output purposes.
Please note that these tables do not provide the detailed information
available about the parameters provided in the section on each device
and model, but are provided as a quick reference guide.
@menu
* Uniform RC line::
* Arbitrary Source::
* Bipolar Junction Transistor::
* BSIM1 Berkeley Short Channel IGFET Model::
* BSIM2 Berkeley Short Channel IGFET Model::
* Fixed capacitor::
* Current controlled current source::
* Linear current controlled current source::
* Current controlled ideal switch::
* Junction Diode model::
* Inductor::
* Mutual inductors::
* Independent current source::
* Junction Field effect transistor::
* Lossy transmission line::
* GaAs MESFET model::
* Level 1 MOSfet model::
* Level 2 MOSfet model::
* Level 3 MOSfet model::
* Level 6 MOSfet model::
* Simple linear resistor::
* Ideal voltage controlled switch::
* Lossless transmission line::
* Voltage controlled current source::
* Voltage controlled voltage source::
* Independent voltage source::
@end menu
@node Uniform RC line, Arbitrary Source, Model and Device Parameters, Model and Device Parameters
@section URC: Uniform R.C. line
@example
------------------------------------------------------------
| URC - instance parameters (input-output) |
|-----------------------------------------------------------+
| l Length of transmission line |
| n Number of lumps |
------------------------------------------------------------
------------------------------------------------------------
| URC - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of URC |
| neg_node Negative node of URC |
| gnd Ground node of URC |
------------------------------------------------------------
------------------------------------------------------------
| URC - model parameters (input-only) |
|-----------------------------------------------------------+
| urc Uniform R.C. line model |
------------------------------------------------------------
------------------------------------------------------------
| URC - model parameters (input-output) |
|-----------------------------------------------------------+
| k Propagation constant |
| fmax Maximum frequency of interest |
| rperl Resistance per unit length |
| cperl Capacitance per unit length |
| isperl Saturation current per length |
| rsperl Diode resistance per length |
------------------------------------------------------------
@end example
@node Arbitrary Source, Bipolar Junction Transistor, Uniform RC line, Model and Device Parameters
@section ASRC: Arbitrary Source
@example
------------------------------------------------------------
| ASRC - instance parameters (input-only) |
|-----------------------------------------------------------+
| i Current source |
| v Voltage source |
------------------------------------------------------------
------------------------------------------------------------
| ASRC - instance parameters (output-only) |
|-----------------------------------------------------------+
| i Current through source |
| v Voltage across source |
| pos_node Positive Node |
| neg_node Negative Node |
------------------------------------------------------------
@end example
@node Bipolar Junction Transistor, BSIM1 Berkeley Short Channel IGFET Model, Arbitrary Source, Model and Device Parameters
@section BJT: Bipolar Junction Transistor
@example
------------------------------------------------------------
| BJT - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Initial condition vector |
------------------------------------------------------------
------------------------------------------------------------
| BJT - instance parameters (input-output) |
|-----------------------------------------------------------+
| off Device initially off |
| icvbe Initial B-E voltage |
| icvce Initial C-E voltage |
| area Area factor |
| temp instance temperature |
------------------------------------------------------------
------------------------------------------------------------
| BJT - instance parameters (output-only) |
|-----------------------------------------------------------+
| colnode Number of collector node |
| basenode Number of base node |
| emitnode Number of emitter node |
| substnode Number of substrate node |
------------------------------------------------------------
| colprimenode Internal collector node |
| baseprimenode Internal base node |
| emitprimenode Internal emitter node |
| ic Current at collector node |
|-----------------------------------------------------------+
ib Current at base node
| ie Emitter current |
| is Substrate current |
| vbe B-E voltage |
------------------------------------------------------------
| vbc B-C voltage |
| gm Small signal transconductance |
| gpi Small signal input conductance - pi |
| gmu Small signal conductance - mu |
|-----------------------------------------------------------+
| gx Conductance from base to internal base |
| go Small signal output conductance |
| geqcb d(Ibe)/d(Vbc) |
| gccs Internal C-S cap. equiv. cond. |
------------------------------------------------------------
| geqbx Internal C-B-base cap. equiv. cond. |
| cpi Internal base to emitter capactance |
| cmu Internal base to collector capactiance |
| cbx Base to collector capacitance |
|-----------------------------------------------------------+
| ccs Collector to substrate capacitance |
| cqbe Cap. due to charge storage in B-E jct. |
| cqbc Cap. due to charge storage in B-C jct. |
| cqcs Cap. due to charge storage in C-S jct. |
| cqbx Cap. due to charge storage in B-X jct. |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| BJT - instance output-only parameters - continued
|-----------------------------------------------------------+
| cexbc Total Capacitance in B-X junction |
| qbe Charge storage B-E junction |
| qbc Charge storage B-C junction |
| qcs Charge storage C-S junction |
| qbx Charge storage B-X junction |
| p Power dissipation |
------------------------------------------------------------
------------------------------------------------------------
| BJT - model parameters (input-output) |
|-----------------------------------------------------------+
| npn NPN type device |
| pnp PNP type device |
| is Saturation Current |
| bf Ideal forward beta |
------------------------------------------------------------
| nf Forward emission coefficient |
| vaf Forward Early voltage |
| va (null) |
| ikf Forward beta roll-off corner current |
|-----------------------------------------------------------+
| ik (null) |
| ise B-E leakage saturation current |
| ne B-E leakage emission coefficient |
| br Ideal reverse beta |
------------------------------------------------------------
| nr Reverse emission coefficient |
| var Reverse Early voltage |
| vb (null) |
| ikr reverse beta roll-off corner current |
|-----------------------------------------------------------+
| isc B-C leakage saturation current |
| nc B-C leakage emission coefficient |
| rb Zero bias base resistance |
| irb Current for base resistance=(rb+rbm)/2 |
------------------------------------------------------------
| rbm Minimum base resistance |
| re Emitter resistance |
| rc Collector resistance |
| cje Zero bias B-E depletion capacitance |
|-----------------------------------------------------------+
| vje B-E built in potential |
| pe (null) |
| mje B-E junction grading coefficient |
| me (null) |
------------------------------------------------------------
| tf Ideal forward transit time |
| xtf Coefficient for bias dependence of TF |
| vtf Voltage giving VBC dependence of TF |
| itf High current dependence of TF |
|-----------------------------------------------------------+
| ptf Excess phase |
| cjc Zero bias B-C depletion capacitance |
| vjc B-C built in potential |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| BJT - model input-output parameters - continued
|-----------------------------------------------------------+
| pc (null) |
| mjc B-C junction grading coefficient |
| mc (null) |
| xcjc Fraction of B-C cap to internal base |
------------------------------------------------------------
| tr Ideal reverse transit time |
| cjs Zero bias C-S capacitance |
| ccs Zero bias C-S capacitance |
| vjs Substrate junction built in potential |
|-----------------------------------------------------------+
| ps (null) |
| mjs Substrate junction grading coefficient |
| ms (null) |
| xtb Forward and reverse beta temp. exp. |
------------------------------------------------------------
| eg Energy gap for IS temp. dependency |
| xti Temp. exponent for IS |
| fc Forward bias junction fit parameter |
| tnom Parameter measurement temperature |
| kf Flicker Noise Coefficient |
| af Flicker Noise Exponent |
------------------------------------------------------------
------------------------------------------------------------
| BJT - model parameters (output-only) |
|-----------------------------------------------------------+
| type NPN or PNP |
| invearlyvoltf Inverse early voltage:forward |
| invearlyvoltr Inverse early voltage:reverse |
| invrollofff Inverse roll off - forward |
------------------------------------------------------------
| invrolloffr Inverse roll off - reverse |
| collectorconduct Collector conductance |
| emitterconduct Emitter conductance |
| transtimevbcfact Transit time VBC factor |
| excessphasefactor Excess phase fact. |
------------------------------------------------------------
@end example
@node BSIM1 Berkeley Short Channel IGFET Model, BSIM2 Berkeley Short Channel IGFET Model, Bipolar Junction Transistor, Model and Device Parameters
@section BSIM1: Berkeley Short Channel IGFET Model
@example
------------------------------------------------------------
| BSIM1 - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Vector of DS,GS,BS initial voltages |
------------------------------------------------------------
------------------------------------------------------------
| BSIM1 - instance parameters (input-output) |
|-----------------------------------------------------------+
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------
| pd Drain perimeter |
| ps Source perimeter |
| nrd Number of squares in drain |
| nrs Number of squares in source |
|-----------------------------------------------------------+
| off Device is initially off |
| vds Initial D-S voltage |
| vgs Initial G-S voltage |
| vbs Initial B-S voltage |
------------------------------------------------------------
------------------------------------------------------------
| BSIM1 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos Flag to indicate NMOS |
| pmos Flag to indicate PMOS |
------------------------------------------------------------
------------------------------------------------------------
| BSIM1 - model parameters (input-output) |
|-----------------------------------------------------------+
| vfb Flat band voltage |
|lvfb Length dependence of vfb |
| wvfb Width dependence of vfb |
| phi Strong inversion surface potential |
------------------------------------------------------------
| lphi Length dependence of phi |
| wphi Width dependence of phi |
| k1 Bulk effect coefficient 1 |
| lk1 Length dependence of k1 |
|-----------------------------------------------------------+
| wk1 Width dependence of k1 |
| k2 Bulk effect coefficient 2 |
| lk2 Length dependence of k2 |
| wk2 Width dependence of k2 |
------------------------------------------------------------
| eta VDS dependence of threshold voltage |
| leta Length dependence of eta |
| weta Width dependence of eta |
| x2e VBS dependence of eta |
| lx2e Length dependence of x2e |
| continued |
------------------------------------------------------------
---------------------------------------------------------------------
| BSIM1 - model input-output parameters - continued |
|--------------------------------------------------------------------+
|wx2e Width dependence of x2e |
|x3e VDS dependence of eta |
|lx3e Length dependence of x3e |
|wx3e Width dependence of x3e |
---------------------------------------------------------------------
|dl Channel length reduction in um |
|dw Channel width reduction in um |
|muz Zero field mobility at VDS=0 VGS=VTH |
|x2mz VBS dependence of muz |
|--------------------------------------------------------------------+
|lx2mz Length dependence of x2mz |
|wx2mz Width dependence of x2mz |
mus Mobility at VDS=VDD VGS=VTH, channel length modulation
|lmus Length dependence of mus |
---------------------------------------------------------------------
|wmus Width dependence of mus |
|x2ms VBS dependence of mus |
|lx2ms Length dependence of x2ms |
|wx2ms Width dependence of x2ms |
|--------------------------------------------------------------------+
|x3ms VDS dependence of mus |
|lx3ms Length dependence of x3ms |
|wx3ms Width dependence of x3ms |
|u0 VGS dependence of mobility |
---------------------------------------------------------------------
|lu0 Length dependence of u0 |
|wu0 Width dependence of u0 |
|x2u0 VBS dependence of u0 |
|lx2u0 Length dependence of x2u0 |
|--------------------------------------------------------------------+
|wx2u0 Width dependence of x2u0 |
|u1 VDS dependece of mobility, velocity saturation |
|lu1 Length dependence of u1 |
|wu1 Width dependence of u1 |
---------------------------------------------------------------------
|x2u1 VBS dependence of u1 |
|lx2u1 Length dependence of x2u1 |
|wx2u1 Width dependence of x2u1 |
|x3u1 VDS dependence of u1 |
|--------------------------------------------------------------------+
|lx3u1 Length dependence of x3u1 |
|wx3u1 Width dependence of x3u1 |
|n0 Subthreshold slope |
ln0 Length dependence of n0
---------------------------------------------------------------------
|wn0 Width dependence of n0 |
|nb VBS dependence of subthreshold slope |
|lnb Length dependence of nb |
|wnb Width dependence of nb |
|--------------------------------------------------------------------+
|nd VDS dependence of subthreshold slope |
|lnd Length dependence of nd |
|wnd Width dependence of nd |
| continued |
---------------------------------------------------------------------
---------------------------------------------------------------------------
| BSIM1 - model input-output parameters - continued |
|-----------------------------------------------------------------------+
|tox Gate oxide thickness in um |
|temp Temperature in degree Celsius |
|vdd Supply voltage to specify mus |
|cgso Gate source overlap capacitance per unit channel width(m) |
------------------------------------------------------------------------
|cgdo Gate drain overlap capacitance per unit channel width(m) |
|cgbo Gate bulk overlap capacitance per unit channel length(m) |
|xpart Flag for channel charge partitioning |
|rsh Source drain diffusion sheet resistance in ohm per square |
|-----------------------------------------------------------------------+
|js Source drain junction saturation current per unit area |
|pb Source drain junction built in potential |
|mj Source drain bottom junction capacitance grading coefficient
|pbsw Source drain side junction capacitance built in potential |
------------------------------------------------------------------------
|mjsw Source drain side junction capacitance grading coefficient |
|cj Source drain bottom junction capacitance per unit area |
|cjsw Source drain side junction capacitance per unit area |
|wdf Default width of source drain diffusion in um |
|dell Length reduction of source drain diffusion |
------------------------------------------------------------------------
@end example
@node BSIM2 Berkeley Short Channel IGFET Model, Fixed capacitor, BSIM1 Berkeley Short Channel IGFET Model, Model and Device Parameters
@section BSIM2: Berkeley Short Channel IGFET Model
@example
------------------------------------------------------------
| BSIM2 - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Vector of DS,GS,BS initial voltages |
------------------------------------------------------------
------------------------------------------------------------
| BSIM2 - instance parameters (input-output) |
|-----------------------------------------------------------+
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------
| pd Drain perimeter |
| ps Source perimeter |
| nrd Number of squares in drain |
| nrs Number of squares in source |
|-----------------------------------------------------------+
| off Device is initially off |
| vds Initial D-S voltage |
| vgs Initial G-S voltage |
| vbs Initial B-S voltage |
------------------------------------------------------------
------------------------------------------------------------
| BSIM2 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos Flag to indicate NMOS |
| pmos Flag to indicate PMOS |
------------------------------------------------------------
------------------------------------------------------------
| BSIM2 - model parameters (input-output) |
|-----------------------------------------------------------+
|vfb Flat band voltage |
|lvfb Length dependence of vfb |
|wvfb Width dependence of vfb |
|phi Strong inversion surface potential |
------------------------------------------------------------
|lphi Length dependence of phi |
|wphi Width dependence of phi |
|k1 Bulk effect coefficient 1 |
|lk1 Length dependence of k1 |
|-----------------------------------------------------------+
|wk1 Width dependence of k1 |
|k2 Bulk effect coefficient 2 |
|lk2 Length dependence of k2 |
|wk2 Width dependence of k2 |
------------------------------------------------------------
|eta0 VDS dependence of threshold voltage at VDD=0
|leta0 Length dependence of eta0 |
|weta0 Width dependence of eta0 |
|etab VBS dependence of eta |
|-----------------------------------------------------------+
|letab Length dependence of etab |
|wetab Width dependence of etab |
|dl Channel length reduction in um |
|dw Channel width reduction in um |
------------------------------------------------------------
|mu0 Low-field mobility, at VDS=0 VGS=VTH |
|mu0b VBS dependence of low-field mobility |
|lmu0b Length dependence of mu0b |
|wmu0b Width dependence of mu0b |
|-----------------------------------------------------------+
|mus0 Mobility at VDS=VDD VGS=VTH |
|lmus0 Length dependence of mus0 |
|wmus0 Width dependence of mus |
|musb VBS dependence of mus |
------------------------------------------------------------
|lmusb Length dependence of musb |
|wmusb Width dependence of musb |
|mu20 VDS dependence of mu in tanh term |
|lmu20 Length dependence of mu20 |
|-----------------------------------------------------------+
|wmu20 Width dependence of mu20 |
|mu2b VBS dependence of mu2 |
|lmu2b Length dependence of mu2b |
|wmu2b Width dependence of mu2b |
------------------------------------------------------------
|mu2g VGS dependence of mu2 |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| BSIM2 - model input-output parameters - continued
|-----------------------------------------------------------+
| lmu2g Length dependence of mu2g |
| wmu2g Width dependence of mu2g |
| mu30 VDS dependence of mu in linear term |
| lmu30 Length dependence of mu30 |
------------------------------------------------------------
| wmu30 Width dependence of mu30 |
| mu3b VBS dependence of mu3 |
| lmu3b Length dependence of mu3b |
| wmu3b Width dependence of mu3b |
|-----------------------------------------------------------+
| mu3g VGS dependence of mu3 |
| lmu3g Length dependence of mu3g |
| wmu3g Width dependence of mu3g |
| mu40 VDS dependence of mu in linear term |
------------------------------------------------------------
| lmu40 Length dependence of mu40 |
| wmu40 Width dependence of mu40 |
| mu4b VBS dependence of mu4 |
| lmu4b Length dependence of mu4b |
|-----------------------------------------------------------+
| wmu4b Width dependence of mu4b |
| mu4g VGS dependence of mu4 |
| lmu4g Length dependence of mu4g |
| wmu4g Width dependence of mu4g |
------------------------------------------------------------
| ua0 Linear VGS dependence of mobility |
| lua0 Length dependence of ua0 |
| wua0 Width dependence of ua0 |
| uab VBS dependence of ua |
|-----------------------------------------------------------+
| luab Length dependence of uab |
| wuab Width dependence of uab |
| ub0 Quadratic VGS dependence of mobility |
| lub0 Length dependence of ub0 |
------------------------------------------------------------
| wub0 Width dependence of ub0 |
| ubb VBS dependence of ub |
| lubb Length dependence of ubb |
| wubb Width dependence of ubb |
|-----------------------------------------------------------+
| u10 VDS dependence of mobility |
| lu10 Length dependence of u10 |
wu10 Width dependence of u100 |
| u1b VBS dependence of u1 |
------------------------------------------------------------
| lu1b Length dependence of u1b |
| wu1b Width dependence of u1b |
| u1d VDS dependence of u1 |
| lu1d Length dependence of u1d |
|-----------------------------------------------------------+
| wu1d Width dependence of u1d |
| n0 Subthreshold slope at VDS=0 VBS=0 |
| ln0 Length dependence of n0 |
| continued |
------------------------------------------------------------
--------------------------------------------------------------
| BSIM2 - model input-output parameters - continued |
|--------------------------------------------------------------+
|wn0 Width dependence of n0 |
|nb VBS dependence of n |
|lnb Length dependence of nb |
|wnb Width dependence of nb |
--------------------------------------------------------------+
|nd VDS dependence of n |
|lnd Length dependence of nd |
|wnd Width dependence of nd |
|vof0 Threshold voltage offset AT VDS=0 VBS=0 |
|--------------------------------------------------------------+
|lvof0 Length dependence of vof0 |
|wvof0 Width dependence of vof0 |
|vofb VBS dependence of vof |
|lvofb Length dependence of vofb |
--------------------------------------------------------------+
|wvofb Width dependence of vofb |
|vofd VDS dependence of vof |
|lvofd Length dependence of vofd |
|wvofd Width dependence of vofd |
|--------------------------------------------------------------+
|ai0 Pre-factor of hot-electron effect. |
|lai0 Length dependence of ai0 |
|wai0 Width dependence of ai0 |
|aib VBS dependence of ai |
--------------------------------------------------------------+
|laib Length dependence of aib |
|waib Width dependence of aib |
|bi0 Exponential factor of hot-electron effect. |
|lbi0 Length dependence of bi0 |
|--------------------------------------------------------------+
|wbi0 Width dependence of bi0 |
|bib VBS dependence of bi |
|lbib Length dependence of bib |
|wbib Width dependence of bib |
--------------------------------------------------------------+
|vghigh Upper bound of the cubic spline function. |
|lvghigh Length dependence of vghigh |
|wvghigh Width dependence of vghigh |
|vglow Lower bound of the cubic spline function. |
|--------------------------------------------------------------+
|lvglow Length dependence of vglow |
|wvglow Width dependence of vglow |
|tox Gate oxide thickness in um |
|temp Temperature in degree Celcius |
--------------------------------------------------------------+
|vdd Maximum Vds |
|vgg Maximum Vgs |
|vbb Maximum Vbs |
|cgso Gate source overlap capacitance per unit |
| channel width(m) |
|--------------------------------------------------------------+
|cgdo Gate drain overlap capacitance |
| per unit channel width(m) |
|cgbo Gate bulk overlap capacitance |
| per unit channel length(m) |
|xpart Flag for channel charge partitioning |
| continued |
---------------------------------------------------------------
---------------------------------------------------------------
| BSIM2 - model input-output parameters |
|--------------------------------------------------------------+
|rsh Source drain diffusion sheet resistance |
| in ohm per square |
|js Source drain junction saturation current |
| per unit area |
|pb Source drain junction built in potential |
|mj Source drain bottom junction capacitance |
| grading coefficient |
--------------------------------------------------------------+
|pbsw Source drain side junction capacitance |
| built in potential |
|mjsw Source drain side junction capacitance |
| grading coefficient |
|cj Source drain bottom junction capacitance |
| per unit area |
|cjsw Source drain side junction capacitance |
| per unit area |
|wdf Default width of source drain diffusion in um |
|dell Length reduction of source drain diffusion |
---------------------------------------------------------------
@end example
@node Fixed capacitor, Current controlled current source, BSIM2 Berkeley Short Channel IGFET Model, Model and Device Parameters
@section Capacitor: Fixed capacitor
@example
------------------------------------------------------------
| Capacitor - instance parameters (input-output) |
|-----------------------------------------------------------+
| capacitance Device capacitance |
| ic Initial capacitor voltage |
| w Device width |
| l Device length |
------------------------------------------------------------
------------------------------------------------------------
| Capacitor - instance parameters (output-only) |
|-----------------------------------------------------------+
| i Device current |
| p Instantaneous device power |
------------------------------------------------------------
------------------------------------------------------------
| Capacitor - model parameters (input-only) |
|-----------------------------------------------------------+
| c Capacitor model |
------------------------------------------------------------
------------------------------------------------------------
| Capacitor - model parameters (input-output) |
|-----------------------------------------------------------+
| cj Bottom Capacitance per area |
| cjsw Sidewall capacitance per meter |
| defw Default width |
| narrow width correction factor |
------------------------------------------------------------
@end example
@node Current controlled current source, Linear current controlled current source, Fixed capacitor, Model and Device Parameters
@section CCCS: Current controlled current source
@example
------------------------------------------------------------
| CCCS - instance parameters (input-output) |
|-----------------------------------------------------------+
| gain Gain of source |
| control Name of controlling source |
------------------------------------------------------------
------------------------------------------------------------
| CCCS - instance parameters (output-only) |
|-----------------------------------------------------------+
| neg_node Negative node of source |
| pos_node Positive node of source |
| i CCCS output current |
| v CCCS voltage at output |
| p CCCS power |
------------------------------------------------------------
@end example
@node Linear current controlled current source, Current controlled ideal switch, Current controlled current source, Model and Device Parameters
@section CCVS: Linear current controlled current source
@example
------------------------------------------------------------
| CCVS - instance parameters (input-output) |
|-----------------------------------------------------------+
| gain Transresistance (gain) |
| control Controlling voltage source |
------------------------------------------------------------
------------------------------------------------------------
| CCVS - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of source |
| neg_node Negative node of source |
| i CCVS output current |
| v CCVS output voltage |
| p CCVS power |
------------------------------------------------------------
@end example
@node Current controlled ideal switch, Junction Diode model, Linear current controlled current source, Model and Device Parameters
@section CSwitch: Current controlled ideal switch
@example
------------------------------------------------------------
| CSwitch - instance parameters (input-only) |
|-----------------------------------------------------------+
| on Initially closed |
| off Initially open |
------------------------------------------------------------
------------------------------------------------------------
| CSwitch - instance parameters (input-output) |
|-----------------------------------------------------------+
| control Name of controlling source |
------------------------------------------------------------
------------------------------------------------------------
| CSwitch - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of switch |
| neg_node Negative node of switch |
| i Switch current |
| p Instantaneous power |
------------------------------------------------------------
------------------------------------------------------------
| CSwitch - model parameters (input-output) |
|-----------------------------------------------------------+
| csw Current controlled switch model |
| it Threshold current |
| ih Hysteresis current |
| ron Closed resistance |
| roff Open resistance |
------------------------------------------------------------
------------------------------------------------------------
| CSwitch - model parameters (output-only) |
|-----------------------------------------------------------+
| gon Closed conductance |
| goff Open conductance |
------------------------------------------------------------
@end example
@node Junction Diode model, Inductor, Current controlled ideal switch, Model and Device Parameters
@section Diode: Junction Diode model
@example
------------------------------------------------------------
| Diode - instance parameters (input-output) |
|-----------------------------------------------------------+
| off Initially off |
| temp Instance temperature |
| ic Initial device voltage |
| area Area factor |
------------------------------------------------------------
------------------------------------------------------------
| Diode - instance parameters (output-only) |
|-----------------------------------------------------------+
| vd Diode voltage |
| id Diode current |
| c Diode current |
| gd Diode conductance |
------------------------------------------------------------
| cd Diode capacitance |
| charge Diode capacitor charge |
| capcur Diode capacitor current |
| p Diode power |
------------------------------------------------------------
------------------------------------------------------------
| Diode - model parameters (input-only) |
|-----------------------------------------------------------+
| d Diode model |
------------------------------------------------------------
------------------------------------------------------------
| Diode - model parameters (input-output) |
|-----------------------------------------------------------+
| is Saturation current |
| tnom Parameter measurement temperature |
| rs Ohmic resistance |
| n Emission Coefficient |
------------------------------------------------------------
| tt Transit Time |
| cjo Junction capacitance |
| cj0 (null) |
| vj Junction potential |
|-----------------------------------------------------------+
| m Grading coefficient |
| eg Activation energy |
| xti Saturation current temperature exp. |
| kf flicker noise coefficient |
------------------------------------------------------------
| af flicker noise exponent |
| fc Forward bias junction fit parameter |
| bv Reverse breakdown voltage |
| ibv Current at reverse breakdown voltage |
------------------------------------------------------------
------------------------------------------------------------
| Diode - model parameters (output-only) |
|-----------------------------------------------------------+
| cond Ohmic conductance |
------------------------------------------------------------
@end example
@node Inductor, Mutual inductors, Junction Diode model, Model and Device Parameters
@section Inductor: Inductors
@example
------------------------------------------------------------
| Inductor - instance parameters (input-output) |
|-----------------------------------------------------------+
| inductance Inductance of inductor |
| ic Initial current through inductor |
------------------------------------------------------------
-------------------------------------------------------------
| Inductor - instance parameters (output-only) |
|------------------------------------------------------------+
|flux Flux through inductor |
|v Terminal voltage of inductor |
|volt |
|i Current through the inductor |
|current |
p instantaneous power dissipated by the inductor
| |
-------------------------------------------------------------
@end example
@node Mutual inductors, Independent current source, Inductor, Model and Device Parameters
@section mutual: Mutual inductors
@example
------------------------------------------------------------
| mutual - instance parameters (input-output) |
|-----------------------------------------------------------+
| k Mutual inductance |
| coefficient (null) |
| inductor1 First coupled inductor |
| inductor2 Second coupled inductor |
------------------------------------------------------------
@end example
@node Independent current source, Junction Field effect transistor, Mutual inductors, Model and Device Parameters
@section Isource: Independent current source
@example
------------------------------------------------------------
| Isource - instance parameters (input-only) |
|-----------------------------------------------------------+
| pulse Pulse description |
| sine Sinusoidal source description |
| sin Sinusoidal source description |
| exp Exponential source description |
------------------------------------------------------------
| pwl Piecewise linear description |
| sffm single freq. FM description |
| ac AC magnitude,phase vector |
| c Current through current source |
| distof1 f1 input for distortion |
| distof2 f2 input for distortion |
------------------------------------------------------------
------------------------------------------------------------
| Isource - instance parameters (input-output) |
|-----------------------------------------------------------+
| dc DC value of source |
| acmag AC magnitude |
| acphase AC phase |
------------------------------------------------------------
------------------------------------------------------------
| Isource - instance parameters (output-only) |
|-----------------------------------------------------------+
| neg_node Negative node of source |
| pos_node Positive node of source |
acreal AC real part
| acimag AC imaginary part |
------------------------------------------------------------
| function Function of the source |
| order Order of the source function |
| coeffs Coefficients of the source |
| v Voltage across the supply |
| p Power supplied by the source |
------------------------------------------------------------
@end example
@node Junction Field effect transistor, Lossy transmission line, Independent current source, Model and Device Parameters
@section JFET: Junction Field effect transistor
@example
------------------------------------------------------------
| JFET - instance parameters (input-output) |
|-----------------------------------------------------------+
| off Device initially off |
| ic Initial VDS,VGS vector |
| area Area factor |
| ic-vds Initial D-S voltage |
| ic-vgs Initial G-S volrage |
| temp Instance temperature |
------------------------------------------------------------
---------------------------------------------------------------
| JFET - instance parameters (output-only) |
|--------------------------------------------------------------+
|drain-node Number of drain node |
|gate-node Number of gate node |
|source-node Number of source node |
|drain-prime-node Internal drain node |
---------------------------------------------------------------
|source-prime-nodeInternal source node |
|vgs Voltage G-S |
|vgd Voltage G-D |
|ig Current at gate node |
|--------------------------------------------------------------+
|id Current at drain node |
|is Source current |
|igd Current G-D |
|gm Transconductance |
---------------------------------------------------------------
|gds Conductance D-S |
|ggs Conductance G-S |
|ggd Conductance G-D |
|qgs Charge storage G-S junction |
|--------------------------------------------------------------+
|qgd Charge storage G-D junction |
cqgs Capacitance due to charge storage G-S junction
| |
cqgd Capacitance due to charge storage G-D junction
|p Power dissipated by the JFET |
---------------------------------------------------------------
------------------------------------------------------------
| JFET - model parameters (input-output) |
|-----------------------------------------------------------+
| njf N type JFET model |
| pjf P type JFET model |
| vt0 Threshold voltage |
| vto (null) |
------------------------------------------------------------
| beta Transconductance parameter |
| lambda Channel length modulation param. |
| rd Drain ohmic resistance |
| rs Source ohmic resistance |
| cgs G-S junction capacitance |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| JFET - model input-output parameters - continued
|-----------------------------------------------------------+
| cgd G-D junction cap |
| pb Gate junction potential |
| is Gate junction saturation current |
| fc Forward bias junction fit param. |
------------------------------------------------------------
| b Doping tail parameter |
| tnom parameter measurement temperature |
| kf Flicker Noise Coefficient |
| af Flicker Noise Exponent |
------------------------------------------------------------
------------------------------------------------------------
| JFET - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-type or P-type JFET model |
| gd Drain conductance |
| gs Source conductance |
------------------------------------------------------------
@end example
@node Lossy transmission line, GaAs MESFET model, Junction Field effect transistor, Model and Device Parameters
@section LTRA: Lossy transmission line
@example
------------------------------------------------------------
| LTRA - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Initial condition vector:v1,i1,v2,i2 |
------------------------------------------------------------
------------------------------------------------------------
| LTRA - instance parameters (input-output) |
|-----------------------------------------------------------+
| v1 Initial voltage at end 1 |
| v2 Initial voltage at end 2 |
| i1 Initial current at end 1 |
| i2 Initial current at end 2 |
------------------------------------------------------------
------------------------------------------------------------
| LTRA - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node1 Positive node of end 1 of t-line |
| neg_node1 Negative node of end 1 of t.line |
| pos_node2 Positive node of end 2 of t-line |
| neg_node2 Negative node of end 2 of t-line |
------------------------------------------------------------
------------------------------------------------------------
| LTRA - model parameters (input-output) |
|-----------------------------------------------------------+
|ltra LTRA model |
|r Resistance per metre |
|l Inductance per metre |
|g (null) |
------------------------------------------------------------
|c Capacitance per metre |
|len length of line |
|nocontrol No timestep control |
|steplimit always limit timestep to 0.8*(delay of line)
| continued |
------------------------------------------------------------
---------------------------------------------------------------------
| LTRA - model input-output parameters - continued |
|---------------------------------------------------------------------+
|nosteplimit don't always limit timestep to 0.8*(delay of line) |
|lininterp use linear interpolation |
|quadinterp use quadratic interpolation |
|mixedinterp use linear interpolation if quadratic results |
| look unacceptable |
---------------------------------------------------------------------
|truncnr use N-R iterations for step calculation in LTRAtrunc |
|truncdontcut don't limit timestep to keep impulse response |
| calculation errors low |
|compactrel special reltol for straight line checking |
|compactabs special abstol for straight line checking |
---------------------------------------------------------------------
------------------------------------------------------------
| LTRA - model parameters (output-only) |
|-----------------------------------------------------------+
| rel Rel. rate of change of deriv. for bkpt |
| abs Abs. rate of change of deriv. for bkpt |
------------------------------------------------------------
@end example
@node GaAs MESFET model, Level 1 MOSfet model, Lossy transmission line, Model and Device Parameters
@section MES: GaAs MESFET model
@example
------------------------------------------------------------
| MES - instance parameters (input-output) |
|-----------------------------------------------------------+
| area Area factor |
| icvds Initial D-S voltage |
| icvgs Initial G-S voltage |
------------------------------------------------------------
------------------------------------------------------------
| MES - instance parameters (output-only) |
|-----------------------------------------------------------+
|off Device initially off |
|dnode Number of drain node |
|gnode Number of gate node |
|snode Number of source node |
------------------------------------------------------------
|dprimenode Number of internal drain node |
|sprimenode Number of internal source node |
|vgs Gate-Source voltage |
|vgd Gate-Drain voltage |
|-----------------------------------------------------------+
|cg Gate capacitance |
|cd Drain capacitance |
|cgd Gate-Drain capacitance |
|gm Transconductance |
------------------------------------------------------------
|gds Drain-Source conductance |
|ggs Gate-Source conductance |
|ggd Gate-Drain conductance |
|cqgs Capacitance due to gate-source charge storage
|-----------------------------------------------------------+
|cqgd Capacitance due to gate-drain charge storage|
|qgs Gate-Source charge storage |
|qgd Gate-Drain charge storage |
|is Source current |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| MES - instance output-only parameters - continued
|-----------------------------------------------------------+
| p Power dissipated by the mesfet |
-----------------------------------------------------------
------------------------------------------------------------
| MES - model parameters (input-only) |
|-----------------------------------------------------------+
| nmf N type MESfet model |
| pmf P type MESfet model |
------------------------------------------------------------
------------------------------------------------------------
| MES - model parameters (input-output) |
|-----------------------------------------------------------+
| vt0 Pinch-off voltage |
| vto (null) |
| alpha Saturation voltage parameter |
| beta Transconductance parameter |
------------------------------------------------------------
| lambda Channel length modulation param. |
| b Doping tail extending parameter |
| rd Drain ohmic resistance |
| rs Source ohmic resistance |
|-----------------------------------------------------------+
| cgs G-S junction capacitance |
| cgd G-D junction capacitance |
| pb Gate junction potential |
| is Junction saturation current |
------------------------------------------------------------
| fc Forward bias junction fit param. |
| kf Flicker noise coefficient |
| af Flicker noise exponent |
------------------------------------------------------------
------------------------------------------------------------
| MES - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-type or P-type MESfet model |
| gd Drain conductance |
| gs Source conductance |
| depl_cap Depletion capacitance |
| vcrit Critical voltage |
------------------------------------------------------------
@end example
@node Level 1 MOSfet model, Level 2 MOSfet model, GaAs MESFET model, Model and Device Parameters
@section Mos1: Level 1 MOSfet model with Meyer capacitance model
@example
------------------------------------------------------------
| Mos1 - instance parameters (input-only) |
|-----------------------------------------------------------+
| off Device initially off |
| ic Vector of D-S, G-S, B-S voltages |
------------------------------------------------------------
------------------------------------------------------------
| Mos1 - instance parameters (input-output) |
|-----------------------------------------------------------+
| m Multiplicity
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------
| pd Drain perimeter |
| ps Source perimeter |
| nrd Drain squares |
| nrs Source squares |
|-----------------------------------------------------------+
| icvds Initial D-S voltage |
| icvgs Initial G-S voltage |
| icvbs Initial B-S voltage |
| temp Instance temperature |
------------------------------------------------------------
------------------------------------------------------------
| Mos1 - instance parameters (output-only) |
|-----------------------------------------------------------+
| id Drain current |
| is Source current |
| ig Gate current |
| ib Bulk current |
------------------------------------------------------------
| ibd B-D junction current |
| ibs B-S junction current |
| vgs Gate-Source voltage |
| vds Drain-Source voltage |
|-----------------------------------------------------------+
| vbs Bulk-Source voltage |
| vbd Bulk-Drain voltage |
| dnode Number of the drain node |
| gnode Number of the gate node |
------------------------------------------------------------
| snode Number of the source node |
| bnode Number of the node |
| dnodeprime Number of int. drain node |
| snodeprime Number of int. source node |
|-----------------------------------------------------------+
| von |
| vdsat Saturation drain voltage |
| sourcevcrit Critical source voltage |
| drainvcrit Critical drain voltage |
| rs Source resistance |
| continued |
------------------------------------------------------------
--------------------------------------------------------------
| Mos1 - instance output-only parameters - continued
|-------------------------------------------------------------+
|sourceconductanceConductance of source |
|rd Drain conductance |
|drainconductance Conductance of drain |
|gm Transconductance |
--------------------------------------------------------------
|gds Drain-Source conductance |
|gmb Bulk-Source transconductance |
|gmbs |
|gbd Bulk-Drain conductance |
|-------------------------------------------------------------+
|gbs Bulk-Source conductance |
|cbd Bulk-Drain capacitance |
|cbs Bulk-Source capacitance |
|cgs Gate-Source capacitance |
--------------------------------------------------------------
|cgd Gate-Drain capacitance |
|cgb Gate-Bulk capacitance |
|cqgs Capacitance due to gate-source charge storage
|cqgd Capacitance due to gate-drain charge storage|
|-------------------------------------------------------------+
|cqgb Capacitance due to gate-bulk charge storage |
|cqbd Capacitance due to bulk-drain charge storage|
cqbs Capacitance due to bulk-source charge storage
|cbd0 Zero-Bias B-D junction capacitance |
--------------------------------------------------------------
|cbdsw0 |
|cbs0 Zero-Bias B-S junction capacitance |
|cbssw0 |
|qgs Gate-Source charge storage |
|-------------------------------------------------------------+
|qgd Gate-Drain charge storage |
|qgb Gate-Bulk charge storage |
|qbd Bulk-Drain charge storage |
|qbs Bulk-Source charge storage |
|p Instaneous power |
--------------------------------------------------------------
------------------------------------------------------------
| Mos1 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos N type MOSfet model |
| pmos P type MOSfet model |
------------------------------------------------------------
------------------------------------------------------------
| Mos1 - model parameters (input-output) |
|-----------------------------------------------------------+
| vto Threshold voltage |
| vt0 (null) |
| kp Transconductance parameter |
| gamma Bulk threshold parameter |
------------------------------------------------------------
| phi Surface potential |
| lambda Channel length modulation |
| rd Drain ohmic resistance |
| continued |
------------------------------------------------------------
------------------------------------------------------------
| Mos1 - model input-output parameters - continued
|-----------------------------------------------------------+
| rs Source ohmic resistance |
| cbd B-D junction capacitance |
| cbs B-S junction capacitance |
| is Bulk junction sat. current |
------------------------------------------------------------
| pb Bulk junction potential |
| cgso Gate-source overlap cap. |
| cgdo Gate-drain overlap cap. |
| cgbo Gate-bulk overlap cap. |
|-----------------------------------------------------------+
| rsh Sheet resistance |
| cj Bottom junction cap per area |
| mj Bottom grading coefficient |
| cjsw Side junction cap per area |
------------------------------------------------------------
| mjsw Side grading coefficient |
| js Bulk jct. sat. current density |
| tox Oxide thickness |
| ld Lateral diffusion |
|-----------------------------------------------------------+
| u0 Surface mobility |
| uo (null) |
| fc Forward bias jct. fit param. |
| nsub Substrate doping |
------------------------------------------------------------
| tpg Gate type |
| nss Surface state density |
| tnom Parameter measurement temperature |
| kf Flicker noise coefficient |
| af Flicker noise exponent |
------------------------------------------------------------
------------------------------------------------------------
| Mos1 - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-channel or P-channel MOS |
------------------------------------------------------------
@end example
@node Level 2 MOSfet model, Level 3 MOSfet model, Level 1 MOSfet model, Model and Device Parameters
@section Mos2: Level 2 MOSfet model with Meyer capacitance model
@example
------------------------------------------------------------
| Mos2 - instance parameters (input-only) |
|-----------------------------------------------------------+
| off Device initially off |
| ic Vector of D-S, G-S, B-S voltages |
------------------------------------------------------------
------------------------------------------------------------
| Mos2 - instance parameters (input-output) |
|-----------------------------------------------------------+
| m Multiplicity |
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------
| pd Drain perimeter |
| ps Source perimeter |
| nrd Drain squares |
| nrs Source squares |
|-----------------------------------------------------------+
| icvds Initial D-S voltage |
| icvgs Initial G-S voltage |
| icvbs Initial B-S voltage |
| temp Instance operating temperature |
------------------------------------------------------------
------------------------------------------------------------
| Mos2 - instance parameters (output-only) |
|-----------------------------------------------------------+
| id Drain current |
| cd |
| ibd B-D junction current |
| ibs B-S junction current |
------------------------------------------------------------
| is Source current |
| ig Gate current |
| ib Bulk current |
| vgs Gate-Source voltage |
|-----------------------------------------------------------+
| vds Drain-Source voltage |
| vbs Bulk-Source voltage |
| vbd Bulk-Drain voltage |
| dnode Number of drain node |
------------------------------------------------------------
| gnode Number of gate node |
| snode Number of source node |
| bnode Number of bulk node |
| dnodeprime Number of internal drain node |
|-----------------------------------------------------------+
| snodeprime Number of internal source node |
| von |
| vdsat Saturation drain voltage |
| sourcevcrit Critical source voltage |
| drainvcrit Critical drain voltage |
| continued |
------------------------------------------------------------
--------------------------------------------------------------
| Mos2 - instance output-only parameters - continued
|-------------------------------------------------------------+
|rs Source resistance |
|sourceconductanceSource conductance |
|rd Drain resistance |
|drainconductance Drain conductance |
--------------------------------------------------------------
|gm Transconductance |
|gds Drain-Source conductance |
|gmb Bulk-Source transconductance |
|gmbs |
|-------------------------------------------------------------+
|gbd Bulk-Drain conductance |
|gbs Bulk-Source conductance |
|cbd Bulk-Drain capacitance |
|cbs Bulk-Source capacitance |
--------------------------------------------------------------
|cgs Gate-Source capacitance |
|cgd Gate-Drain capacitance |
|cgb Gate-Bulk capacitance |
|cbd0 Zero-Bias B-D junction capacitance |
|-------------------------------------------------------------+
|cbdsw0 |
|cbs0 Zero-Bias B-S junction capacitance |
|cbssw0 |
cqgs Capacitance due to gate-source charge storage
| |
--------------------------------------------------------------
|cqgd Capacitance due to gate-drain charge storage|
|cqgb Capacitance due to gate-bulk charge storage |
|cqbd Capacitance due to bulk-drain charge storage|
|cqbs Capacitance due to bulk-source charge storage
|-------------------------------------------------------------+
|qgs Gate-Source charge storage |
|qgd Gate-Drain charge storage |
|qgb Gate-Bulk charge storage |
|qbd Bulk-Drain charge storage |
|qbs Bulk-Source charge storage |
|p Instantaneous power |
--------------------------------------------------------------
------------------------------------------------------------
| Mos2 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos N type MOSfet model |
| pmos P type MOSfet model |
------------------------------------------------------------
------------------------------------------------------------
| Mos2 - model parameters (input-output) |
|-----------------------------------------------------------+
| vto Threshold voltage |
| vt0 (null) |
| kp Transconductance parameter |
| gamma Bulk threshold parameter |
------------------------------------------------------------
| phi Surface potential |
| lambda Channel length modulation |
| rd Drain ohmic resistance |
| rs Source ohmic resistance |
|-----------------------------------------------------------+
| cbd B-D junction capacitance |
| cbs B-S junction capacitance |
| is Bulk junction sat. current |
| pb Bulk junction potential |
------------------------------------------------------------
| cgso Gate-source overlap cap. |
| cgdo Gate-drain overlap cap. |
| cgbo Gate-bulk overlap cap. |
| rsh Sheet resistance |
|-----------------------------------------------------------+
| cj Bottom junction cap per area |
| mj Bottom grading coefficient |
| cjsw Side junction cap per area |
| mjsw Side grading coefficient |
------------------------------------------------------------
| js Bulk jct. sat. current density |
| tox Oxide thickness |
| ld Lateral diffusion |
| u0 Surface mobility |
|-----------------------------------------------------------+
| uo (null) |
| fc Forward bias jct. fit param. |
| nsub Substrate doping |
| tpg Gate type |
------------------------------------------------------------
| nss Surface state density |
| delta Width effect on threshold |
| uexp Crit. field exp for mob. deg. |
| ucrit Crit. field for mob. degradation |
|-----------------------------------------------------------+
| vmax Maximum carrier drift velocity |
| xj Junction depth |
| neff Total channel charge coeff. |
| nfs Fast surface state density |
------------------------------------------------------------
| tnom Parameter measurement temperature |
| kf Flicker noise coefficient |
| af Flicker noise exponent |
------------------------------------------------------------
------------------------------------------------------------
| Mos2 - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-channel or P-channel MOS |
------------------------------------------------------------
@end example
@node Level 3 MOSfet model, Level 6 MOSfet model, Level 2 MOSfet model, Model and Device Parameters
@section Mos3: Level 3 MOSfet model with Meyer capacitance model
@example
------------------------------------------------------------
| Mos3 - instance parameters (input-only) |
|-----------------------------------------------------------+
| off Device initially off |
------------------------------------------------------------
------------------------------------------------------------
| Mos3 - instance parameters (input-output) |
|-----------------------------------------------------------+
| m Multiplicity |
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------+
| pd Drain perimeter |
| ps Source perimeter |
| nrd Drain squares |
| nrs Source squares |
|-----------------------------------------------------------+
| icvds Initial D-S voltage |
| icvgs Initial G-S voltage |
| icvbs Initial B-S voltage |
| ic Vector of D-S, G-S, B-S voltages |
| temp Instance operating temperature |
------------------------------------------------------------
------------------------------------------------------------
| Mos3 - instance parameters (output-only) |
|-----------------------------------------------------------+
| id Drain current |
| cd Drain current |
| ibd B-D junction current |
| ibs B-S junction current |
------------------------------------------------------------
| is Source current |
| ig Gate current |
| ib Bulk current |
| vgs Gate-Source voltage |
|-----------------------------------------------------------+
| vds Drain-Source voltage |
| vbs Bulk-Source voltage |
| vbd Bulk-Drain voltage |
| dnode Number of drain node |
------------------------------------------------------------
| gnode Number of gate node |
| snode Number of source node |
| bnode Number of bulk node |
| dnodeprime Number of internal drain node |
| snodeprime Number of internal source node |
| continued |
------------------------------------------------------------
--------------------------------------------------------------
| Mos3 - instance output-only parameters - continued
|-------------------------------------------------------------+
|von Turn-on voltage |
|vdsat Saturation drain voltage |
|sourcevcrit Critical source voltage |
|drainvcrit Critical drain voltage |
--------------------------------------------------------------
|rs Source resistance |
|sourceconductanceSource conductance |
|rd Drain resistance |
|drainconductance Drain conductance |
|-------------------------------------------------------------+
|gm Transconductance |
|gds Drain-Source conductance |
|gmb Bulk-Source transconductance |
|gmbs Bulk-Source transconductance |
--------------------------------------------------------------
|gbd Bulk-Drain conductance |
|gbs Bulk-Source conductance |
|cbd Bulk-Drain capacitance |
|cbs Bulk-Source capacitance |
|-------------------------------------------------------------+
|cgs Gate-Source capacitance |
|cgd Gate-Drain capacitance |
|cgb Gate-Bulk capacitance |
cqgs Capacitance due to gate-source charge storage
| |
--------------------------------------------------------------
|cqgd Capacitance due to gate-drain charge storage|
|cqgb Capacitance due to gate-bulk charge storage |
|cqbd Capacitance due to bulk-drain charge storage|
|cqbs Capacitance due to bulk-source charge storage
|-------------------------------------------------------------+
|cbd0 Zero-Bias B-D junction capacitance |
|cbdsw0 Zero-Bias B-D sidewall capacitance |
|cbs0 Zero-Bias B-S junction capacitance |
|cbssw0 Zero-Bias B-S sidewall capacitance |
--------------------------------------------------------------
|qbs Bulk-Source charge storage |
|qgs Gate-Source charge storage |
|qgd Gate-Drain charge storage |
|qgb Gate-Bulk charge storage |
|qbd Bulk-Drain charge storage |
|p Instantaneous power |
--------------------------------------------------------------
------------------------------------------------------------
| Mos3 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos N type MOSfet model |
| pmos P type MOSfet model |
------------------------------------------------------------
------------------------------------------------------------
| Mos3 - model parameters (input-output) |
|-----------------------------------------------------------+
| vto Threshold voltage |
| vt0 (null) |
| kp Transconductance parameter |
| gamma Bulk threshold parameter |
------------------------------------------------------------
| phi Surface potential |
| rd Drain ohmic resistance |
| rs Source ohmic resistance |
| cbd B-D junction capacitance |
|-----------------------------------------------------------+
| cbs B-S junction capacitance |
| is Bulk junction sat. current |
| pb Bulk junction potential |
| cgso Gate-source overlap cap. |
------------------------------------------------------------
| cgdo Gate-drain overlap cap. |
| cgbo Gate-bulk overlap cap. |
| rsh Sheet resistance |
| cj Bottom junction cap per area |
|-----------------------------------------------------------+
| mj Bottom grading coefficient |
| cjsw Side junction cap per area |
| mjsw Side grading coefficient |
| js Bulk jct. sat. current density |
------------------------------------------------------------
| tox Oxide thickness |
| xl Length mask adjustment |
| wd Width Narrowing (Diffusion) |
| xw Width mask adjustment |
| ld Lateral diffusion |
| u0 Surface mobility |
| uo (null) |
|-----------------------------------------------------------+
| fc Forward bias jct. fit param. |
| nsub Substrate doping |
| tpg Gate type |
| nss Surface state density |
------------------------------------------------------------
| vmax Maximum carrier drift velocity |
| xj Junction depth |
| nfs Fast surface state density |
| xd Depletion layer width |
|-----------------------------------------------------------+
| alpha Alpha |
| eta Vds dependence of threshold voltage |
| delta Width effect on threshold |
| input_delta (null) |
------------------------------------------------------------
| theta Vgs dependence on mobility |
| kappa Kappa |
| tnom Parameter measurement temperature |
| kf Flicker noise coefficient |
| af Flicker noise exponent |
------------------------------------------------------------
------------------------------------------------------------
| Mos3 - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-channel or P-channel MOS |
------------------------------------------------------------
@end example
@node Level 6 MOSfet model, Simple linear resistor, Level 3 MOSfet model, Model and Device Parameters
@section Mos6: Level 6 MOSfet model with Meyer capacitance model
@example
------------------------------------------------------------
| Mos6 - instance parameters (input-only) |
|-----------------------------------------------------------+
| off Device initially off |
| ic Vector of D-S, G-S, B-S voltages |
------------------------------------------------------------
------------------------------------------------------------
| Mos6 - instance parameters (input-output) |
|-----------------------------------------------------------+
| l Length |
| w Width |
| ad Drain area |
| as Source area |
------------------------------------------------------------
| pd Drain perimeter |
| ps Source perimeter |
| nrd Drain squares |
| nrs Source squares |
|-----------------------------------------------------------+
| icvds Initial D-S voltage |
| icvgs Initial G-S voltage |
| icvbs Initial B-S voltage |
| temp Instance temperature |
------------------------------------------------------------
------------------------------------------------------------
| Mos6 - instance parameters (output-only) |
|-----------------------------------------------------------+
| id Drain current |
| cd Drain current |
| is Source current |
| ig Gate current |
------------------------------------------------------------
| ib Bulk current |
| ibs B-S junction capacitance |
| ibd B-D junction capacitance |
| vgs Gate-Source voltage |
|-----------------------------------------------------------+
| vds Drain-Source voltage |
| vbs Bulk-Source voltage |
| vbd Bulk-Drain voltage |
| dnode Number of the drain node |
------------------------------------------------------------
| gnode Number of the gate node |
| snode Number of the source node |
| bnode Number of the node |
| dnodeprime Number of int. drain node |
| snodeprime Number of int. source node |
| continued |
------------------------------------------------------------
--------------------------------------------------------------
| Mos6 - instance output-only parameters - continued
|-------------------------------------------------------------+
|rs Source resistance |
|sourceconductanceSource conductance |
|rd Drain resistance |
|drainconductance Drain conductance |
--------------------------------------------------------------
|von Turn-on voltage |
|vdsat Saturation drain voltage |
|sourcevcrit Critical source voltage |
|drainvcrit Critical drain voltage |
|-------------------------------------------------------------+
|gmbs Bulk-Source transconductance |
|gm Transconductance |
|gds Drain-Source conductance |
|gbd Bulk-Drain conductance |
--------------------------------------------------------------
|gbs Bulk-Source conductance |
|cgs Gate-Source capacitance |
|cgd Gate-Drain capacitance |
|cgb Gate-Bulk capacitance |
|-------------------------------------------------------------+
|cbd Bulk-Drain capacitance |
|cbs Bulk-Source capacitance |
|cbd0 Zero-Bias B-D junction capacitance |
|cbdsw0 |
--------------------------------------------------------------
|cbs0 Zero-Bias B-S junction capacitance |
|cbssw0 |
|cqgs Capacitance due to gate-source charge storage
|cqgd Capacitance due to gate-drain charge storage|
|-------------------------------------------------------------+
|cqgb Capacitance due to gate-bulk charge storage |
|cqbd Capacitance due to bulk-drain charge storage|
cqbs Capacitance due to bulk-source charge storage
|qgs Gate-Source charge storage |
--------------------------------------------------------------
|qgd Gate-Drain charge storage |
|qgb Gate-Bulk charge storage |
|qbd Bulk-Drain charge storage |
|qbs Bulk-Source charge storage |
|p Instantaneous power |
--------------------------------------------------------------
------------------------------------------------------------
| Mos6 - model parameters (input-only) |
|-----------------------------------------------------------+
| nmos N type MOSfet model |
| pmos P type MOSfet model |
------------------------------------------------------------
------------------------------------------------------------
| Mos6 - model parameters (input-output) |
|-----------------------------------------------------------+
| vto Threshold voltage |
| vt0 (null) |
| kv Saturation voltage factor |
| nv Saturation voltage coeff. |
------------------------------------------------------------
| kc Saturation current factor |
| nc Saturation current coeff. |
| nvth Threshold voltage coeff. |
| ps Sat. current modification par. |
|-----------------------------------------------------------+
| gamma Bulk threshold parameter |
| gamma1 Bulk threshold parameter 1 |
| sigma Static feedback effect par. |
| phi Surface potential |
------------------------------------------------------------
| lambda Channel length modulation param. |
| lambda0 Channel length modulation param. 0 |
| lambda1 Channel length modulation param. 1 |
| rd Drain ohmic resistance |
|-----------------------------------------------------------+
| rs Source ohmic resistance |
| cbd B-D junction capacitance |
| cbs B-S junction capacitance |
| is Bulk junction sat. current |
------------------------------------------------------------
| pb Bulk junction potential |
| cgso Gate-source overlap cap. |
| cgdo Gate-drain overlap cap. |
| cgbo Gate-bulk overlap cap. |
|-----------------------------------------------------------+
| rsh Sheet resistance |
| cj Bottom junction cap per area |
| mj Bottom grading coefficient |
| cjsw Side junction cap per area |
------------------------------------------------------------
| mjsw Side grading coefficient |
| js Bulk jct. sat. current density |
| ld Lateral diffusion |
| tox Oxide thickness |
|-----------------------------------------------------------+
| u0 Surface mobility |
| uo (null) |
| fc Forward bias jct. fit param. |
| tpg Gate type |
------------------------------------------------------------
| nsub Substrate doping |
| nss Surface state density |
| tnom Parameter measurement temperature |
------------------------------------------------------------
------------------------------------------------------------
| Mos6 - model parameters (output-only) |
|-----------------------------------------------------------+
| type N-channel or P-channel MOS |
------------------------------------------------------------
@end example
@node Simple linear resistor, Ideal voltage controlled switch, Level 6 MOSfet model, Model and Device Parameters
@section Resistor: Simple linear resistor
@example
------------------------------------------------------------
| Resistor - instance parameters (input-output) |
|-----------------------------------------------------------+
| resistance Resistance |
| temp Instance operating temperature |
| l Length |
| w Width |
------------------------------------------------------------
------------------------------------------------------------
| Resistor - instance parameters (output-only) |
|-----------------------------------------------------------+
| i Current |
| p Power |
------------------------------------------------------------
------------------------------------------------------------
| Resistor - model parameters (input-only) |
|-----------------------------------------------------------+
| r Device is a resistor model |
------------------------------------------------------------
------------------------------------------------------------
| Resistor - model parameters (input-output) |
|-----------------------------------------------------------+
| rsh Sheet resistance |
| narrow Narrowing of resistor |
| tc1 First order temp. coefficient |
| tc2 Second order temp. coefficient |
| defw Default device width |
| tnom Parameter measurement temperature |
------------------------------------------------------------
@end example
@node Ideal voltage controlled switch, Lossless transmission line, Simple linear resistor, Model and Device Parameters
@section Switch: Ideal voltage controlled switch
@example
------------------------------------------------------------
| Switch - instance parameters (input-only) |
|-----------------------------------------------------------+
| on Switch initially closed |
| off Switch initially open |
------------------------------------------------------------
------------------------------------------------------------
| Switch - instance parameters (input-output) |
|-----------------------------------------------------------+
| pos_node Positive node of switch |
| neg_node Negative node of switch |
------------------------------------------------------------
------------------------------------------------------------
| Switch - instance parameters (output-only) |
|-----------------------------------------------------------+
| cont_p_node Positive contr. node of switch |
| cont_n_node Positive contr. node of switch |
| i Switch current |
| p Switch power |
------------------------------------------------------------
------------------------------------------------------------
| Switch - model parameters (input-output) |
|-----------------------------------------------------------+
| sw Switch model |
| vt Threshold voltage |
| vh Hysteresis voltage |
| ron Resistance when closed |
| roff Resistance when open |
------------------------------------------------------------
------------------------------------------------------------
| Switch - model parameters (output-only) |
|-----------------------------------------------------------+
| gon Conductance when closed |
| goff Conductance when open |
------------------------------------------------------------
@end example
@node Lossless transmission line, Voltage controlled current source, Ideal voltage controlled switch, Model and Device Parameters
@section Tranline: Lossless transmission line
@example
------------------------------------------------------------
| Tranline - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Initial condition vector:v1,i1,v2,i2 |
------------------------------------------------------------
------------------------------------------------------------
| Tranline - instance parameters (input-output) |
|-----------------------------------------------------------+
| z0 Characteristic impedance |
| zo (null) |
| f Frequency |
| td Transmission delay |
------------------------------------------------------------
| nl Normalized length at frequency given |
| v1 Initial voltage at end 1 |
| v2 Initial voltage at end 2 |
| i1 Initial current at end 1 |
| i2 Initial current at end 2 |
------------------------------------------------------------
------------------------------------------------------------
| Tranline - instance parameters (output-only) |
|-----------------------------------------------------------+
| rel Rel. rate of change of deriv. for bkpt |
| abs Abs. rate of change of deriv. for bkpt |
| pos_node1 Positive node of end 1 of t. line |
| neg_node1 Negative node of end 1 of t. line |
------------------------------------------------------------
| pos_node2 Positive node of end 2 of t. line |
| neg_node2 Negative node of end 2 of t. line |
| delays Delayed values of excitation |
------------------------------------------------------------
@end example
@node Voltage controlled current source, Voltage controlled voltage source, Lossless transmission line, Model and Device Parameters
@section VCCS: Voltage controlled current source
@example
------------------------------------------------------------
| VCCS - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Initial condition of controlling source |
------------------------------------------------------------
------------------------------------------------------------
| VCCS - instance parameters (input-output) |
|-----------------------------------------------------------+
| gain Transconductance of source (gain) |
------------------------------------------------------------
------------------------------------------------------------
| VCCS - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of source |
| neg_node Negative node of source |
| cont_p_node Positive node of contr. source |
| cont_n_node Negative node of contr. source |
------------------------------------------------------------
| i Output current |
| v Voltage across output |
| p Power |
------------------------------------------------------------
@end example
@node Voltage controlled voltage source, Independent voltage source, Voltage controlled current source, Model and Device Parameters
@section VCVS: Voltage controlled voltage source
@example
------------------------------------------------------------
| VCVS - instance parameters (input-only) |
|-----------------------------------------------------------+
| ic Initial condition of controlling source |
------------------------------------------------------------
------------------------------------------------------------
| VCVS - instance parameters (input-output) |
|-----------------------------------------------------------+
| gain Voltage gain |
------------------------------------------------------------
------------------------------------------------------------
| VCVS - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of source |
| neg_node Negative node of source |
| cont_p_node Positive node of contr. source |
cont_n_node Negative node of contr. source
------------------------------------------------------------
| i Output current |
| v Output voltage |
| p Power |
------------------------------------------------------------
@end example
@node Independent voltage source, , Voltage controlled voltage source, Model and Device Parameters
@section Vsource: Independent voltage source
@example
------------------------------------------------------------
| Vsource - instance parameters (input-only) |
|-----------------------------------------------------------+
| pulse Pulse description |
| sine Sinusoidal source description |
| sin Sinusoidal source description |
| exp Exponential source description |
------------------------------------------------------------
| pwl Piecewise linear description |
| sffm Single freq. FM description |
| ac AC magnitude, phase vector |
| distof1 f1 input for distortion |
| distof2 f2 input for distortion |
------------------------------------------------------------
------------------------------------------------------------
| Vsource - instance parameters (input-output) |
|-----------------------------------------------------------+
| dc D.C. source value |
| acmag A.C. Magnitude |
| acphase A.C. Phase |
------------------------------------------------------------
------------------------------------------------------------
| Vsource - instance parameters (output-only) |
|-----------------------------------------------------------+
| pos_node Positive node of source |
| neg_node Negative node of source |
| function Function of the source |
| order Order of the source function |
------------------------------------------------------------
| coeffs Coefficients for the function |
| acreal AC real part |
| acimag AC imaginary part |
| i Voltage source current |
| p Instantaneous power |
------------------------------------------------------------
@end example
@chapter NGSPICE enhancements over Spice3
NGSPICE is the result of many hours of work spent in front of a
screen trying to fix and enhance the original Spice3 code. Most of
the work done affects simulation results in some way, so many users
ask why the results obtained with Spice3 differ with the ones they
get from NGSPICE.
This chapter collects all the enhancements introduced into NGSPICE
during its development, ordered by categories. For each improvement
described here, the file(s) and function(s) affected are reported
into a table, letting the experienced user to understand at what
extent such improvement affects his or her simulation.
@section Device models code
This section collects most of the enhancements made to the code
that builds up device models and device support routines. If you are
concerned about discrepancies between the results you get with
NGSPICE and the ones you got with a clean Spice3f, look here to see if
they depend on a bug that has been fixed (or a new on introduced)
@subsection Resistor Model
The NGSPICE resistor model has been enhanced adding some useful
features already present in other simulators:
@itemize @bullet
@item Different resistance value for AC analysis (Serban Popescu).
@item Device Multiplicity. The "M" parameter simulates "M" paralleled
resistors (Serban Popescu).
@item "Short" model parameter to take into account resistor shortening
due to side etching. The original spice3 implementation had only
the "narrow" parameter (Alan Gillespie).
@item "scale" instance parameter to scale the AC or DC value (Paolo
Nenzi).
@end itemize
@noindent
@table @asis
@item Authors:
Alan Gillespie, Paolo Nenzi, Serban Popescu
@item File:
@file{spicelib/dev/res/*}
@item Function:
All the functions that makes up the model.
@item Affects:
The resistor model only.
@end table
@subsection Capacitor Model
In @code{CAPask()}, the power stored in a capacitor and current
through it were not showed correctly during transient analysis.
@noindent
@table @asis
@item Author:
Alan Gillespie
@item File:
@file{spicelib/devices/cap/capask.c}
@item Function:
@code{CAPask()}
@item Affects:
The capacitor model only.
@end table
@subsection Diode (D) model fixes
In the original implementation of the diode model, the parameter
@code{DIOtBrkdwnV} was used instead of the flag @code{DIObreakdownVoltageGiven},
in the @code{DIOload()} function. In the same function the
@code{DIOjunctionPot} was used instead of the temperature corrected
version @code{DIOtJctPot}.
In the @code{DIOtemp()} function, the @code{DIOtVcrit} was calculated without
taking into account the device area. This could cause floating point
overflows, especially in device models designed to be scaled by a small area,
e.g. 2u by 2u diodes (area=4e-12).
The flawed code was:
@example
here->DIOtVcrit=vte*log(vte/(CONSTroot2*here->DIOtSatCur));
@end example
@example
here->DIOtVcrit=vte*
log(vte/(CONSTroot2*here->DIOtSatCur*here->DIOarea));
@end example
@noindent
@sc{Enhancement Data:}
@table @asis
@item Author:
Alan Gillespie
@item Files:
@file{spicelib/devices/dioload.c}
@file{spicelib/devices/diotemp.c}
@item Function:
@code{DIOload(), DIOtemp()}
@item Affects:
The pn junction diode model.
@end table
@subsection Level 1 MOS model
The Level 1 MOS model (MOS1)now accepts the "M" device
parameter (multiplicity), to simulate "M" paralleled identical
devices. The "M" parameter affects the following quantities:
@itemize @bullet
@item In the AC load routine (@code{MOS1acLoad()}), the value assigned
to the "M" (@code{MOS1m}) parameter multiplies the overlap capacitances:
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}.
@item In the instance parameters ask routine (@code{MOS1ask()}),
the value of gate-source, gate-drain and gate-bulk capacitances,
corresponding to the parameters: @code{MOS1_CAPGS}, @code{MOS1_CAPGD},
@code{MOS1_CAPGB}, are multiplied by the value of "M".
@item In the distortion analysis setup routine (@code{MOS1dset()}),
the overlap capcitances (@code{GateSourceOverlapCap},
@code{GateDrainOverlapCap}, @code{GateBulkOverlapCap}), the saturation
currents (@code{DrainSatCurr}, @code{SourceSatCurr}), the "beta"
(@code{Beta}) and the oxide capacitance (@code{OxideCap}) are all
mutiplied by the value of "M".
@item In the main load routine (@code{MOS1load()}), the value of "M"
paramter multiplies:@code{DrainSatCurr}, @code{SourceSatCurr},
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}, @code{Beta}, @code{OxideCap}. The meaning of
the variables have been already explained above.
@item In the noise analysis routine (in @code{MOS1noi()}), the noise
densities, contained in the @code{noizDEns[]} vector are multplied by
the value of "M".
@item In the load routine for Pole-Zero analysis, the following quantities
are multiplied by the value of "M": @code{GateSourceOverlapCap},
@code{GateDrainOverlapCap}, @code{GateBulkOverlapCap}.
@item In the device "temp" routine (in @code{MOS1temp()}) the source and
drain critical voltages (@code{MOS1sourceVcrit}, @code{MOS1drainVcrit})
are multiplied by the value of "M", like the zero-voltage bulk-drain and
bulk-source capacitances: @code{czbd}, @code{czbdsw}, @code{czbs},
@code{czbssw}, where "sw" suffix stands for "sidewall" and means perimetral
capacitsnces and the drain and sources conductances (
@code{MOS1drainConductance}. @code{MOS1sourceConductance})
@end itemize
Other minor changes for "M" parameter support includes: @code{MOS1sprt()}
prints the value of "M", @code{MOS1param()} sets the value of "M" and
@code{MOS1ask()} returns that value.
The "Gmin" implementation across the substrate diodes of MOS1 was incorrect,
correcting this dramatically improved DC convergence. The original code in
@code{MOS1load()} was:
@example
...
...
next1: if(vbs <= 0) @{
here->MOS1gbs = SourceSatCur/vt;
here->MOS1cbs = here->MOS1gbs*vbs;
here->MOS1gbs += ckt->CKTgmin;
@} else @{
evbs = exp(MIN(MAX_EXP_ARG,vbs/vt));
here->MOS1gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS1cbs = SourceSatCur * (evbs-1);
@}
if(vbd <= 0) @{
here->MOS1gbd = DrainSatCur/vt;
here->MOS1cbd = here->MOS1gbd *vbd;
here->MOS1gbd += ckt->CKTgmin;
@} else @{
evbd = exp(MIN(MAX_EXP_ARG,vbd/vt));
here->MOS1gbd = DrainSatCur*evbd/vt +ckt->CKTgmin;
here->MOS1cbd = DrainSatCur *(evbd-1);
@}
...
...
@end example
and the new one is:
@example
...
...
next1: if(vbs <= -3*vt) @{
here->MOS1gbs = ckt->CKTgmin;
here->MOS1cbs = here->MOS1gbs*vbs-SourceSatCur;
@} else @{
evbs = exp(MIN(MAX_EXP_ARG,vbs/vt));
here->MOS1gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS1cbs = SourceSatCur*(evbs-1) + ckt->CKTgmin*vbs;
@}
if(vbd <= -3*vt) @{
here->MOS1gbd = ckt->CKTgmin;
here->MOS1cbd = here->MOS1gbd*vbd-DrainSatCur;
@} else @{
evbd = exp(MIN(MAX_EXP_ARG,vbd/vt));
here->MOS1gbd = DrainSatCur*evbd/vt + ckt->CKTgmin;
here->MOS1cbd = DrainSatCur*(evbd-1) + ckt->CKTgmin*vbd;
@}
...
...
@end example
In the "load current vector" section of the @code{MOS1load()} routine,
"Gmin" appeared in the calculation of @code{ceqbd} and @code{ceqbs}:
@example
/*
* load current vector
*/
ceqbs = model->MOS1type *
(here->MOS1cbs-(here->MOS1gbs-ckt->CKTgmin)*vbs);
ceqbd = model->MOS1type *
(here->MOS1cbd-(here->MOS1gbd-ckt->CKTgmin)*vbd);
@end example
The code has been corrected as follows:
@example
/*
* load current vector
*/
ceqbs = model->MOS1type *
(here->MOS1cbs-(here->MOS1gbs)*vbs);
ceqbd = model->MOS1type *
(here->MOS1cbd-(here->MOS1gbd)*vbd);
@end example
MOS1 device reported only half of the Meyer capcitance without adding the
overlap capacitance contribution, when reporting to the @code{.OP} printout
or in the rawfile. The routine @code{MOS1ask()} was responsible for this:
@example
...
...
case MOS1_CGS:
value->rValue = *(ckt->CKTstate0 + here->MOS1capgs);
return(OK);
case MOS1_CGD:
value->rValue = *(ckt->CKTstate0 + here->MOS1capgd);
return(OK);
...
...
case MOS1_CAPGS:
value->rValue = *(ckt->CKTstate0 + here->MOS1capgs);
return(OK);
...
...
case MOS1_CAPGD:
value->rValue = *(ckt->CKTstate0 + here->MOS1capgd);
return(OK);
...
...
case MOS1_CAPGB:
value->rValue = *(ckt->CKTstate0 + here->MOS1capgb);
return(OK);
@end example
The new code is:
@example
...
...
case MOS1_CGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgs);
return(OK);
case MOS1_CGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgd);
return(OK);
...
...
case MOS1_CAPGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgs);
/* add overlap capacitance */
value->rValue += (here->sMOS1modPtr->MOS1gateSourceOverlapCapFactor)
* here->MOS1m
* (here->MOS1w);
return(OK);
...
...
case MOS1_CAPGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgd);
/* add overlap capacitance */
value->rValue += (here->sMOS1modPtr->MOS1gateSourceOverlapCapFactor)
* here->MOS1m
* (here->MOS1w);
return(OK);
...
...
case MOS1_CAPGB:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgb);
/* add overlap capacitance */
value->rValue += (here->sMOS1modPtr->MOS1gateBulkOverlapCapFactor)
* here->MOS1m
* (here->MOS1l
-2*(here->sMOS1modPtr->MOS1latDiff));
return(OK);
@end example
@subsection Level 2 MOS Model
Level 2 mosfet model now accetps the "M" instance parameter (multiplicity)
to simulate M paralleled identical devices. The affected quantities are:
@itemize @bullet
@item In the AC load routine (@code{MOS2acLoad()}, the value assigned
to the "M" (@code{MOS2m}) parameter, multiplies the overlap
capacitance: @code{ GateSourceOverlapCap}, @code{ GateDrainOverlapCap},
@code{ GateBulkOverlapCap}.
@item In the @code{MOS2ask()} routine (instance parameters reporting) the
gate-source, gate-drain and gate-bulk capacitances, corresponding
to @code{MOS2_CAPGS}, @code{MOS2_CAPGD}, @code{MOS2_CAPGB}
parameters, are multiplied by the value of "M".
@item In the @code{MOS2dset()} function (distortion analysis setup)
the overlap capcitances (@code{GateSourceOverlapCap},
@code{GateDrainOverlapCap}, @code{GateBulkOverlapCap}),
the saturation currents (@code{DrainSatCurr}, @code{SourceSatCurr}),
the "beta" (@code{Beta}), the oxide capacitance (@code{OxideCap})
and and the @code{xn} quantity are all mutiplied by the value
of "M".
@item In the main load routine @code{MOS2load()}, the value of "M"
parameter multiplies:@code{DrainSatCurr}, @code{SourceSatCurr},
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}, @code{Beta}, @code{OxideCap},
@code{xn}. The meaning of the variables have been already
explained above.
@item In the noise analysis routine @code{MOS2noi()}, the noise
densities, contained in the @code{noizDEns[]} vector are
multplied by the value of "M".
@item In the load routine for Pole-Zero analysis (@code{MOS2pzLoad()}),
the following quantities are multiplied by the value of "M":
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}.
@item In @code{MOS2temp()} routine the source and drain critical
voltages (@code{MOS2sourceVcrit}, @code{MOS2drainVcrit})
are multiplied by the value of "M", like the zero-voltage
bulk-drain and bulk-source capacitances: @code{czbd},
@code{czbdsw}, @code{czbs}, @code{czbssw}, where "sw" suffix
stands for "sidewall" and means perimetral capacitances and
the drain and sources conductances (@code{MOS2drainConductance},
@code{MOS2sourceConductance}).
@end itemize
Other minor changes for "M" parameter support includes: @code{MOS2sprt()}
prints the value of "M", @code{MOS2param()} sets the value of "M" and
@code{MOS2ask()} returns that value.
The "Gmin" implementation across the substrate diodes of MOS2 was incorrect,
correcting this dramatically improved DC convergence. The original code in
@code{MOS2load()} was:
@example
...
...
/* bulk-source and bulk-drain diodes
* here we just evaluate the ideal diode current and the
* corresponding derivative (conductance).
*/
next1: if(vbs <= 0) @{
here->MOS2gbs = SourceSatCur/vt;
here->MOS2cbs = here->MOS2gbs*vbs;
here->MOS2gbs += ckt->CKTgmin;
@} else @{
evbs = exp(vbs/vt);
here->MOS2gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS2cbs = SourceSatCur * (evbs-1);
@}
if(vbd <= 0) @{
here->MOS2gbd = DrainSatCur/vt;
here->MOS2cbd = here->MOS2gbd *vbd;
here->MOS2gbd += ckt->CKTgmin;
@} else @{
evbd = exp(vbd/vt);
here->MOS2gbd = DrainSatCur*evbd/vt +ckt->CKTgmin;
here->MOS2cbd = DrainSatCur *(evbd-1);
@}
...
...
@end example
Then new code is:
@example
...
...
/* bulk-source and bulk-drain diodes
* here we just evaluate the ideal diode current and the
* corresponding derivative (conductance).
*/
next1: if(vbs <= -3*vt) @{
here->MOS2gbs = ckt->CKTgmin;
here->MOS2cbs = here->MOS2gbs*vbs-SourceSatCur;
@} else @{
evbs = exp(MIN(MAX_EXP_ARG,vbs/vt));
here->MOS2gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS2cbs = SourceSatCur*(evbs-1) + ckt->CKTgmin*vbs;
@}
if(vbd <= -3*vt) @{
here->MOS2gbd = ckt->CKTgmin;
here->MOS2cbd = here->MOS2gbd*vbd-DrainSatCur;
@} else @{
evbd = exp(MIN(MAX_EXP_ARG,vbd/vt));
here->MOS2gbd = DrainSatCur*evbd/vt + ckt->CKTgmin;
here->MOS2cbd = DrainSatCur*(evbd-1) + ckt->CKTgmin*vbd;
@}
@end example
In the "load current vector" section of the @code{MOS2load()} routine,
"Gmin" appeared in the calculation of @code{ceqbd} and @code{ceqbs}:
@example
...
...
/*
* load current vector
*/
ceqbs = model->MOS2type *
(here->MOS2cbs-(here->MOS2gbs-ckt->CKTgmin)*vbs);
ceqbd = model->MOS2type *
(here->MOS2cbd-(here->MOS2gbd-ckt->CKTgmin)*vbd);
...
...
@end example
The correct code is:
@example
...
...
/*
* load current vector
*/
ceqbs = model->MOS2type *
(here->MOS2cbs-(here->MOS2gbs)*vbs);
ceqbd = model->MOS2type *
(here->MOS2cbd-(here->MOS2gbd)*vbd);
...
...
@end example
MOS2 device reported only half of the Meyer capacitance without adding the
overlap capacitance contribution, when reporting to the @code{.OP} printout
or in the rawfile. The routine @code{MOS2ask()} was responsible for this:
@example
...
...
case MOS2_CGS:
value->rValue = *(ckt->CKTstate0 + here->MOS2capgs);
return(OK);
case MOS2_CGD:
value->rValue = *(ckt->CKTstate0 + here->MOS2capgd);
return(OK);
...
...
case MOS2_CAPGS:
value->rValue = *(ckt->CKTstate0 + here->MOS2capgs);
return(OK);
...
...
case MOS2_CAPGD:
value->rValue = *(ckt->CKTstate0 + here->MOS2capgd);
return(OK);
...
...
case MOS2_CAPGB:
value->rValue = *(ckt->CKTstate0 + here->MOS2capgb);
return(OK);
...
...
@end example
The new code is:
@example
...
...
case MOS2_CGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgs);
return(OK);
case MOS2_CGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgd);
return(OK);
...
...
case MOS2_CAPGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgs);
/* add overlap capacitance */
value->rValue +=
(here->MOS2modPtr->MOS2gateSourceOverlapCapFactor)
* here->MOS2m
* (here->MOS2w);
return(OK);
...
...
case MOS2_CAPGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgd);
/* add overlap capacitance */
value->rValue +=
(here->MOS2modPtr->MOS2gateSourceOverlapCapFactor)
* here->MOS2m
* (here->MOS2w);
return(OK);
...
...
case MOS2_CAPGB:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgb);
/* add overlap capacitance */
value->rValue +=
(here->MOS2modPtr->MOS2gateBulkOverlapCapFactor)
* here->MOS2m
* (here->MOS2l
-2*(here->MOS2modPtr->MOS2latDiff));
return(OK);
...
...
@end example
The level 2 MOSFET model seems to calculate Von and Vth values for the
threshold and subthreshold values respectively, but then uses Vbin to
calculate the Vdsat voltage used to find the drain current. However, a
jump statement uses Von to decide that the device is in the "cutoff"
region, which means that when this jump allows the drain current to be
calculated, Vdsat can already be well above zero. This leads to a
discontinuity of drain current with respect to gate voltage. The code
is now modified to use Vbin for the jump decision. It looks like the
code should actually use Vth as the threshold voltage, but since other
SPICE simulators follow the original Berkeley code, this was
left alone. The affected code can be found in @code{MOS2load()}:
@example
...
...
if ((lvds-lvbs) >= 0) @{
barg = sqrt(phiMinVbs+lvds);
dbrgdb = -0.5/barg;
...
...
vgst = lvgs-von;
if (lvgs <= von) @{
/*
* cutoff region
*/
...
...
if (lvgs > von) goto line900;
/*
* subthreshold region
*/
...
...
@end example
and the corrected code is:
@example
...
...
if ((lvbs-lvds) <= 0) @{
barg = sqrt(phiMinVbs+lvds);
dbrgdb = -0.5/barg;
...
...
vgst = lvgs-von;
if (lvgs <= vbin) @{
/*
* cutoff region
*/
...
...
if (model->MOS2fastSurfaceStateDensity != 0
&& OxideCap != 0) @{
if (lvgs > von) goto line900;
@} else @{
if (lvgs > vbin) goto line900;
goto doneval;
@}
/*
* subthreshold region
*/
...
...
@end example
@subsection Level 3 Mos Model
The level 3 model has been extensively corrected since it is a
de-facto standard for circuit simulation.
The level 3 model supports the "M" parameter (multiplicity), which
can be used to simulate M identical paralleled devices. The "M"
parameter affects the quantities described in the following list:
@itemize @bullet
@item In the AC load routine (@code{MOS3acld()}, the value assigned
to the "M" (@code{MOS3m}) parameter, multiplies the overlap
capacitance: @code{ GateSourceOverlapCap}, @code{ GateDrainOverlapCap},
@code{ GateBulkOverlapCap}.
@item In the @code{MOS3ask()} function (instance parameters reporting) the
gate-source, gate-drain and gate-bulk capacitances, corresponding
to @code{MOS3_CAPGS}, @code{MOS3_CAPGD}, @code{MOS3_CAPGB}
parameters, are multiplied by the value of "M".
@item In the @code{MOS3dset()} function (distorsion analysis setup)
the overlap capcitances (@code{GateSourceOverlapCap},
@code{GateDrainOverlapCap}, @code{GateBulkOverlapCap}),
the saturation currents (@code{DrainSatCurr}, @code{SourceSatCurr}),
the "beta" (@code{Beta}), the oxide capacitance (@code{OxideCap})
and and the @code{csonco} quantity are all mutiplied by the value
of "M".
@item In the main load routine @code{MOS3load()}, the value of "M"
parameter multiplies:@code{DrainSatCurr}, @code{SourceSatCurr},
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}, @code{Beta}, @code{OxideCap},
@code{csonco}. The meaning of the variables have been already
explained above.
@item In the noise analysis routine @code{MOS3noi()}, the noise
densities, contained in the @code{noizDEns[]} vector are
multplied by the value of "M".
@item In the load routine for Pole-Zero analysis (@code{MOS3pzLoad()}),
the following quantities are multiplied by the value of "M":
@code{GateSourceOverlapCap}, @code{GateDrainOverlapCap},
@code{GateBulkOverlapCap}.
@item In @code{MOS3temp()} routine the source and drain critical
voltages (@code{MOS3sourceVcrit}, @code{MOS3drainVcrit})
are multiplied by the value of "M", like the zero-voltage
bulk-drain and bulk-source capacitances: @code{czbd},
@code{czbdsw}, @code{czbs}, @code{czbssw}, where "sw" suffix
stands for "sidewall" and means perimetral capacitances and
the drain and sources conductances (@code{MOS3drainConductance},
@code{MOS3sourceConductance}).
@end itemize
Other minor changes for "M" parameter support includes: @code{MOS3sprt()}
prints the value of "M", @code{MOS3param()} sets the value of "M" and
@code{MOS3ask()} returns that value.
Another important improvement over the original Spice3 code is the
support for process narrowing over drawn dimensions. The three model
parameters added to level 3 model are: @code{xl}, @code{wd}, @code{xw}.
The changes in the code are described in depth as a reference for
future model development.
Adding new model parameters usually need the introduction of new
variables (one for each parameter) in the model structure:
@code{sMOS3model}, which can be found in @file{mos3defs.h}. In this
case the new variables are:
@example
...
...
double MOS3lengthAdjust; /* New param: mask adjustment to length */
double MOS3widthNarrow; /* New param to reduce effective width */
double MOS3widthAdjust; /* New param: mask adjustment to width */
...
...
unsigned MOS3lengthAdjustGiven :1;
unsigned MOS3widthNarrowGiven :1;
unsigned MOS3widthAdjustGiven :1;
...
...
#define MOS3_MOD_XL 145
#define MOS3_MOD_WD 146
#define MOS3_MOD_XW 147
...
...
@end example
The single bit field that ends in "Given" are used to indicate
whether the parameter has been supplied by the user or must be
defaulted.
The last three @code{#define} are needed as a mean to identify the
parameters throughout the model, since comparing integers is faster
than comparing stings. As you may have already imagined, those
numbers must be unique. The association between parameter name and
numerical code appears in @code{MOS3mPTable[]} in @file{mos3.c}:
@example
...
...
IFparm MOS3mPTable[] = @{ /* model parameters */
OP("type", MOS3_MOD_TYPE, IF_STRING ,"N-channel or P-channel MOS"),
IP("nmos", MOS3_MOD_NMOS, IF_FLAG ,"N type MOSfet model"),
IP("pmos", MOS3_MOD_PMOS, IF_FLAG ,"P type MOSfet model"),
...
...
IOP("xl", MOS3_MOD_XL, IF_REAL ,"Length mask adjustment"),
IOP("wd", MOS3_MOD_WD, IF_REAL ,"Width Narrowing (Diffusion)"),
IOP("xw", MOS3_MOD_XW, IF_REAL ,"Width mask adjustment"),
...
...
@end example
The keyword @code{IOP} before the three parameters sets them as
input/output parameters (that can be set and queried). The function
used to set parameters values is @code{MOS3mParam()}, which contains
the following code:
@example
...
...
case MOS3_MOD_XL:
model->MOS3lengthAdjust = value->rValue;
model->MOS3lengthAdjustGiven = TRUE;
break;
case MOS3_MOD_WD:
model->MOS3widthNarrow = value->rValue;
model->MOS3widthNarrowGiven = TRUE;
break;
case MOS3_MOD_XW:
model->MOS3widthAdjust = value->rValue;
model->MOS3widthAdjustGiven = TRUE;
break;
...
...
@end example
The function used to query those parameters is @code{MOS3mAsk()} and
the specific code is:
@example
...
...
case MOS3_MOD_XL:
value->rValue = here->MOS3lengthAdjust;
return(OK);
case MOS3_MOD_WD:
value->rValue = here->MOS3widthNarrow;
return(OK);
case MOS3_MOD_XW:
value->rValue = here->MOS3widthAdjust;
return(OK);
...
...
@end example
The code above describes the interface to the new parameters, their
influence on the model behaviour is contained in the following
functions: @code{MOS3acLoad()}, @code{MOS3load()}, @code{MOS3noise()},
@code{MOS3pzLoad()}, @code{MOS3setup()}, @code{MOS3sLoad()} and
@code{MOS3temp()}.
The @code{MOS3acLoad()} function contains the code used to represent
the model for AC (small signal) analysis. The original code was:
@example
...
...
EffectiveLength=here->MOS3l - 2*model->MOS3latDiff;
GateSourceOverlapCap = model->MOS3gateSourceOverlapCapFactor *
here->MOS3w;
GateDrainOverlapCap = model->MOS3gateDrainOverlapCapFactor *
here->MOS3w;
GateBulkOverlapCap = model->MOS3gateBulkOverlapCapFactor *
EffectiveLength;
...
...
@end example
And the new one:
@example
...
...
double EffectiveWidth;
...
...
EffectiveWidth = here->MOS3w - 2*model->MOS3widthNarrow
+ model->MOS3widthAdjust;
EffectiveLength = here->MOS3l - 2*model->MOS3latDiff
+ model->MOS3lengthAdjust;
GateSourceOverlapCap = model->MOS3gateSourceOverlapCapFactor *
here->MOS3m * EffectiveWidth;
GateDrainOverlapCap = model->MOS3gateDrainOverlapCapFactor *
here->MOS3m * EffectiveWidth;
GateBulkOverlapCap = model->MOS3gateBulkOverlapCapFactor *
here->MOS3m * EffectiveLength;
...
...
@end example
A brief look at the new code shows that a new variable
@code{EffectiveWidth} appears and its value depends on the
newly introduced parameters @code{wd} and @code{xw}, through
@code{MOS3widthNarrow} and @code{MOS3widthAdjust}, respectively.
The values of @code{EffectiveLength} is trimmed with the value of
@code{xl} through @code{MOS3lengthAdjust}. The overlap capacitances
are multiplied by @code{EffectiveWidth} instead of @code{MOS3w}. The
@code{MOS3m} value has been discussed above.
The @code{MOS3pzLoad()} function is very similar to @code{MOS3acLoad()}
and the code affected is almost identical to the one above.
The @code{MOS3load()} function describes the model for large signals
analyses. The old code is:
@example
...
...
EffectiveLength = here->MOS3l - 2*model->MOS3latDiff;
if( (here->MOS3tSatCurDens == 0)
|| (here->MOS3drainArea == 0)
|| (here->MOS3sourceArea == 0)) @{
DrainSatCur = here->MOS3tSatCur;
SourceSatCur = here->MOS3tSatCur;
@} else @{
DrainSatCur = here->MOS3tSatCurDens *
here->MOS3drainArea;
SourceSatCur = here->MOS3tSatCurDens *
here->MOS3sourceArea;
@}
GateSourceOverlapCap = model->MOS3gateSourceOverlapCapFactor
* here->MOS3w;
GateDrainOverlapCap = model->MOS3gateDrainOverlapCapFactor
* here->MOS3w;
GateBulkOverlapCap = model->MOS3gateBulkOverlapCapFactor
* EffectiveLength;
Beta = here->MOS3tTransconductance * here->MOS3w/EffectiveLength;
OxideCap = model->MOS3oxideCapFactor * EffectiveLength
* here->MOS3w;
...
...
/*
*.....body effect
*/
gammas = model->MOS3gamma*fshort;
fbodys = 0.5*gammas/(sqphbs+sqphbs);
fbody = fbodys+model->MOS3narrowFactor/here->MOS3w;
onfbdy = 1.0/(1.0+fbody);
dfbdvb = -fbodys*dsqdvb/sqphbs+fbodys*dfsdvb/fshort;
qbonco =gammas*sqphbs+model->MOS3narrowFactor*phibs/here->MOS3w;
dqbdvb = gammas*dsqdvb+model->MOS3gamma*dfsdvb*sqphbs-
model->MOS3narrowFactor/here->MOS3w;
...
...
/*
*.....joint weak inversion and strong inversion
*/
von = vth;
if ( model->MOS3fastSurfaceStateDensity != 0.0 ) @{
csonco = CHARGE*model->MOS3fastSurfaceStateDensity
* 1e4 /*(cm**2/m**2)*/
* EffectiveLength*here->MOS3w/OxideCap;
...
...
@end example
And the new code is:
@example
...
...
double EffectiveWidth;
...
...
EffectiveWidth = here->MOS3w - 2*model->MOS3widthNarrow
+ model->MOS3widthAdjust;
EffectiveLength = here->MOS3l - 2*model->MOS3latDiff
+ model->MOS3lengthAdjust;
if( (here->MOS3tSatCurDens == 0)
|| (here->MOS3drainArea == 0)
|| (here->MOS3sourceArea == 0)) @{
DrainSatCur = here->MOS3m * here->MOS3tSatCur;
SourceSatCur = here->MOS3m * here->MOS3tSatCur;
@} else @{
DrainSatCur = here->MOS3m * here->MOS3tSatCurDens
* here->MOS3drainArea;
SourceSatCur = here->MOS3m * here->MOS3tSatCurDens
* here->MOS3sourceArea;
@}
GateSourceOverlapCap = model->MOS3gateSourceOverlapCapFactor
* here->MOS3m * EffectiveWidth;
GateDrainOverlapCap = model->MOS3gateDrainOverlapCapFactor
* here->MOS3m * EffectiveWidth;
GateBulkOverlapCap = model->MOS3gateBulkOverlapCapFactor
* here->MOS3m * EffectiveLength;
Beta = here->MOS3tTransconductance
* here->MOS3m * EffectiveWidth/EffectiveLength;
OxideCap = model->MOS3oxideCapFactor * EffectiveLength
* here->MOS3m * EffectiveWidth;
...
...
/*
*.....body effect
*/
gammas = model->MOS3gamma*fshort;
fbodys = 0.5*gammas/(sqphbs+sqphbs);
fbody = fbodys+model->MOS3narrowFactor/EffectiveWidth;
onfbdy = 1.0/(1.0+fbody);
dfbdvb = -fbodys*dsqdvb/sqphbs+fbodys*dfsdvb/fshort;
qbonco = gammas*sqphbs+model->MOS3narrowFactor
* phibs/EffectiveWidth;
dqbdvb = gammas*dsqdvb+model->MOS3gamma*dfsdvb*sqphbs
- model->MOS3narrowFactor/EffectiveWidth;
...
...
/*
*.....joint weak inversion and strong inversion
*/
von = vth;
if ( model->MOS3fastSurfaceStateDensity != 0.0 ) @{
csonco = CHARGE * model->MOS3fastSurfaceStateDensity *
1e4 /*(cm**2/m**2)*/
* EffectiveLength*EffectiveWidth
* here->MOS3m/OxideCap;
...
...
@end example
The "trick" is to substitute the @code{MOS3w} with the effective
width taking into account device multiplicity. Another point
where device width matters is the noise routine:@code{MOS3noise()}.
The oginal code computes noise densities as follows:
@example
...
...
noizDens[MOS3FLNOIZ] *= model->MOS3fNcoef *
exp(model->MOS3fNexp *
log(MAX(FABS(inst->MOS3cd),N_MINLOG))) /
(data->freq * inst->MOS3w *
(inst->MOS3l - 2*model->MOS3latDiff) *
model->MOS3oxideCapFactor * model->MOS3oxideCapFactor);
...
...
@end example
The new code adds width narrowing and and multiplicity:
@example
...
...
noizDens[MOS3FLNOIZ] *= model->MOS3fNcoef *
exp(model->MOS3fNexp *
log(MAX(FABS(inst->MOS3cd),N_MINLOG))) /
(data->freq *
(inst->MOS3w - 2*model->MOS3widthNarrow) *
inst->MOS3m *
(inst->MOS3l - 2*model->MOS3latDiff) *
model->MOS3oxideCapFactor * model->MOS3oxideCapFactor);
...
...
@end example
Another place in the code that needs changes is the device setup
routine @code{MOS3setup()}. The followig code adds support for
the new parameters:
@example
...
...
if(!model->MOS3lengthAdjustGiven) @{
model->MOS3lengthAdjust = 0;
@}
if(!model->MOS3widthNarrowGiven) @{
model->MOS3widthNarrow = 0;
@}
if(!model->MOS3widthAdjustGiven) @{
model->MOS3widthAdjust = 0;
@}
...
...
@end example
This code sets up the default values when the parameters are not
supplied by the user (since they are optional).
Another function modified to support the new parameters is the
@code{MOS3temp()}. The old code is:
@example
if(here->MOS3l - 2 * model->MOS3latDiff <=0) @{
SPfrontEnd->IFerror (ERR_FATAL,
"%s: effective channel length less than zero",
&(here->MOS3name));
return(E_BADPARM);
@}
@end example
And the new one:
@example
...
...
if(here->MOS3l - 2 * model->MOS3latDiff +
model->MOS3lengthAdjust <1e-6) @{
SPfrontEnd->IFerror (ERR_FATAL,
"%s: effective channel length less than zero",
&(here->MOS3name));
return(E_PARMVAL);
@}
if(here->MOS3w - 2 * model->MOS3widthNarrow +
model->MOS3widthAdjust <1e-6) @{
SPfrontEnd->IFerror (ERR_FATAL,
"%s: effective channel width less than zero",
&(here->MOS3name));
return(E_PARMVAL);
@}
...
...
@end example
The changes add a check over device width that was not present in the
original code and rise an error if the result is less than one micrometer,
while the old code checked against zero.
The last (but not least) function that needed some care is the
sensitivity load routine: @code{MOS3sLoad()}. The original code was:
@example
...
...
EffectiveLength = here->MOS3l
- 2*model->MOS3latDiff;
if(EffectiveLength == 0) @{
DqgsDp = 0;
DqgdDp = 0;
DqgbDp = 0;
@}
else @{
DqgsDp = model->MOS3type * qgs0 / EffectiveLength;
DqgdDp = model->MOS3type * qgd0 / EffectiveLength;
DqgbDp = model->MOS3type * qgb0 / EffectiveLength;
@}
@}
else @{
DqgsDp = model->MOS3type * qgs0 / here->MOS3w;
DqgdDp = model->MOS3type * qgd0 / here->MOS3w;
DqgbDp = model->MOS3type * qgb0 / here->MOS3w;
@}
...
...
@end example
And the modified code is:
@example
...
...
double EffectiveWidth;
...
...
EffectiveLength = here->MOS3l
- 2*model->MOS3latDiff + model->MOS3lengthAdjust;
if(EffectiveLength == 0) @{
DqgsDp = 0;
DqgdDp = 0;
DqgbDp = 0;
@}
else @{
DqgsDp = model->MOS3type * qgs0 / EffectiveLength;
DqgdDp = model->MOS3type * qgd0 / EffectiveLength;
DqgbDp = model->MOS3type * qgb0 / EffectiveLength;
@}
@}
else @{
EffectiveWidth = here->MOS3w
- 2*model->MOS3widthNarrow + model->MOS3widthAdjust;
DqgsDp = model->MOS3type * qgs0 / EffectiveWidth;
DqgdDp = model->MOS3type * qgd0 / EffectiveWidth;
DqgbDp = model->MOS3type * qgb0 / EffectiveWidth;
@}
...
...
@end example
There was an error in the original implementation that did not take into
account lateral diffusion @code{MOS3LatDiff}. The other changes take
into account the effective (against drawn) device width.
That's all folks! The changes needed to support the new parameters
are (shortly and badly) described. This section on MOS3 continues with
other fixes.
MOS3 device reported only half of the Meyer capacitance without adding the
overlap capacitance contribution, when reporting to the @code{.OP} printout
or in the rawfile. The routine @code{MOS3ask()} was responsible for this:
@example
...
...
case MOS3_CGS:
value->rValue = *(ckt->CKTstate0 + here->MOS3capgs);
return(OK);
case MOS3_CGD:
value->rValue = *(ckt->CKTstate0 + here->MOS3capgd);
return(OK);
...
...
case MOS3_CAPGS:
value->rValue = *(ckt->CKTstate0 + here->MOS3capgs);
return(OK);
...
...
case MOS3_CAPGD:
value->rValue = *(ckt->CKTstate0 + here->MOS3capgd);
return(OK);
...
...
case MOS3_CAPGB:
value->rValue = *(ckt->CKTstate0 + here->MOS3capgb);
return(OK);
...
...
@end example
The new code is:
@example
...
...
case MOS3_CGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgs);
return(OK);
case MOS3_CGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgd);
return(OK);
...
...
case MOS3_CAPGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgs);
/* add overlap capacitance */
value->rValue +=
(here->MOS3modPtr->MOS3gateSourceOverlapCapFactor)
* here->MOS3m
* (here->MOS3w
+here->MOS3modPtr->MOS3widthAdjust
-2*(here->MOS3modPtr->MOS3widthNarrow));
return(OK);
...
...
case MOS3_CAPGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgd);
/* add overlap capacitance */
value->rValue +=
(here->MOS3modPtr->MOS3gateDrainOverlapCapFactor)
* here->MOS3m
* (here->MOS3w
+here->MOS3modPtr->MOS3widthAdjust
-2*(here->MOS3modPtr->MOS3widthNarrow));
return(OK);
...
...
case MOS3_CAPGB:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgb);
/* add overlap capacitance */
value->rValue +=
(here->MOS3modPtr->MOS3gateBulkOverlapCapFactor)
* here->MOS3m
* (here->MOS3l
+here->MOS3modPtr->MOS3lengthAdjust
-2*(here->MOS3modPtr->MOS3latDiff));
return(OK);
...
...
@end example
The "Gmin" implementation across the substrate diodes of MOS3 was incorrect,
correcting this dramatically improved DC convergence. The original code in
@code{MOS3load()} was:
@example
/*
* bulk-source and bulk-drain diodes
* here we just evaluate the ideal diode current and the
* corresponding derivative (conductance).
*/
next1: if(vbs <= 0) @{
here->MOS3gbs = SourceSatCur/vt;
here->MOS3cbs = here->MOS3gbs*vbs;
here->MOS3gbs += ckt->CKTgmin;
@} else @{
evbs = exp(MIN(MAX_EXP_ARG,vbs/vt));
here->MOS3gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS3cbs = SourceSatCur * (evbs-1);
@}
if(vbd <= 0) @{
here->MOS3gbd = DrainSatCur/vt;
here->MOS3cbd = here->MOS3gbd *vbd;
here->MOS3gbd += ckt->CKTgmin;
@} else @{
evbd = exp(MIN(MAX_EXP_ARG,vbd/vt));
here->MOS3gbd = DrainSatCur*evbd/vt +ckt->CKTgmin;
here->MOS3cbd = DrainSatCur *(evbd-1);
@}
@end example
The new corrected code is:
@example
/*
* bulk-source and bulk-drain diodes
* here we just evaluate the ideal diode current and the
* corresponding derivative (conductance).
*/
next1: if(vbs <= -3*vt) @{
here->MOS3gbs = ckt->CKTgmin;
here->MOS3cbs = here->MOS3gbs*vbs-SourceSatCur;
@} else @{
evbs = exp(MIN(MAX_EXP_ARG,vbs/vt));
here->MOS3gbs = SourceSatCur*evbs/vt + ckt->CKTgmin;
here->MOS3cbs = SourceSatCur*(evbs-1) + ckt->CKTgmin*vbs;
@}
if(vbd <= -3*vt) @{
here->MOS3gbd = ckt->CKTgmin;
here->MOS3cbd = here->MOS3gbd*vbd-DrainSatCur;
@} else @{
evbd = exp(MIN(MAX_EXP_ARG,vbd/vt));
here->MOS3gbd = DrainSatCur*evbd/vt + ckt->CKTgmin;
here->MOS3cbd = DrainSatCur*(evbd-1) + ckt->CKTgmin*vbd;
@}
@end example
In the "load current vector" section of the @code{MOS3load()} routine,
"Gmin" appeared in the calculation of @code{ceqbd} and @code{ceqbs}:
@example
/*
* load current vector
*/
ceqbs = model->MOS3type *
(here->MOS3cbs-(here->MOS3gbs-ckt->CKTgmin)*vbs);
ceqbd = model->MOS3type *
(here->MOS3cbd-(here->MOS3gbd-ckt->CKTgmin)*vbd);
@end example
The new code is:
@example
/*
* load current vector
*/
ceqbs = model->MOS3type *
(here->MOS3cbs-(here->MOS3gbs)*vbs);
ceqbd = model->MOS3type *
(here->MOS3cbd-(here->MOS3gbd)*vbd);
@end example
The gm, gmb and gs calculations in them MOS3 model (in @code{MOD3load()}
were all wrong:
@example
...
...
/*
*.....normalized drain current
*/
cdnorm = cdo*vdsx;
here->MOS3gm = vdsx;
here->MOS3gds = vgsx-vth-(1.0+fbody+dvtdvd)*vdsx;
here->MOS3gmbs = dcodvb*vdsx;
/*
*.....drain current without velocity saturation effect
*/
cd1 = Beta*cdnorm;
Beta = Beta*fgate;
cdrain = Beta*cdnorm;
here->MOS3gm = Beta*here->MOS3gm+dfgdvg*cd1;
here->MOS3gds = Beta*here->MOS3gds+dfgdvd*cd1;
here->MOS3gmbs = Beta*here->MOS3gmbs;
...
...
cdrain = cdrain*xlfact;
diddl = cdrain/(EffectiveLength-delxl);
here->MOS3gm = here->MOS3gm*xlfact+diddl*ddldvg;
gds0 = here->MOS3gds*xlfact+diddl*ddldvd;
here->MOS3gmbs = here->MOS3gmbs*xlfact+diddl*ddldvb;
here->MOS3gm = here->MOS3gm+gds0*dvsdvg;
here->MOS3gmbs = here->MOS3gmbs+gds0*dvsdvb;
here->MOS3gds = gds0*dvsdvd+diddl*dldvd;
...
...
@end example
The code has been corrected as follows leading to much improved
convergence:
@example
...
...
/*
*.....normalized drain current
*/
cdnorm = cdo*vdsx;
here->MOS3gm = vdsx;
if ((here->MOS3mode*vds) > vdsat) here->MOS3gds = -dvtdvd*vdsx;
else here->MOS3gds = vgsx-vth-(1.0+fbody+dvtdvd)*vdsx;
here->MOS3gmbs = dcodvb*vdsx;
/*
*.....drain current without velocity saturation effect
*/
cd1 = Beta*cdnorm;
Beta = Beta*fgate;
cdrain = Beta*cdnorm;
here->MOS3gm = Beta*here->MOS3gm+dfgdvg*cd1;
here->MOS3gds = Beta*here->MOS3gds+dfgdvd*cd1;
here->MOS3gmbs = Beta*here->MOS3gmbs+dfgdvb*cd1;
...
...
cd1 = cdrain;
cdrain = cdrain*xlfact;
diddl = cdrain/(EffectiveLength-delxl);
here->MOS3gm = here->MOS3gm*xlfact+diddl*ddldvg;
here->MOS3gmbs = here->MOS3gmbs*xlfact+diddl*ddldvb;
gds0 = diddl*ddldvd;
here->MOS3gm = here->MOS3gm+gds0*dvsdvg;
here->MOS3gmbs = here->MOS3gmbs+gds0*dvsdvb;
here->MOS3gds = here->MOS3gds*xlfact+diddl*dldvd+gds0*dvsdvd;
/*
here->MOS3gds = (here->MOS3gds*xlfact)+gds0*dvsdvd-
(cd1*ddldvd/(EffectiveLength*(1-2*dlonxl+dlonxl*dlonxl)));
*/
...
...
@end example
The Spice3 "fix" for the MOS3 gds discontinuity between the linear
and saturated regions works only if VMAX parameter is set to a
non-zero value. A tweak has been added for the zero case. The Spice3
code (in @code{MOS3load()}) was:
@example
...
...
/*
*.....velocity saturation factor
*/
if ( model->MOS3maxDriftVel != 0.0 ) @{
fdrain = 1.0/(1.0+vdsx*onvdsc);
fd2 = fdrain*fdrain;
arga = fd2*vdsx*onvdsc*onfg;
dfddvg = -dfgdvg*arga;
dfddvd = -dfgdvd*arga-fd2*onvdsc;
dfddvb = -dfgdvb*arga;
...
...
@end example
The code in NGSPICE is:
@example
...
...
/*
*.....velocity saturation factor
*/
if ( model->MOS3maxDriftVel > 0.0 ) @{
fdrain = 1.0/(1.0+vdsx*onvdsc);
fd2 = fdrain*fdrain;
arga = fd2*vdsx*onvdsc*onfg;
dfddvg = -dfgdvg*arga;
if ((here->MOS3mode*vds) > vdsat) dfddvd = -dfgdvd*arga;
else dfddvd = -dfgdvd*arga-fd2*onvdsc;
dfddvb = -dfgdvb*arga;
...
...
@end example
The critical voltages in @code{MOS3Temp()} were calculated without
using temperature corrected saturation current:
@example
...
...
vt*log(vt/(CONSTroot2*model->MOS3jctSatCur));
@} else @{
here->MOS3drainVcrit =
vt * log( vt / (CONSTroot2 *
model->MOS3jctSatCurDensity * here->MOS3drainArea));
here->MOS3sourceVcrit =
vt * log( vt / (CONSTroot2 *
model->MOS3jctSatCurDensity * here->MOS3sourceArea));
@}
...
...
@end example
This have been fixed as follows:
@example
...
...
vt*log(vt/(CONSTroot2*here->MOS3m*here->MOS3tSatCur));
@} else @{
here->MOS3drainVcrit =
vt * log( vt / (CONSTroot2 *
here->MOS3m *
here->MOS3tSatCurDens * here->MOS3drainArea));
here->MOS3sourceVcrit =
vt * log( vt / (CONSTroot2 *
here->MOS3m *
here->MOS3tSatCurDens * here->MOS3sourceArea));
@}
...
...
@end example
In @code{MOS3temp()} some parameters were computed without taking
into account temperature corrected parameters:
@example
...
...
here->MOS3f3d = czbd * model->MOS3bulkJctBotGradingCoeff
* sarg/ arg / model->MOS3bulkJctPotential
+ czbdsw * model->MOS3bulkJctSideGradingCoeff
* sargsw/ arg /model->MOS3bulkJctPotential;
here->MOS3f4d = czbd*model->MOS3bulkJctPotential*(1-arg*sarg)/
(1-model->MOS3bulkJctBotGradingCoeff)
+ czbdsw*model->MOS3bulkJctPotential*(1-arg*sargsw)/
(1-model->MOS3bulkJctSideGradingCoeff)
-here->MOS3f3d/2*
(here->MOS3tDepCap*here->MOS3tDepCap)
-here->MOS3tDepCap * here->MOS3f2d;
if(model->MOS3capBSGiven) @{
czbs=here->MOS3tCbs;
@} else @{
if(model->MOS3bulkCapFactorGiven) @{
czbs=here->MOS3tCj*here->MOS3sourceArea;
@} else @{
czbs=0;
@}
@}
...
...
here->MOS3f3s = czbs * model->MOS3bulkJctBotGradingCoeff
* sarg/ arg / model->MOS3bulkJctPotential
+ czbssw * model->MOS3bulkJctSideGradingCoeff
* sargsw/ arg / model->MOS3bulkJctPotential;
here->MOS3f4s = czbs*model->MOS3bulkJctPotential*(1-arg*sarg)/
(1-model->MOS3bulkJctBotGradingCoeff)
+ czbssw*model->MOS3bulkJctPotential*(1-arg*sargsw)/
(1-model->MOS3bulkJctSideGradingCoeff)
-here->MOS3f3s/2*
(here->MOS3tBulkPot*here->MOS3tBulkPot)
-here->MOS3tBulkPot * here->MOS3f2s;
@}
@}
...
...
@end example
The corrected code is:
@example
...
...
here->MOS3f3d = czbd * model->MOS3bulkJctBotGradingCoeff
* sarg/ arg / here->MOS3tBulkPot
+ czbdsw * model->MOS3bulkJctSideGradingCoeff
* sargsw/ arg / here->MOS3tBulkPot;
here->MOS3f4d = czbd*here->MOS3tBulkPot*(1-arg*sarg)/
(1-model->MOS3bulkJctBotGradingCoeff)
+ czbdsw*here->MOS3tBulkPot*(1-arg*sargsw)/
(1-model->MOS3bulkJctSideGradingCoeff)
-here->MOS3f3d/2*
(here->MOS3tDepCap*here->MOS3tDepCap)
-here->MOS3tDepCap * here->MOS3f2d;
if(model->MOS3capBSGiven) @{
czbs = here->MOS3tCbs * here->MOS3m;
@} else @{
if(model->MOS3bulkCapFactorGiven) @{
czbs=here->MOS3tCj*here->MOS3sourceArea * here->MOS3m;
@} else @{
czbs=0;
@}
@}
...
...
here->MOS3f3s = czbs * model->MOS3bulkJctBotGradingCoeff
* sarg/ arg / here->MOS3tBulkPot
+ czbssw * model->MOS3bulkJctSideGradingCoeff
* sargsw/ arg /here->MOS3tBulkPot;
here->MOS3f4s = czbs*here->MOS3tBulkPot*(1-arg*sarg)/
(1-model->MOS3bulkJctBotGradingCoeff)
+ czbssw*here->MOS3tBulkPot*(1-arg*sargsw)/
(1-model->MOS3bulkJctSideGradingCoeff)
-here->MOS3f3s/2*
(here->MOS3tDepCap*here->MOS3tDepCap)
-here->MOS3tDepCap * here->MOS3f2s;
@}
@}
@end example
@subsection switch model
@subsection current switch model
@subsection boh
@subsection PN diode voltage limiting
Spice3f voltage limiting across PN junctions did not perform limiting
on negative voltages, resulting in convergence problems. In NGSPICE
voltage limiting for PN diodes have been modified to work for negative
voltages too, improving convergence on calculations that rely on this
code.
@noindent
@sc{Enhancement Data:}
@table @asis
@item Author:
Alan Gillespie
@item File:
@file{spicelib/devices/devsup.c}
@item Function:
@code{DEVpnjlim()}
@item Affects:
All devices model that uses that function: @code{BJT1-2}, @code{BSIM3-4},
@code{DIO}, @code{EKV}, @code{HFET2}, @code{JFET1-2}, @code{MES},
@code{MESA}, @code{MOS1-9}.
@end table
@subsection FET voltage limiting
In NGSPICE the calculation of @var{vtstlo} is done according to the formula:
@example
vtstlo = fabs(vold - vto) + 1;
@end example
While in spice3f the formula was:
@example
vtstlo = vtsthi/2 + 2;
@end example
@noindent
@sc{Enhancement Data:}
@table @asis
@item Author:
Alan Gillespie
@item File:
@file{spicelib/devices/devsup.c}
@item Function:
@code{DEVfetlim()}
@item Affects:
All devices model that uses that function: @code{BSIM1-4},@code{HFET1-2},
@code{JFET1-2}, @code{MES}, @code{MESA}, @code{MOS1-9}, @code{STAG}, @code{EKV}.
@end table
@subsection Meyer model improvement
The calculation of active gate capacitance in @file{devsup.c} has been improved
to achieve better convergence.
@noindent
@sc{Enhacement Data:}
@table @asis
@item Author:
Alan Gillespie
@item File:
@file{spicelib/devices/devsup.c}
@item Function:
@code{DEVqmeyer()}
@item Affects:
All devices model that uses that function: @code{MOS1-9}.
@end table
@chapter The BSIM3 Model Integration
BSIM3 compact model is a de-facto standard in the circuit simulation world
and is extensively supported in the NGSPICE simulator. The original model
dates back to the end of 1995. After almost ten years, three major revisions
have been released by the Berkeley Device Group. NGSPICE supports all BSIM3
model revisions.
We dedicated an entire chapter to the BSIM3 model since the procedure
followed to integrate it into NGSPICE equally applies to other models
from Berkeley's Device Group like BSIM4 and BSIMSOI. Most of the content
of this chapter is devoted to the latest release of BSIM3 available at the
time of writing: version 3.2 and its minor revisions 3.2.2, 3.2.3 and 3.2.4.
It is trivial to apply the same concepts to the older ones (3.0 and 3.1).
The BSIM3 integration into NGSPICE is the result of the merging of three
different sources: the original Berkeley's code and two enhanced version, one
supplied by Alan Gillespie and the other by Serban Popescu. Both Alan and
Serban enhanced the basic model adding multiplicity support, though using two
different approaches. Serban added another enhancement, the "hdif" parameter.
NGSPICE provides Berkeley's, Alan's and Serban's models, using Alan's approach
fot multiplicity support in Berkeley's code.
@section BSIM3 Revisions
As previously said, due to the importance of BSIM3, NGSPICE includes all
its revisions. We have decide to assign different levels only to major
revisions and use the "version" model parameter to switch among minors.
The only exceptions to this rule are Serban's and Alan's model, they are
a special kind of BSIM3 version 3.1 and they are kept separate from the
Berkeley's model.
NGSPICE has five different levels for BSIM3:
@multitable @columnfractions .30 .30 .10 .30
@item Major Revision @tab Minor Revisions @tab Level @tab Notes
@item BSIM3v3.2 @tab 3.2, 3.2.2, 3.2.3, 3.2.4 @tab 8 @tab The latest release
@item BSIM3v1S @tab 3.1 @tab 49 @tab Serban's code
@item BSIM3v1 @tab 3.1 @tab 50 @tab Berkeley's code
@item BSIM3v1A @tab 3.1 @tab 51 @tab Alan's code
@item BSIM3v0 @tab 3.0 @tab 52 @tab Berkeley's code
@end multitable
As you may see from the table above, level 8, the one officially assigned
by Berkeley Device Group,is reserved to the most recent major revision of
the code. All BSIM3 models support the "m" parameter (multiplicity) but
only Serban's one has the support for "hdif".
@section The integration process
This section briefly describes how we integrated the BSIM3 model into
NGSPICE. The integration process of BSIM3 model started with the download
of the original code from Berkeley web site (device group). We devoted much
of the work on release 3.2 and backported changes to the older ones. Our
work on the BSIM model can be summarized in the following points:
@itemize @bullet
@item Restructuring code for spice3f interface.
@item Adding minor releases switches (where necessary).
@item Adding support for parallel simulation (CIDER).
@item Adding support for "m" parameter.
@item Restructuring code for NGSPICE integration.
@end itemize
The first item is a necessary step for older models, since the device
interface changed between spice3e (the original interface for BSIM3 model)
and spice3f and NGSPICE device interface is based on spice3f. Changes consists
is a shift in the position of @code{BSIM3states} in @file{bsim3def.h} and in
the addition of the @code{BSIM3unsetup()} function in @file{b3set.c}.
The next step is the inclusion of runtime switches to select code for the
different minor revisions that a release can have (well, this is necessary
only for release 3.2).
The result of the two steps is a multirevision BSIM3 model with a spice3f4/5
interface. Now we are ready to make the necessary enhancements and the changes
for integrating the model into NGSPICE.
The third and fourth items in the list are the model enhancements: the
"parallel simulation support" is a feature inherited from the CIDER simulator
(built on top of NGSPICE) that allow the simulator to use multiple processor
elements to evaluate device code (making the simulation faster). The parallel
simulation is not yet enabled in NGSPICE, but it will probably in the future. The
"parallelization" code basically consists in a series of switches that skip device
evaluation code if local processor (machine) has not been assigned to that
particular device instance.
Device "multiplicity" is a feature often found in commercial simulators, used to
simulate many identical devices connected in parallel. This feature is important
because reduces the number of nodes and equations in a circuit and makes the
netlist more readable.
Now we are ready to restructure the code to make it compatible with the NGSPICE
device interface, which is an extended version of the spice3f4/5 one.
@section The multirevision code
BSIM3 release 3.2 has three minor revisions: 3.2.2, 3.2.3 and 3.2.4. Reserving a
different level for each is not a good solution, it will be a waste of space and
memory. The four (including 3.2) revisions differs for a few lines of code only,
so the ideai is to merge the code and isolate revision dependent parts with
runtime switches (the @code{switch} statement). The modifications needed are minimal,
but some work is needed to avoid slow comparison between strings.
As written before, the magic of revision selection is done via the "version" model
parameter, which appears on the model card. In BSIM3 version 3.2 this parameter
is a floating point value, since earlier releases were 3.0 and 3.1 and was easy to
code revision into a real number. With the release of 3.2.2 it changed to a string,
for obvious reasons (3.2.2 is not a real number). Since the "version" parameter was
used only for model checking, that was not a problem. In the multirevision model,
comparisons based on it appears in the device evaluation code, where speed is critical,
so we added a parameter @code{BSIM3intVersion}, defined in @file{bsim3def.h} as follows:
@example
...
...
char *BSIM3version;
/* The following field is an integer coding
* of BSIM3version.
*/
int BSIM3intVersion;
#define BSIM3V324 324 /* BSIM3 V3.2.4 */
#define BSIM3V323 323 /* BSIM3 V3.2.3 */
#define BSIM3V322 322 /* BSIM3 V3.2.2 */
#define BSIM3V32 32 /* BSIM3 V3.2 */
#define BSIM3V3OLD 0 /* Old model */
double BSIM3tox;
...
...
@end example
The @code{BSIM3intVersion} will be used as argument to the @code{switch} statement,
because integer comparison is faster than string's one. The correct value of the
parameter is assigned in @code{BSIM3setup()} by the code below:
@example
...
...
/* If the user does not provide the model revision,
* we always choose the most recent.
*/
if (!model->BSIM3versionGiven)
model->BSIM3version = "3.2.4";
/* I have added below the code that translate model string
* into an integer. This trick is meant to speed up the
* revision testing instruction, since comparing integer
* is faster than comparing strings.
* Paolo Nenzi 2002
*/
if (!strcmp (model->BSIM3version, "3.2.4"))
model->BSIM3intVersion = BSIM3V324;
else if (!strcmp (model->BSIM3version, "3.2.3"))
model->BSIM3intVersion = BSIM3V323;
else if (!strcmp (model->BSIM3version, "3.2.2"))
model->BSIM3intVersion = BSIM3V322;
else if (!strcmp (model->BSIM3version, "3.2"))
model->BSIM3intVersion = BSIM3V32;
else
model->BSIM3intVersion = BSIM3V3OLD;
/* BSIM3V3OLD is a placeholder for pre 3.2 revision
* This model should not be used for pre 3.2 models.
*/
...
...
@end example
When we need to switch the code we use a @code{switch} statement
like the following:
@example
/* Added revision dependent code */
switch (model->BSIM3intVersion)
@{
case BSIM3V324:
/* BSIM3v3.2.4 specific code */
break;
case BSIM3V323:
/* BSIM3v3.2.3 specific code */
break;
case BSIM3V322:
/* BSIM3v3.2.2 specific code */
break;
case BSIM3V32:
/* BSIM3v3.2 specific code */
break;
default:
/* Old code */
@}
@end example
The differences between minor revision fall in two categories: modification in
the evaluation code and bug fixes. The idea followed in the merging was to
leave out of the revision dependent code what was a mere bug fix.
@section Device Multiplicity
Spice3 (and thus NGSPICE) uses an approach called MNA (Modified Nodal Analysis)
to solve electrical circuits. MNA represents an electrical circuits using a
matrix containing devices' conductances and constraint equations (if you
need to know more, get a good book on circuit theory). This matrix is built
by summing the contribution of each instance (another name for "element") in
the circuit. The contribution of each instance to the circuit matrix is called
a "matrix stamp", which is itself a matrix containing non zero elements only
at positions occupied by the device. It is very important to understand that
row and column index of the stamp must be consistent with the overall
circuit matrix, the elements of the stamp have the same indexes they will
have in the circuit matrix. Note that all stamps are each other independent,
and this property can be exploited to add parallelization to the simulator
(this is not new, CIDER uses this method).
All the code in the model (every spice3 model) is needed to build the matrix
stamp for that particular instance of the device and for the analysis type
requested.
If we add many (let's say "m") device in parallel, "m" identical stamp are
added to the circuit matrix. When we write "identical" we mean that the
stamps contain identical values but at different locations. Each device has
"external" and "internal" nodes, the former are connected to devices' terminals
and the latter are internal to the device. It should be clear that nodes
corresponding to terminals must have the same node number and the same indexes
in the matrix, since devices appear in parallel, while other must be different
because those nodes are private to each instance.
If we want to simulate "m" identical devices in parallel with a single instance,
its stamp must have an impact to the overall circuit matrix equal to the
"superposition" of the single instances' "m" stamps. The term "superposition" is
used instead of "sum" since we are interested in the external behaviour of the
parallel, not in its internals. The matrix stamp of the "multiple" device is a
stamp of a single device whose conductances are "adjusted" to represent the
parallel situation. Doing this we discard the internal complexity of the
single instance while leaving intact the influence of the parallel to the
circuit. Reducing the complexity affects simulation speed, which is increased
because there are less equations (not useful to our purposes) to solve and
imposes less stress to simulator algorithms, resulting in less convergence
problems.
We may say that a "multiple" device is an external representation of
many identical device connected in parallel.
There are basically two approaches to build the equivalent stamp, both based
on scaling the conductances of the model by the multiplicity value (the number
of device to connect in parallel). The first approach (used in NGSPICE BSIM3)
scales the conductances in the matrix stamp, when it is loaded into the overall
matrix, and the other one scales the conductances in the entire model code. Both
approaches have advantages and drawbacks, let's examine some of them.
The first approach, i.e. scaling the conductances at loading time, is
advantageous because the stamp "loading" code is easy to spot and because
the modification consists simply in multiplying each line by the multiplicity
factor "m". Another advantage is that this approach does not require a full
analysis of the device code to isolate the variables (they may be currents,
resistances, etc., not only conductances) that need to be scaled. The
most important drawback is that the evaluation code does not know anything
about "multiplicity" and then all internal computations are made for the
"single" device. To correct this, without interfering with the evaluation
code, you need to correct the routine that exports internal values (it is
the so called DEVask, where DEV is a placeholder for device's name).
The second approach, i.e. scaling the variables in the evaluation code, does
not have the drawback of the previous one but require a full code analysis
which, in turn, means more time to complete.
@subsection Adding the "m" parameter
The multiplicity parameter is an instance parameter. The first step is to
modify the code adding space for it in the various structures. The structure
@code{BSIM3instance} in @code{bsim3def.h} needs an entry for the new parameter,
its "given" flag and a numerical ID for the entry in the @code{BSIM3pTable}:
@example
...
...
double BSIM3w;
double BSIM3m;
double BSIM3drainArea;
...
...
unsigned BSIM3wGiven :1;
unsigned BSIM3mGiven :1;
unsigned BSIM3drainAreaGiven :1;
...
...
#define BSIM3_L 2
#define BSIM3_M 15
#define BSIM3_AS 3
...
...
@end example
The @code{BSIM3pTable} structure in @file{b3.c} needs an entry too:
@example
...
...
IOP( "w", BSIM3_W, IF_REAL , "Width"),
IOP( "m", BSIM3_M, IF_REAL , "Parallel multiplier"),
IOP( "ad", BSIM3_AD, IF_REAL , "Drain area"),
...
...
@end example
Once the entries are created, it is necessary to set up the bureaucracy needed
to set and query the new parameter. In the setup routine @code{BSIM3setup()} the
following code should be added:
@example
if (!here->BSIM3mGiven)
here->BSIM3m = 1;
@end example
This states that if multiplicity is not given in the netlist, it must be defaulted
to one. To set the "given" flag the following code should be added to @code{BSIM3param()}:
@example
case BSIM3_M:
here->BSIM3m = value->rValue;
here->BSIM3mGiven = TRUE;
break;
@end example
The last modification nedeed by model bureaucracy must be done in @code{BSIM3ask()}.
The following code should be added:
@example
case BSIM3_M:
value->rValue = here->BSIM3m;
return(OK);
@end example
Now the model is ready to set, query, default and use the new parameter. As discussed
before, this model use the "first" approach, thus only matrix loading code is affected
by the new parameter. In the @code{BSIM3load} routine the "Load Current Vector" and
"Load Y Matrix" section should become:
@example
...
...
(*(ckt->CKTrhs + here->BSIM3gNode) -= m*ceqqg);
(*(ckt->CKTrhs + here->BSIM3bNode) -= m*(ceqbs + ceqbd + ceqqb));
(*(ckt->CKTrhs + here->BSIM3dNodePrime) +=m*(ceqbd - cdreq - ceqqd));
(*(ckt->CKTrhs + here->BSIM3sNodePrime) += m*(cdreq + ceqbs + ceqqg
+ ceqqb + ceqqd));
if (here->BSIM3nqsMod)
*(ckt->CKTrhs + here->BSIM3qNode) += m*(cqcheq - cqdef);
/*
* load y matrix
*/
T1 = qdef * here->BSIM3gtau;
(*(here->BSIM3DdPtr) += m*here->BSIM3drainConductance);
(*(here->BSIM3GgPtr) += m*(gcggb - ggtg));
...
...
*(here->BSIM3QspPtr) += m*(ggts - gcqsb);
*(here->BSIM3QbPtr) += m*(ggtb - gcqbb);
...
...
@end example
The "load y matrix" is not completely shown, each line is multiplied by "m". The
same method has been applied to @code{BSIM3acLoad()} routine:
@example
...
...
m = here->BSIM3m;
*(here->BSIM3GgPtr +1) += m * xcggb;
*(here->BSIM3BbPtr +1) -= M * (xcbgb + xcbdb + xcbsb);
...
...
*(here->BSIM3QspPtr) += m * xgts;
*(here->BSIM3QbPtr) += m * xgtb;
@}
...
...
@end example
The pole-zero analysis uses a load routine (@code{BSIM3pzLoad()}) very similar to the
one used by the AC analysis:
@example
...
...
m = here->BSIM3m;
*(here->BSIM3GgPtr) += m * (xcggb * s->real);
*(here->BSIM3GgPtr + 1) += m * (xcggb * s->imag);
...
...
*(here->BSIM3QbPtr) += m * xgtb;
*(here->BSIM3QspPtr) += m * xgts;
@}
...
...
@end example
The noise analysis needs special attention, since it does not directly uses a
matrix load routine. In this case was necessary to study the noise models
used by BSIM3 and to scale the parameters affected by multiplicity. The following
parameters were multiplied by the value of @code{BSIM3m}: @code{BSIM3cd} (drain
current), @code{BSIM3weff} (effective width), @code{BSIM3drainConductance},
@code{BSIM3sourceConductance}, @code{BSIM3gm} (transconductance), @code{BSIM3gds}
(drain to source conductance), @code{BSIM3gmbs} (body source transconductance),
@code{BSIM3qinv} (charge in the channel).
In 3.2.4 BSIM3 revision, a bugfix introduced the @code{BSIM3rds} (drain to source
resistance) parameter. Since this is a resistance it has been divided by the
value of @code{BSIM3m}.
Now that we dealt with analyses code, the last piece of code to modify is
the @code{BSIM3ask()} routine. Again we have to identify what parameters need
to be scaled and multiply them by the multiplicity. If you look at the code
you will clearly see the affected parameters.
@section BSIM3 TNOM patch
All BSIM3 models, when implemented into Spice3f (NGSPICE), shows a bug that
affects simulations when the modelcard contains the TNOM keyword. If you
run consecutive times a netlist without reloading the deck, you will get
different answers with each run. Mike Smith discovered that the bug
hides in the functions @code{BSIM3mparam()} and @code{BSIM3setup()}. The
solutions (as extracted from Mike's post to @url{comp.lsi.cad}):
@example
In b3mpar.c look for the following code:-
case BSIM3_MOD_TNOM :
mod->BSIM3tnom = value->rValue;
mod->BSIM3tnomGiven = TRUE;
break;
Change the second line so the code reads:-
case BSIM3_MOD_TNOM :
mod->BSIM3tnom = value->rValue + 273.15;
mod->BSIM3tnomGiven = TRUE;
break;
In b3set.c, look for the following code:-
if (!model->BSIM3tnomGiven)
model->BSIM3tnom = ckt->CKTnomTemp;
else
model->BSIM3tnom = model->BSIM3tnom + 273.15;
Delete the second and third lines to read:-
if (!model->BSIM3tnomGiven)
model->BSIM3tnom = ckt->CKTnomTemp;
@end example
@section References for BSIM3 model
BSIM3 model is developed by the UC Berkeley Device Group, which maintains
a web site at the URL: @url{http://www-device.eecs.berkeley.edu/} for all
the model they develop.
@itemize @bullet
@item BSIM3 home page: @*
@url{http://www-device.eecs.berkeley.edu/~bsim3/latenews.html}
@item BSIM3 introduction: @*
@url{http://www-device.eecs.berkeley.edu/~bsim3/intro.html}
@item BSIM3 contact page: @*
@url{http://www-device.eecs.berkeley.edu/~bsim3/contact.html}
@end itemize
@chapter EKV Model
da scrivere
@bye
ngspice-24/doc/ChangeLog 0000644 0001750 0001750 00000004543 11712022254 016134 0 ustar sylvestre sylvestre 2005-08-15 Steven Borley
* Fixed missing parenthesis around CLEANFILES and DISTCLEANFILES in
Makefile.am as reported by David Fang
* Fixed the section in ngspice.texi where the use of @/ in a @url{} was
giving problems. Actually this whole section on the Windows port is now
out-of-date, and date link was broken, so I have replaced it with something
more appropriate. thank you to Stuart Brorson for reporting these problems.
2005-08-14 Steven Borley
* Fixed the problems of the AUTHORS file not being found by adding its
directory to the search paths for makeinfo and for texi2dvi in Makefile.am
* Fixed the warning caused by @strong{Note:} in ngspice.texti - used the
@quotation Note style as given in the texinfo user manual section 10.2
* Added an @include version.texi in the header of the ngspice.texi file.
This causes automake to create the necessary files and allow the use of
@value(VERSION) in the ngspice.texi. The .cvsignore file has been adjusted
to take account of the generated files.
* Used @copying and @insertcopying for the copyright text in ngspice.texi
and modified the file's structure a little. It now more closely follows the
simple example given in the texinfo user manual.
* Fixed some of the 'overfull' error generated by TeX when processing
ngspice.texi - many more still present.
* removed non-ASCII characters from ngspice.texi. this needed a work-round
for the degrees symbol - used @math{^o}
* Added ngsspice.pdf as an output file of make dist
2001-12-05 Emmanuel Rouat
* ngspice.texi: changed (most) references of spice3 to ngspice.
2001-12-04 Emmanuel Rouat
* ngspice.texi: corrected a few bugs, and made some chapters readable.
2000-05-22 Paolo Nenzi
* ngspice.texi: Added text for u2 function and for resistance ac
paramter.
1999-09-06 Arno Peters
* ngspice.texi: Added TeX equivalents for some formula.
First tables converted to texinfo format.
1999-08-31 Emmanuel Rouat
* Makefile.am: added .texi file by Arno Peters - a distribution will now
include a postscript doc.
updated 'clean' rules
ngspice-24/README.adms 0000644 0001750 0001750 00000050734 11712022254 015423 0 ustar sylvestre sylvestre ***************************************************************************
* DISCLAIMER *
* *
* The admst code generators, part of adms and this document are released *
* under LGPL license terms. *
* *
* Copyright (C) 2006 Freescale Inc. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
***************************************************************************
INTRODUCTION
In this document we will provide a guideline on how to auto-generate the
ready-to compile C code for the ngspice API of a compact device model
defined in the Verilog-AMS language.
Condition:
To compile Verilog-AMS compact models into ngspice-ready C models with
admsXml a copy of the latest adms distribution is needed. You get it from
the adms Download page http://mot-adms.sourceforge.net as a source code
package. (Also use of cvs version is possible, but needs some more effort.)
Version:
This guideline has been tested on Windows-XP under cygwin using:
$ admsXml -v
[usage]
[info] elapsed time: 0
[info] admst iterations: 0 (0 freed)
Goal:
In this guideline we will add device model hicum0 to ngspice
using the Verilog-AMS source code available at:
http://www.iee.et.tu-dresden.de/~schroter/Hicum_PD/Hicumna/hicumL0V1p11.va
Limitations:
The adms ngspice interface supports a limited set of Verilog-AMS language
constructs. See the home page of adms (http://mot-adms.sourceforge.net/)
for more info.
Feel free to contribute to the adms ngspice interface so that more
constructs can be supported.
01- ngspice Files
Ngspice does not (yet) have support for loading models at run time, every
model must be included at compile time. Then, adding a new model into
ngspice is a process that cannot be completely automated. Some files need
to be edited by hand.
01.01 What ngspice need to know of a new model ?
First you have to assign your new model a "device type". As you probably
know, ngspice recognizes the type of a device by the first letter in
device's name in the netlists ("r" for resistors, "q" for BJT, "m" for
mosfets and so on). Then the first thing you have to find is the correct
type for your new device (let's call this device_type).
Since there can be more than one model for each device type, another
parameter you have to set is the device_level, which must be unique
for each device type.
Once you have found the (device_type, device_level) couple you have
identified the files you have to edit:
/configure.ac
Here you have to add the entries in adms section for your new directory
and library.
/src/spicelib/parser/inp2.c
Substitute with the letter corresponding to the
type of you new model. Here you have to add the interface code for your
new device. In the case of hicum (a BJT model and thus a "q" device type)
you have to edit inp2q.c
/src/spicelib/parser/inpdomod.c
Here you have to add a switch for the level of your new device.
/src/spicelib/devices/dev.c
Follow the structure of the files and add information on your new
model. In dev.c you have to adjust some macro.
See existing examples to make the modifications for your own implementation.
is the path to the ngspice source installation.
For instance can be /tools/ng-spice-rework-17
Please see appendix 01 about spice3-flavoured flags.
02- adms Files
List of files that adms needs to create the ready-to-compile C code:
/src/spicelib/devices/adms/admst/ngspice*.xml
adms creates the ready-to-compile C code from a set of admst code
generators. admst is a subset of the XML language which has been created
specifically for the purpose of C code generation. The syntax of admst is
very close to the XSLT language (it includes some extensions.)
03- Create the data file structure
Create the following directories if they do not already exist:
-a /src/spicelib/devices/adms/hicum0
-b /src/spicelib/devices/adms/hicum0/admsva
There is no convention on the way to choice the last directory name in -a.
However in -b 'admsva' is mandatory.
04- Save the Verilog-AMS source code
Save the source code of hicum0 from
http://www.iee.et.tu-dresden.de/~schroter/Hicum_PD/Hicumna/hicumL0V1p11.va
to:
/src/spicelib/devices/adms/hicum0/admsva/hic0_full.va
NOTE: the name of the Verilog-AMS file that contains the 'module' declaration
should match the name of the module in the file.
For instance in file hic0_full.va you will find the following declaration:
...
module hic0_full (c,b,e,s);
...
05- Create file 'Makefile.am'
In directory ..../hicum0 run the following command in order to create file 'Makefile.am':
$ admsXml admsva/hic0_full.va -Iadmsva -e ../admst/ngspiceMakefile.am.xml
[info] admsXml-2.1.3 Feb 2 2006 19:01:39
[warning] [admsva\hic0_full.va:30]: standard vams file created (not found in -I path) ... 'constants.h'
[warning] [admsva\hic0_full.va:31]: standard vams file created (not found in -I path) ... 'discipline.h'
[info] Makefile.am: file created
[info] elapsed time: 1.0624
[info] admst iterations: 185425 (185425 freed)
After this step file 'Makefile.am' is created:
$ head Makefile.am
##
## Interface:
## created by: admsXml-2.1.3 - Monday, 01/30/06
## Process this file with automake to produce Makefile.in
ADMSXMLINTERFACE:=../admst
adms:
admsXml.exe -Iadmsva admsva/hic0_full.va \
06- Update/Create the auto-tools files (configure, Makefile.in, Makefile)
06.01 Manual changes
In directory edit file configure.ac, add new device 'hicum0'
(use the name of the directory - not the name of the module):
$ grep hicum0 configure.ac
src/spicelib/devices/adms/hicum0/Makefile \
In directory /src/spicelib/devices edit file Makefile.am, add new device 'hicum0':
$ grep hicum0 Makefile.am
adms/hicum0 \
adms/hicum0 \
06.02 Makefile.in
In directory run the shell command 'automake':
File 'Makefile.in' is created in directory /src/spicelib/devices/hicum0.
In directory /src/spicelib/devices/hicum0 you should have:
$ ls
Makefile.am Makefile.in admsva constants.h discipline.h
06.03 Update file 'configure'
In directory run the shell command 'autoconf':
File 'configure' is updated.
Edit the file to make sure that "adms/hicum0/Makefile" is present in the file.
06.04 Makefile
In directory run shell command 'configure':
$ configure
...
config.status: creating src/spicelib/devices/adms/hicum0/Makefile
...
File 'Makefile' is created in directory /src/spicelib/devices/hicum0.
In directory /src/spicelib/devices/hicum0 you should have:
$ ls
Makefile Makefile.am Makefile.in admsva constants.h discipline.h
07- Create the ready-to-compile auto-generated C code of device hicum0
In directory ..../hicum0 run the following command in order to create the auto-generated C code:
$ make adms
admsXml.exe -Iadmsva admsva/hic0_full.va \
-e ../admst/ngspiceVersion.xml \
-e ../admst/ngspiceMakefile.am.xml \
-e ../admst/ngspiceMODULEitf.h.xml \
-e ../admst/ngspiceMODULEinit.c.xml \
-e ../admst/ngspiceMODULEinit.h.xml \
-e ../admst/ngspiceMODULEext.h.xml \
-e ../admst/ngspiceMODULEdefs.h.xml \
-e ../admst/ngspiceMODULEask.c.xml \
-e ../admst/ngspiceMODULEmask.c.xml \
-e ../admst/ngspiceMODULEpar.c.xml \
-e ../admst/ngspiceMODULEmpar.c.xml \
-e ../admst/ngspiceMODULEload.c.xml \
-e ../admst/ngspiceMODULEacld.c.xml \
-e ../admst/ngspiceMODULEtemp.c.xml \
-e ../admst/ngspiceMODULEsetup.c.xml \
-e ../admst/ngspiceMODULEguesstopology.c.xml \
-e ../admst/ngspiceMODULE.c.xml
[info] admsXml-2.1.3 Feb 2 2006 19:01:39
[info] Makefile.am: file created
[info] hic0_fullitf.h: file created
[info] hic0_fullinit.c: file created
[info] hic0_fullinit.h: file created
[info] hic0_fullext.h: file created
[info] hic0_fulldefs.h: file created
[info] hic0_fullask.c: file created
[info] hic0_fullmask.c: file created
[info] hic0_fullpar.c: file created
[info] hic0_fullmpar.c: file created
[info] noise contribution not implemented - ignored!
[info] noise contribution not implemented - ignored!
[info] noise contribution not implemented - ignored!
[info] noise contribution not implemented - ignored!
[info] noise contribution not implemented - ignored!
[info] noise contribution not implemented - ignored!
[info] hic0_fullload.c: file created
[info] hic0_fullacld.c: file created
[info] hic0_fulltemp.c: file created
[info] hic0_fullsetup.c: file created
[info] hic0_fullguesstopology.c: file created
[info] hic0_full.c: file created
[info] elapsed time: 5.43757
[info] admst iterations: 1099640 (1099640 freed)
perl -p -i -e 's/IOP\("(\w+)"/IOP("\L\1"/' hic0_full.c
In directory /src/spicelib/devices/hicum0 you should have:
$ ls
Makefile constants.h hic0_fullacld.c hic0_fullguesstopology.c hic0_fullload.c hic0_fullsetup.c
Makefile.am discipline.h hic0_fullask.c hic0_fullinit.c hic0_fullmask.c hic0_fulltemp.c
Makefile.in hic0_full.c hic0_fulldefs.h hic0_fullinit.h hic0_fullmpar.c
admsva hic0_fullext.h hic0_fullitf.h hic0_fullpar.c
08- Compile the ready-to-compile auto-generated C code
In directory ..../hicum0 run the following command in order to create the object files*.o and libhic0_full.a:
$ make CFLAGS="-g"
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../../.. -I../../../../../src/include -g -MT hic0_full.o
-MD -MP -MF ".ds/hic0_full.Tpo" -c -o hic0_full.o hic0_full.c; \
then mv -f ".deps/hic0_full.Tpo" ".deps/hic0_full.Po"; else rm -f ".deps/hic0_full.Tpo"; exit 1; fi
...
ar cru libhic0_full.a hic0_full.o hic0_fullacld.o hic0_fullask.o hic0_fullguesstopology.o hic0_fullinit.o
hic0_fullload.o hic0_fullmask.o hic0_fullmpar.o hic0_fullpar.o hic0_fullsetup.o hic0_fulltemp.o
ranlib libhic0_full.a
WARNING: at the compilation step some messages about '#warning conflict' will be printed.
They mean that some ngspice reserved keywords have been used in the Verilog-AMS.
Just ignore them in the case of hicum0.
In directory /src/spicelib/devices/hicum0 you should have:
$ ls
Makefile hic0_full.c hic0_fullask.o hic0_fullinit.h hic0_fullmask.o hic0_fullsetup.o
Makefile.am hic0_fulldefs.h hic0_fullinit.o hic0_fullmpar.c hic0_fulltemp.c
Makefile.in hic0_full.o hic0_fullext.h hic0_fullitf.h hic0_fullmpar.o hic0_fulltemp.o
admsva hic0_fullacld.c hic0_fullguesstopology.c hic0_fullload.c hic0_fullpar.c libhic0_full.a
constants.h hic0_fullacld.o hic0_fullguesstopology.o hic0_fullload.o hic0_fullpar.o
discipline.h hic0_fullask.c hic0_fullinit.c hic0_fullmask.c hic0_fullsetup.c
NOTE: CFLAGS is redefined to "-g" is order to speed up the compilation process.
It is better NOT to redefine CFLAGS for official releases.
(the compilation will take a lot longer to complete)
09- Update manually the ngspice parser files
Modify the following files:
/src/spicelib/parser/inp2q.c ----> depends on the type of the device, here 'q' device
/src/spicelib/parser/inpdomod.c
/src/spicelib/devices/dev.c
...
10- Update executable 'ngspice'
10-01 Update ngspice
In directory run shell command 'make':
$ make
File 'src/ngspice.exe' is updated and contains the new device 'hicum0'.
10-02 Install ngspice
In directory run shell command 'make':
$ make install
ngspice executables are installed in /usr/local/bin.
11- Test the Implementation of hicum0 into ngspice
11-01 Create a simple ngspice netlist
Create file 'hicum0.sp'. Its contents is given below:
$ cat hicum0.sp
.title Netlist
.option
+ temp=25.0
+ reltol=1e-5
+ abstol=1e-15
.model mybjtmodel npn
+ npn=1
+ level=5
qN1
+ c b 0 0
+ mybjtmodel
rcc cc c 100.0
rbb bb b 1k
vcc
+ cc 0
+ 1.0
vbb
+ bb 0
+ 0.0
+ ac=0.0
.dc vbb 0.0 1.0 0.02
.print
+ dc
+ v(c)
+ i(vbb)
+ i(vcc)
.end
11-02 run 'ngspice':
$ ngspice -b hicum0.sp
Circuit: .title Netlist
Doing analysis at TEMP = 298.150000 and TNOM = 300.150000
No. of Data Rows : 51
.title Netlist
DC transfer characteristic Mon Jan 30 10:22:01 2006
--------------------------------------------------------------------------------
Index v-sweep v(c) vbb#branch vcc#branch
--------------------------------------------------------------------------------
0 0.000000e+00 1.000000e+00 0.000000e+00 -7.105421e-17
1 2.000000e-02 1.000000e+00 -5.593842e-19 -1.265654e-16
2 4.000000e-02 1.000000e+00 -2.076336e-18 -2.775558e-16
3 6.000000e-02 1.000000e+00 -5.366258e-18 -6.061817e-16
4 8.000000e-02 1.000000e+00 -1.254873e-17 -1.320055e-15
5 1.000000e-01 1.000000e+00 -2.812744e-17 -2.874367e-15
6 1.200000e-01 1.000000e+00 -7.629085e-17 -7.666090e-15
7 1.400000e-01 1.000000e+00 -1.669761e-16 -1.669553e-14
8 1.600000e-01 1.000000e+00 -3.645759e-16 -3.636425e-14
9 1.800000e-01 1.000000e+00 -7.948513e-16 -7.920553e-14
10 2.000000e-01 1.000000e+00 -1.732082e-15 -1.725142e-13
11 2.200000e-01 1.000000e+00 -3.773484e-15 -3.757461e-13
12 2.400000e-01 1.000000e+00 -8.219658e-15 -8.183998e-13
13 2.600000e-01 1.000000e+00 -1.790375e-14 -1.782522e-12
14 2.800000e-01 1.000000e+00 -3.899630e-14 -3.882434e-12
15 3.000000e-01 1.000000e+00 -8.493698e-14 -8.456170e-12
16 3.200000e-01 1.000000e+00 -1.849987e-13 -1.841804e-11
17 3.400000e-01 1.000000e+00 -4.029389e-13 -4.011557e-11
18 3.600000e-01 1.000000e+00 -8.776254e-13 -8.737407e-11
19 3.800000e-01 1.000000e+00 -1.911521e-12 -1.903059e-10
20 4.000000e-01 1.000000e+00 -4.163405e-12 -4.144973e-10
21 4.200000e-01 9.999999e-01 -9.068141e-12 -9.027994e-10
22 4.400000e-01 9.999998e-01 -1.975094e-11 -1.966349e-09
23 4.600000e-01 9.999996e-01 -4.301867e-11 -4.282821e-09
24 4.800000e-01 9.999991e-01 -9.369701e-11 -9.328218e-09
25 5.000000e-01 9.999980e-01 -2.040767e-10 -2.031732e-08
26 5.200000e-01 9.999956e-01 -4.444870e-10 -4.425191e-08
27 5.400000e-01 9.999904e-01 -9.680991e-10 -9.638130e-08
28 5.600000e-01 9.999790e-01 -2.108483e-09 -2.099148e-07
29 5.800000e-01 9.999543e-01 -4.591957e-09 -4.571626e-07
30 6.000000e-01 9.999004e-01 -9.999448e-09 -9.955176e-07
31 6.200000e-01 9.997833e-01 -2.176941e-08 -2.167303e-06
32 6.400000e-01 9.995284e-01 -4.736784e-08 -4.715812e-06
33 6.600000e-01 9.989751e-01 -1.029470e-07 -1.024912e-05
34 6.800000e-01 9.977781e-01 -2.231776e-07 -2.221894e-05
35 7.000000e-01 9.952090e-01 -4.812339e-07 -4.791028e-05
36 7.200000e-01 9.897838e-01 -1.026165e-06 -1.021618e-04
37 7.400000e-01 9.786930e-01 -2.140206e-06 -2.130697e-04
38 7.600000e-01 9.573154e-01 -4.287705e-06 -4.268455e-04
39 7.800000e-01 9.197474e-01 -8.062749e-06 -8.025264e-04
40 8.000000e-01 8.611162e-01 -1.395965e-05 -1.388838e-03
41 8.200000e-01 7.801099e-01 -2.212604e-05 -2.198901e-03
42 8.400000e-01 6.791392e-01 -3.235919e-05 -3.208608e-03
43 8.600000e-01 5.627227e-01 -4.429334e-05 -4.372773e-03
44 8.800000e-01 4.367031e-01 -5.756142e-05 -5.632969e-03
45 9.000000e-01 3.111929e-01 -7.186079e-05 -6.888071e-03
46 9.200000e-01 2.120521e-01 -8.696058e-05 -7.879479e-03
47 9.400000e-01 1.637984e-01 -1.026891e-04 -8.362016e-03
48 9.600000e-01 1.443326e-01 -1.189191e-04 -8.556674e-03
49 9.800000e-01 1.353683e-01 -1.355550e-04 -8.646317e-03
50 1.000000e+00 1.312181e-01 -1.525242e-04 -8.687819e-03
Total elapsed time: 0.625 seconds.
Current dynamic memory usage = 1.515520 MB,
Dynamic memory limit = 1241.702400 MB.
12- How to update ngspice when the Verilog-AMS source code changes
If you modify the Verilog-AMS source code of 'hicum0'
just complete the following steps in order to update
'ngspice':
12-01 Update the auto-generated C code
In directory ..../hicum0 run:
- make clean
- make adms
- make
12-02 Update 'ngspice' and re-install
In directory run:
- make
- make install
Appendix 01: Comments on spice3-flavoured flags like npn, pnp, nmos, pmos and so on
In the adms-based implementation of hicum0 the value of the device type flag (either npn or pnp)
in the model card is just ignored.
The selection of the type of the device is actually done using model parameters.
In the Verilog-AMS code of hicum0 there are two special model parameters called 'npn' and 'pnp'
which decide what the type of the device will be (either a npn bipolar model or pnp bipolar model).
The Verilog-AMS piece of code that triggers the decision is as follows:
if (`PGIVEN(npn))
HICUMtype = `NPN;
else if (`PGIVEN(pnp))
HICUMtype = `PNP;
else
HICUMtype = `NPN;
end
`PGIVEN(npn) is a macro that returns 1 is model parameter 'npn' occurs in the .model card
of the ngspice netlist. Otherwise it returns 0.
For instance:
1- the following model card will select a NPN type device:
.model mybjtmodel npn
+ npn=1
+ level=5
2- the following model card will select a PNP type device:
.model mybjtmodel npn
+ pnp=1
+ level=5
In both cases flag 'npn' is just ignored.
In section 'Update manually the ngspice parser files' it is recommended
to use flag 'adms' instead.
This limitation results from the LRM of VerilogAMS that does not support flags.
ngspice-24/BUGS 0000644 0001750 0001750 00000003125 11712022254 014273 0 ustar sylvestre sylvestre This file contains a list of known but not yet fixed bugs in ngspice.
===========================================================================
How to submit a bug report:
There are two methods to report a bug you have discovered in ngspice:
* Bug tracker: This is the preferred method of reporting a bug.
Using the tracker on Sourceforge.net site will make your report
open by everyone and the chances of finding a fix will increase.
* ngspice-devel list: If you are a member of this list, you can write
directly to the developers' list. Do not subscribe to the list only
for sending bug reports.
Before sending a bug report please note: all information you send to the bug
tracking system or on the mailing lists is public. If you need to send
sensitive information, send them to a developer directly but still write non
sensitive data on the bug tracking system to keep track of bug history.
------------------------------------------------------------------------------
OPEN BUGS:
------------------------------------------------------------------------------
* return value:
When ngspice is called in batch mode it returns 1 even if the simulations
are run. The problem arises when there is a .control section but no
.print, .plot or .fourier lines. Ngspice outputs:
Note: No ".plot", ".print", or ".fourier" lines; no simulations run
and exits returning 1.
Workaround: add -r to the command line to avoid this.
* please refer to the sourceforge bug tracker at
http://sourceforge.net/tracker/?group_id=38962&atid=423915
ngspice-24/aclocal.m4 0000644 0001750 0001750 00001160712 11712022316 015456 0 ustar sylvestre sylvestre # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
[m4_warning([this file was generated for autoconf 2.67.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
#
# GNU Libtool 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.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
# serial 56 LT_INIT
# LT_PREREQ(VERSION)
# ------------------
# Complain and exit if this libtool version is less that VERSION.
m4_defun([LT_PREREQ],
[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
[m4_default([$3],
[m4_fatal([Libtool version $1 or higher is required],
63)])],
[$2])])
# _LT_CHECK_BUILDDIR
# ------------------
# Complain if the absolute build directory name contains unusual characters
m4_defun([_LT_CHECK_BUILDDIR],
[case `pwd` in
*\ * | *\ *)
AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
esac
])
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
AC_BEFORE([$0], [LTDL_INIT])dnl
m4_require([_LT_CHECK_BUILDDIR])dnl
dnl Autoconf doesn't catch unexpanded LT_ macros by default:
m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
dnl unless we require an AC_DEFUNed macro:
AC_REQUIRE([LTOPTIONS_VERSION])dnl
AC_REQUIRE([LTSUGAR_VERSION])dnl
AC_REQUIRE([LTVERSION_VERSION])dnl
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
m4_require([_LT_PROG_LTMAIN])dnl
dnl Parse OPTIONS
_LT_SET_OPTIONS([$0], [$1])
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
_LT_SETUP
# Only expand once:
m4_define([LT_INIT])
])# LT_INIT
# Old names:
AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
# _LT_CC_BASENAME(CC)
# -------------------
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
m4_defun([_LT_CC_BASENAME],
[for cc_temp in $1""; do
case $cc_temp in
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
])
# _LT_FILEUTILS_DEFAULTS
# ----------------------
# It is okay to use these file commands and assume they have been set
# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
m4_defun([_LT_FILEUTILS_DEFAULTS],
[: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}
])# _LT_FILEUTILS_DEFAULTS
# _LT_SETUP
# ---------
m4_defun([_LT_SETUP],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
dnl
_LT_DECL([], [build_alias], [0], [The build system])dnl
_LT_DECL([], [build], [0])dnl
_LT_DECL([], [build_os], [0])dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
test -z "$LN_S" && LN_S="ln -s"
_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
dnl
AC_REQUIRE([LT_CMD_MAX_LEN])dnl
_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
])
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
_LT_CHECK_OBJDIR
m4_require([_LT_TAG_COMPILER])dnl
_LT_PROG_ECHO_BACKSLASH
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\([["`\\]]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
# Global variables:
ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
_LT_CC_BASENAME([$compiler])
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
_LT_PATH_MAGIC
fi
;;
esac
# Use C for the default configuration in the libtool script
LT_SUPPORTED_TAG([CC])
_LT_LANG_C_CONFIG
_LT_LANG_DEFAULT_CONFIG
_LT_CONFIG_COMMANDS
])# _LT_SETUP
# _LT_PROG_LTMAIN
# ---------------
# Note that this code is called both from `configure', and `config.status'
# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
# `config.status' has no value for ac_aux_dir unless we are using Automake,
# so we pass a copy along to make sure it has a sensible value anyway.
m4_defun([_LT_PROG_LTMAIN],
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
ltmain="$ac_aux_dir/ltmain.sh"
])# _LT_PROG_LTMAIN
# So that we can recreate a full libtool script including additional
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
# in macros and then make a single call at the end using the `libtool'
# label.
# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
# ----------------------------------------
# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL_INIT],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_INIT],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_INIT])
# _LT_CONFIG_LIBTOOL([COMMANDS])
# ------------------------------
# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
# -----------------------------------------------------
m4_defun([_LT_CONFIG_SAVE_COMMANDS],
[_LT_CONFIG_LIBTOOL([$1])
_LT_CONFIG_LIBTOOL_INIT([$2])
])
# _LT_FORMAT_COMMENT([COMMENT])
# -----------------------------
# Add leading comment marks to the start of each line, and a trailing
# full-stop to the whole comment if one is not present already.
m4_define([_LT_FORMAT_COMMENT],
[m4_ifval([$1], [
m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
[['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
)])
# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
# -------------------------------------------------------------------
# CONFIGNAME is the name given to the value in the libtool script.
# VARNAME is the (base) name used in the configure script.
# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
# VARNAME. Any other value will be used directly.
m4_define([_LT_DECL],
[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
[lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
[m4_ifval([$1], [$1], [$2])])
lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
m4_ifval([$4],
[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
lt_dict_add_subkey([lt_decl_dict], [$2],
[tagged?], [m4_ifval([$5], [yes], [no])])])
])
# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
# --------------------------------------------------------
m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_tag_varnames],
[_lt_decl_filter([tagged?], [yes], $@)])
# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
# ---------------------------------------------------------
m4_define([_lt_decl_filter],
[m4_case([$#],
[0], [m4_fatal([$0: too few arguments: $#])],
[1], [m4_fatal([$0: too few arguments: $#: $1])],
[2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
[3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
[lt_dict_filter([lt_decl_dict], $@)])[]dnl
])
# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
# --------------------------------------------------
m4_define([lt_decl_quote_varnames],
[_lt_decl_filter([value], [1], $@)])
# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_dquote_varnames],
[_lt_decl_filter([value], [2], $@)])
# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_varnames_tagged],
[m4_assert([$# <= 2])dnl
_$0(m4_quote(m4_default([$1], [[, ]])),
m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
m4_define([_lt_decl_varnames_tagged],
[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_all_varnames],
[_$0(m4_quote(m4_default([$1], [[, ]])),
m4_if([$2], [],
m4_quote(lt_decl_varnames),
m4_quote(m4_shift($@))))[]dnl
])
m4_define([_lt_decl_all_varnames],
[lt_join($@, lt_decl_varnames_tagged([$1],
lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
])
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
# ------------------------------------
# Quote a variable value, and forward it to `config.status' so that its
# declaration there will have the same value as in `configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
# _LT_CONFIG_STATUS_DECLARATIONS
# ------------------------------
# We delimit libtool config variables with single quotes, so when
# we write them to config.status, we have to be sure to quote all
# embedded single quotes properly. In configure, this macro expands
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
#
# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`'
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
[m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAGS
# ----------------
# Output comment and list of tags supported by the script
m4_defun([_LT_LIBTOOL_TAGS],
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
available_tags="_LT_TAGS"dnl
])
# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
# -----------------------------------
# Extract the dictionary values for VARNAME (optionally with TAG) and
# expand to a commented shell variable setting:
#
# # Some comment about what VAR is for.
# visible_name=$lt_internal_name
m4_define([_LT_LIBTOOL_DECLARE],
[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
[description])))[]dnl
m4_pushdef([_libtool_name],
m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
[0], [_libtool_name=[$]$1],
[1], [_libtool_name=$lt_[]$1],
[2], [_libtool_name=$lt_[]$1],
[_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
])
# _LT_LIBTOOL_CONFIG_VARS
# -----------------------
# Produce commented declarations of non-tagged libtool config variables
# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
# section) are produced by _LT_LIBTOOL_TAG_VARS.
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
[m4_foreach([_lt_var],
m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAG_VARS(TAG)
# -------------------------
m4_define([_LT_LIBTOOL_TAG_VARS],
[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
# _LT_TAGVAR(VARNAME, [TAGNAME])
# ------------------------------
m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
# _LT_CONFIG_COMMANDS
# -------------------
# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
# variables for single and double quote escaping we saved from calls
# to _LT_DECL, we can put quote escaped variables declarations
# into `config.status', and then the shell code to quote escape them in
# for loops in `config.status'. Finally, any additional code accumulated
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
m4_defun([_LT_CONFIG_COMMANDS],
[AC_PROVIDE_IFELSE([LT_OUTPUT],
dnl If the libtool generation code has been placed in $CONFIG_LT,
dnl instead of duplicating it all over again into config.status,
dnl then we will have config.status run $CONFIG_LT later, so it
dnl needs to know what name is stored there:
[AC_CONFIG_COMMANDS([libtool],
[$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
dnl If the libtool generation code is destined for config.status,
dnl expand the accumulated commands and init code now:
[AC_CONFIG_COMMANDS([libtool],
[_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
])#_LT_CONFIG_COMMANDS
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
[
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
_LT_CONFIG_STATUS_DECLARATIONS
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
# Quote evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_quote_varnames); do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Double-quote double-evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_dquote_varnames); do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Fix-up fallback echo if it was mangled by the above quoting rules.
case \$lt_ECHO in
*'\\\[$]0 --fallback-echo"')dnl "
lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
;;
esac
_LT_OUTPUT_LIBTOOL_INIT
])
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
# AC_OUTPUT is called), incase it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
AC_MSG_NOTICE([creating $CONFIG_LT])
cat >"$CONFIG_LT" <<_LTEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate a libtool stub with the current configuration.
lt_cl_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_LTEOF
cat >>"$CONFIG_LT" <<\_LTEOF
AS_SHELL_SANITIZE
_AS_PREPARE
exec AS_MESSAGE_FD>&1
exec AS_MESSAGE_LOG_FD>>config.log
{
echo
AS_BOX([Running $as_me.])
} >&AS_MESSAGE_LOG_FD
lt_cl_help="\
\`$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.
Usage: $[0] [[OPTIONS]]
-h, --help print this help, then exit
-V, --version print version number, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
Report bugs to ."
lt_cl_version="\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
Copyright (C) 2008 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
while test $[#] != 0
do
case $[1] in
--version | --v* | -V )
echo "$lt_cl_version"; exit 0 ;;
--help | --h* | -h )
echo "$lt_cl_help"; exit 0 ;;
--debug | --d* | -d )
debug=: ;;
--quiet | --q* | --silent | --s* | -q )
lt_cl_silent=: ;;
-*) AC_MSG_ERROR([unrecognized option: $[1]
Try \`$[0] --help' for more information.]) ;;
*) AC_MSG_ERROR([unrecognized argument: $[1]
Try \`$[0] --help' for more information.]) ;;
esac
shift
done
if $lt_cl_silent; then
exec AS_MESSAGE_FD>/dev/null
fi
_LTEOF
cat >>"$CONFIG_LT" <<_LTEOF
_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
_LTEOF
cat >>"$CONFIG_LT" <<\_LTEOF
AC_MSG_NOTICE([creating $ofile])
_LT_OUTPUT_LIBTOOL_COMMANDS
AS_EXIT(0)
_LTEOF
chmod +x "$CONFIG_LT"
# configure is writing to config.log, but config.lt does its own redirection,
# appending to config.log, which fails on DOS, as config.log is still kept
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
if test "$no_create" != yes; then
lt_cl_success=:
test "$silent" = yes &&
lt_config_lt_args="$lt_config_lt_args --quiet"
exec AS_MESSAGE_LOG_FD>/dev/null
$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
exec AS_MESSAGE_LOG_FD>>config.log
$lt_cl_success || AS_EXIT(1)
fi
])# LT_OUTPUT
# _LT_CONFIG(TAG)
# ---------------
# If TAG is the built-in tag, create an initial libtool script with a
# default configuration from the untagged config vars. Otherwise add code
# to config.status for appending the configuration named by TAG from the
# matching tagged config vars.
m4_defun([_LT_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_CONFIG_SAVE_COMMANDS([
m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
m4_if(_LT_TAG, [C], [
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
cfgfile="${ofile}T"
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
_LT_COPYING
_LT_LIBTOOL_TAGS
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
# ### END LIBTOOL CONFIG
_LT_EOF
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
_LT_EOF
;;
esac
_LT_PROG_LTMAIN
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
_LT_PROG_XSI_SHELLFNS
sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
[cat <<_LT_EOF >> "$ofile"
dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
dnl in a comment (ie after a #).
# ### BEGIN LIBTOOL TAG CONFIG: $1
_LT_LIBTOOL_TAG_VARS(_LT_TAG)
# ### END LIBTOOL TAG CONFIG: $1
_LT_EOF
])dnl /m4_if
],
[m4_if([$1], [], [
PACKAGE='$PACKAGE'
VERSION='$VERSION'
TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'], [])
])dnl /_LT_CONFIG_SAVE_COMMANDS
])# _LT_CONFIG
# LT_SUPPORTED_TAG(TAG)
# ---------------------
# Trace this macro to discover what tags are supported by the libtool
# --tag option, using:
# autoconf --trace 'LT_SUPPORTED_TAG:$1'
AC_DEFUN([LT_SUPPORTED_TAG], [])
# C support is built-in for now
m4_define([_LT_LANG_C_enabled], [])
m4_define([_LT_TAGS], [])
# LT_LANG(LANG)
# -------------
# Enable libtool support for the given language if not already enabled.
AC_DEFUN([LT_LANG],
[AC_BEFORE([$0], [LT_OUTPUT])dnl
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
[Windows Resource], [_LT_LANG(RC)],
[m4_ifdef([_LT_LANG_]$1[_CONFIG],
[_LT_LANG($1)],
[m4_fatal([$0: unsupported language: "$1"])])])dnl
])# LT_LANG
# _LT_LANG(LANGNAME)
# ------------------
m4_defun([_LT_LANG],
[m4_ifdef([_LT_LANG_]$1[_enabled], [],
[LT_SUPPORTED_TAG([$1])dnl
m4_append([_LT_TAGS], [$1 ])dnl
m4_define([_LT_LANG_]$1[_enabled], [])dnl
_LT_LANG_$1_CONFIG($1)])dnl
])# _LT_LANG
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
[AC_PROVIDE_IFELSE([AC_PROG_CXX],
[LT_LANG(CXX)],
[m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[LT_LANG(F77)],
[m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
AC_PROVIDE_IFELSE([AC_PROG_FC],
[LT_LANG(FC)],
[m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
dnl pulling things in needlessly.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([LT_PROG_GCJ],
[LT_LANG(GCJ)],
[m4_ifdef([AC_PROG_GCJ],
[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([A][M_PROG_GCJ],
[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
])# _LT_LANG_DEFAULT_CONFIG
# Obsolete macros:
AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
# _LT_TAG_COMPILER
# ----------------
m4_defun([_LT_TAG_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
])# _LT_TAG_COMPILER
# _LT_COMPILER_BOILERPLATE
# ------------------------
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
m4_defun([_LT_COMPILER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*
])# _LT_COMPILER_BOILERPLATE
# _LT_LINKER_BOILERPLATE
# ----------------------
# Check for linker boilerplate output or warnings with
# the simple link test code.
m4_defun([_LT_LINKER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
case $host_os in
rhapsody* | darwin*)
AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
AC_CHECK_TOOL([LIPO], [lipo], [:])
AC_CHECK_TOOL([OTOOL], [otool], [:])
AC_CHECK_TOOL([OTOOL64], [otool64], [:])
_LT_DECL([], [DSYMUTIL], [1],
[Tool to manipulate archived DWARF debug symbol files on Mac OS X])
_LT_DECL([], [NMEDIT], [1],
[Tool to change global to local symbols on Mac OS X])
_LT_DECL([], [LIPO], [1],
[Tool to manipulate fat objects and archives on Mac OS X])
_LT_DECL([], [OTOOL], [1],
[ldd/readelf like tool for Mach-O binaries on Mac OS X])
_LT_DECL([], [OTOOL64], [1],
[ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
[lt_cv_apple_cc_single_mod=no
if test -z "${LT_MULTI_MODULE}"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
# link flags.
rm -rf libconftest.dylib*
echo "int foo(void){return 1;}" > conftest.c
echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
fi
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[lt_cv_ld_exported_symbols_list=yes],
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
case $host_os in
rhapsody* | darwin1.[[012]])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
_lt_dar_single_mod='$single_module'
fi
if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
if test "$DSYMUTIL" != ":"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
fi
;;
esac
])
# _LT_DARWIN_LINKER_FEATURES
# --------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
m4_require([_LT_REQUIRED_DARWIN_CHECKS])
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
case $cc_basename in
ifort*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=echo
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
m4_if([$1], [CXX],
[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
],[])
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
])
# _LT_SYS_MODULE_PATH_AIX
# -----------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
AC_LINK_IFELSE(AC_LANG_PROGRAM,[
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\(.*\)$/\1/
p
}
}'
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_SYS_MODULE_PATH_AIX
# _LT_SHELL_INIT(ARG)
# -------------------
m4_define([_LT_SHELL_INIT],
[ifdef([AC_DIVERSION_NOTICE],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
$1
AC_DIVERT_POP
])# _LT_SHELL_INIT
# _LT_PROG_ECHO_BACKSLASH
# -----------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
m4_defun([_LT_PROG_ECHO_BACKSLASH],
[_LT_SHELL_INIT([
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
;;
esac
ECHO=${lt_ECHO-echo}
if test "X[$]1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X[$]1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
# Yippee, $ECHO works!
:
else
# Restart under the correct shell.
exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
fi
if test "X[$]1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<_LT_EOF
[$]*
_LT_EOF
exit 0
fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
if test -z "$lt_ECHO"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
{ test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
then
break
fi
done
fi
if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
:
else
# The Solaris, AIX, and Digital Unix default echo programs unquote
# backslashes. This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
#
# So, first we look for a working echo in the user's PATH.
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for dir in $PATH /usr/ucb; do
IFS="$lt_save_ifs"
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
ECHO="$dir/echo"
break
fi
done
IFS="$lt_save_ifs"
if test "X$ECHO" = Xecho; then
# We didn't find a better echo, so look for alternatives.
if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# This shell has a builtin print -r that does the trick.
ECHO='print -r'
elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
test "X$CONFIG_SHELL" != X/bin/ksh; then
# If we have ksh, try running configure again with it.
ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
export ORIGINAL_CONFIG_SHELL
CONFIG_SHELL=/bin/ksh
export CONFIG_SHELL
exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
else
# Try using printf.
ECHO='printf %s\n'
if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# Cool, printf works
:
elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
export CONFIG_SHELL
SHELL="$CONFIG_SHELL"
export SHELL
ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
else
# maybe with a smaller string...
prev=:
for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
then
break
fi
prev="$cmd"
done
if test "$prev" != 'sed 50q "[$]0"'; then
echo_test_string=`eval $prev`
export echo_test_string
exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
else
# Oops. We lost completely, so just stick with echo.
ECHO=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
lt_ECHO=$ECHO
if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
AC_SUBST(lt_ECHO)
])
_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
_LT_DECL([], [ECHO], [1],
[An echo program that does not interpret backslashes])
])# _LT_PROG_ECHO_BACKSLASH
# _LT_ENABLE_LOCK
# ---------------
m4_defun([_LT_ENABLE_LOCK],
[AC_ARG_ENABLE([libtool-lock],
[AS_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE="32"
;;
*ELF-64*)
HPUX_IA64_MODE="64"
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
*N32*)
LD="${LD-ld} -melf32bmipn32"
;;
*64-bit*)
LD="${LD-ld} -melf64bmip"
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
fi
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
LD="${LD-ld} -m elf_s390"
;;
sparc64-*linux*)
LD="${LD-ld} -m elf32_sparc"
;;
esac
;;
*64-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
ppc*-*linux*|powerpc*-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
LD="${LD-ld} -m elf64_s390"
;;
sparc*-*linux*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_LANG_PUSH(C)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_POP])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
fi
;;
esac
;;
esac
fi
rm -rf conftest*
;;
esac
need_locks="$enable_libtool_lock"
])# _LT_ENABLE_LOCK
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
[AC_CHECK_TOOL(AR, ar, false)
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1])
AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
AC_CHECK_TOOL(RANLIB, ranlib, :)
test -z "$RANLIB" && RANLIB=:
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
_LT_DECL([], [old_postinstall_cmds], [2])
_LT_DECL([], [old_postuninstall_cmds], [2])
_LT_TAGDECL([], [old_archive_cmds], [2],
[Commands used to build an old-style archive])
])# _LT_CMD_OLD_ARCHIVE
# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
# ----------------------------------------------------------------
# Check whether the given compiler option works
AC_DEFUN([_LT_COMPILER_OPTION],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&AS_MESSAGE_LOG_FD
echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
fi
$RM conftest*
])
if test x"[$]$2" = xyes; then
m4_if([$5], , :, [$5])
else
m4_if([$6], , :, [$6])
fi
])# _LT_COMPILER_OPTION
# Old name:
AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
# [ACTION-SUCCESS], [ACTION-FAILURE])
# ----------------------------------------------------
# Check whether the given linker option works
AC_DEFUN([_LT_LINKER_OPTION],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&AS_MESSAGE_LOG_FD
$ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
else
$2=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
])
if test x"[$]$2" = xyes; then
m4_if([$4], , :, [$4])
else
m4_if([$5], , :, [$5])
fi
])# _LT_LINKER_OPTION
# Old name:
AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
# LT_CMD_MAX_LEN
#---------------
AC_DEFUN([LT_CMD_MAX_LEN],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
# find the maximum length of command line arguments
AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0
teststring="ABCD"
case $build_os in
msdosdjgpp*)
# On DJGPP, this test can blow up pretty badly due to problems in libc
# (any single argument exceeding 2000 bytes causes a buffer overrun
# during glob expansion). Even if it were fixed, the result of this
# check would be larger than it should be.
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
gnu*)
# Under GNU Hurd, this test is not required because there is
# no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
# you end up with a "frozen" computer, even though with patience
# the test eventually succeeds (with a max line length of 256k).
# Instead, let's just punt: use the minimum linelength reported by
# all of the supported platforms: 8192 (on NT/2K/XP).
lt_cv_sys_max_cmd_len=8192;
;;
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else
lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
fi
# And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
interix*)
# We know the value 262144 and hardcode it with a safety zone (like BSD)
lt_cv_sys_max_cmd_len=196608
;;
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
# nice to cause kernel panics so lets avoid the loop below.
# First set a reasonable default.
lt_cv_sys_max_cmd_len=16384
#
if test -x /sbin/sysconfig; then
case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
*1*) lt_cv_sys_max_cmd_len=-1 ;;
esac
fi
;;
sco3.2v5*)
lt_cv_sys_max_cmd_len=102400
;;
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
for i in 1 2 3 4 5 6 7 8 ; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
= "XX$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
done
# Only check the string length outside the loop.
lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
teststring=
# Add a significant safety factor because C++ compilers can tack on
# massive amounts of additional arguments before passing them to the
# linker. It appears as though 1/2 is a usable value.
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
fi
;;
esac
])
if test -n $lt_cv_sys_max_cmd_len ; then
AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
else
AC_MSG_RESULT(none)
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
_LT_DECL([], [max_cmd_len], [0],
[What is the maximum length of a command?])
])# LT_CMD_MAX_LEN
# Old name:
AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
# _LT_HEADER_DLFCN
# ----------------
m4_defun([_LT_HEADER_DLFCN],
[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
])# _LT_HEADER_DLFCN
# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
# ----------------------------------------------------------------
m4_defun([_LT_TRY_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
if test "$cross_compiling" = yes; then :
[$4]
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
[#line __oline__ "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#include
#endif
#include
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}]
_LT_EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) $1 ;;
x$lt_dlneed_uscore) $2 ;;
x$lt_dlunknown|x*) $3 ;;
esac
else :
# compilation failed
$3
fi
fi
rm -fr conftest*
])# _LT_TRY_DLOPEN_SELF
# LT_SYS_DLOPEN_SELF
# ------------------
AC_DEFUN([LT_SYS_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
else
lt_cv_dlopen=no
lt_cv_dlopen_libs=
case $host_os in
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
;;
darwin*)
# if libdl is installed we need to link against it
AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
])
;;
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
[lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
])
])
;;
esac
if test "x$lt_cv_dlopen" != xno; then
enable_dlopen=yes
else
enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS="$CPPFLAGS"
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CACHE_CHECK([whether a program can dlopen itself],
lt_cv_dlopen_self, [dnl
_LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
lt_cv_dlopen_self_static, [dnl
_LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
])
fi
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
;;
esac
case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
fi
_LT_DECL([dlopen_support], [enable_dlopen], [0],
[Whether dlopen is supported])
_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
[Whether dlopen of programs is supported])
_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
[Whether dlopen of statically linked programs is supported])
])# LT_SYS_DLOPEN_SELF
# Old name:
AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
# _LT_COMPILER_C_O([TAGNAME])
# ---------------------------
# Check to see if options -c and -o are simultaneously supported by compiler.
# This macro does not hard code the compiler like AC_PROG_CC_C_O.
m4_defun([_LT_COMPILER_C_O],
[m4_require([_LT_DECL_SED])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_TAG_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&AS_MESSAGE_LOG_FD
echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
fi
fi
chmod u+w . 2>&AS_MESSAGE_LOG_FD
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
])
_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
[Does compiler simultaneously support -c and -o options?])
])# _LT_COMPILER_C_O
# _LT_COMPILER_FILE_LOCKS([TAGNAME])
# ----------------------------------
# Check to see if we can do hard links to lock some files if needed
m4_defun([_LT_COMPILER_FILE_LOCKS],
[m4_require([_LT_ENABLE_LOCK])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_COMPILER_C_O([$1])
hard_links="nottested"
if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
AC_MSG_CHECKING([if we can lock with hard links])
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
AC_MSG_RESULT([$hard_links])
if test "$hard_links" = no; then
AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
need_locks=warn
fi
else
need_locks=no
fi
_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
])# _LT_COMPILER_FILE_LOCKS
# _LT_CHECK_OBJDIR
# ----------------
m4_defun([_LT_CHECK_OBJDIR],
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
[rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
lt_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
lt_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null])
objdir=$lt_cv_objdir
_LT_DECL([], [objdir], [0],
[The name of the directory that contains temporary libtool files])dnl
m4_pattern_allow([LT_OBJDIR])dnl
AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
[Define to the sub-directory in which libtool stores uninstalled libraries.])
])# _LT_CHECK_OBJDIR
# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
# --------------------------------------
# Check hardcoding attributes.
m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
[AC_MSG_CHECKING([how to hardcode library paths into programs])
_LT_TAGVAR(hardcode_action, $1)=
if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
test -n "$_LT_TAGVAR(runpath_var, $1)" ||
test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
# We can hardcode non-existent directories.
if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
# Linking always hardcodes the temporary library directory.
_LT_TAGVAR(hardcode_action, $1)=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
_LT_TAGVAR(hardcode_action, $1)=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
_LT_TAGVAR(hardcode_action, $1)=unsupported
fi
AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
test "$enable_shared" = no; then
# Fast installation is not necessary
enable_fast_install=needless
fi
_LT_TAGDECL([], [hardcode_action], [0],
[How to hardcode a shared library path into an executable])
])# _LT_LINKER_HARDCODE_LIBPATH
# _LT_CMD_STRIPLIB
# ----------------
m4_defun([_LT_CMD_STRIPLIB],
[m4_require([_LT_DECL_EGREP])
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
])# _LT_CMD_STRIPLIB
# _LT_SYS_DYNAMIC_LINKER([TAG])
# -----------------------------
# PORTME Fill in your ld.so characteristics
m4_defun([_LT_SYS_DYNAMIC_LINKER],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_OBJDUMP])dnl
m4_require([_LT_DECL_SED])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
if test "$GCC" = yes; then
case $host_os in
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
else
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
lt_count++;
} else {
if (lt_count == 0) {
lt_foo="/" $lt_i lt_foo;
} else {
lt_count--;
}
}
}
}
if (lt_foo != "") { lt_freq[[lt_foo]]++; }
if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
}'`
sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi])
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext_cmds=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
need_version=unknown
case $host_os in
aix3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}${shared_ext}$major'
;;
aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
# the line `#! .'. This would cause the generated library to
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[[01]] | aix4.[[01]].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
fi
;;
esac
# AIX (on Power*) has no versioning support, so currently we can not hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
if test "$aix_use_runtimelinking" = yes; then
# If using run time linking (on AIX 4.2 or later) use lib.so
# instead of lib.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
else
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='${libname}${release}.a $libname.a'
soname_spec='${libname}${release}${shared_ext}$major'
fi
shlibpath_var=LIBPATH
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
beos*)
library_names_spec='${libname}${shared_ext}'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi[[45]]*)
version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
;;
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$host_os in
yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
chmod a+x \$dldir/$dlname~
if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
# It is most probably a Windows format PATH printed by
# mingw gcc, but we are running on Cygwin. Gcc prints its search
# path with ; separators, and with drive letters. We can handle the
# drive letters (cygwin fileutils understands them), so leave them,
# especially as we might pass files found there to a mingw objdump,
# which wouldn't understand a cygwinified path. Ahh.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
;;
esac
;;
*)
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
;;
esac
dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
version_type=darwin
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
dgux*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
freebsd1*)
dynamic_linker=no
;;
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
objformat=`/usr/bin/objformat`
else
case $host_os in
freebsd[[123]]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
*) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
esac
;;
gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
version_type=sunos
need_lib_prefix=no
need_version=no
case $host_cpu in
ia64*)
shrext_cmds='.so'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
if test "X$HPUX_IA64_MODE" = X32; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
*)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
;;
interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
version_type=linux
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
hardcode_into_libs=yes
;;
# No shared lib support for Linux oldld, aout, or coff.
linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
[shlibpath_overrides_runpath=yes])])
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
# most powerpc-linux boxes support dynamic linking these days and
# people can always --disable-shared, the test was removed, and we
# assume the GNU/Linux dynamic linker is in use.
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
newsos6)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
*nto* | *qnx*)
version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='ldqnx.so'
;;
openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
openbsd3.3 | openbsd3.3.*) need_version=yes ;;
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[[89]] | openbsd2.[[89]].*)
shlibpath_overrides_runpath=no
;;
*)
shlibpath_overrides_runpath=yes
;;
esac
else
shlibpath_overrides_runpath=yes
fi
;;
os2*)
libname_spec='$name'
shrext_cmds=".dll"
need_lib_prefix=no
library_names_spec='$libname${shared_ext} $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
osf3* | osf4* | osf5*)
version_type=osf
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
rdos*)
dynamic_linker=no
;;
solaris*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
sunos4*)
version_type=sunos
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
if test "$with_gnu_ld" = yes; then
need_lib_prefix=no
fi
need_version=yes
;;
sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
runpath_var=LD_RUN_PATH
;;
siemens)
need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=no
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
sysv4*MP*)
if test -d /usr/nec ;then
version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
version_type=freebsd-elf
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
;;
esac
fi
sys_lib_dlsearch_path_spec='/usr/lib'
;;
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
*)
dynamic_linker=no
;;
esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
fi
if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
_LT_DECL([], [variables_saved_for_relink], [1],
[Variables whose values should be saved in libtool wrapper scripts and
restored at link time])
_LT_DECL([], [need_lib_prefix], [0],
[Do we need the "lib" prefix for modules?])
_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
_LT_DECL([], [version_type], [0], [Library versioning type])
_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
_LT_DECL([], [shlibpath_overrides_runpath], [0],
[Is shlibpath searched before the hard-coded library search path?])
_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
_LT_DECL([], [library_names_spec], [1],
[[List of archive names. First name is the real one, the rest are links.
The last name is the one that the linker finds with -lNAME]])
_LT_DECL([], [soname_spec], [1],
[[The coded name of the library, if different from the real name]])
_LT_DECL([], [postinstall_cmds], [2],
[Command to use after installation of a shared archive])
_LT_DECL([], [postuninstall_cmds], [2],
[Command to use after uninstallation of a shared archive])
_LT_DECL([], [finish_cmds], [2],
[Commands used to finish a libtool library installation in a directory])
_LT_DECL([], [finish_eval], [1],
[[As "finish_cmds", except a single script fragment to be evaled but
not shown]])
_LT_DECL([], [hardcode_into_libs], [0],
[Whether we should hardcode library paths into libraries])
_LT_DECL([], [sys_lib_search_path_spec], [2],
[Compile-time system search path for libraries])
_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
[Run-time system search path for libraries])
])# _LT_SYS_DYNAMIC_LINKER
# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
# find a file program which can recognize shared library
AC_DEFUN([_LT_PATH_TOOL_PREFIX],
[m4_require([_LT_DECL_EGREP])dnl
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
[[\\/*] | ?:[\\/]*])
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="m4_if([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$1; then
lt_cv_path_MAGIC_CMD="$ac_dir/$1"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac])
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
AC_MSG_RESULT($MAGIC_CMD)
else
AC_MSG_RESULT(no)
fi
_LT_DECL([], [MAGIC_CMD], [0],
[Used to examine libraries when file_magic_cmd begins with "file"])dnl
])# _LT_PATH_TOOL_PREFIX
# Old name:
AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
# _LT_PATH_MAGIC
# --------------
# find a file program which can recognize a shared library
m4_defun([_LT_PATH_MAGIC],
[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
_LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
else
MAGIC_CMD=:
fi
fi
])# _LT_PATH_MAGIC
# LT_PATH_LD
# ----------
# find the pathname to the GNU or non-GNU linker
AC_DEFUN([LT_PATH_LD],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
[assume the C compiler uses GNU ld @<:@default=no@:>@])],
[test "$withval" = no || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(lt_cv_path_LD,
[if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
cegcc)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
else
lt_cv_deplibs_check_method=pass_all
fi
;;
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
[lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
lt_cv_deplibs_check_method=pass_all
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
fi
;;
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
*nto* | *qnx*)
lt_cv_deplibs_check_method=pass_all
;;
openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
fi
;;
osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
rdos*)
lt_cv_deplibs_check_method=pass_all
;;
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
;;
sequent)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
;;
sni)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
lt_cv_file_magic_test_file=/lib/libc.so
;;
siemens)
lt_cv_deplibs_check_method=pass_all
;;
pc)
lt_cv_deplibs_check_method=pass_all
;;
esac
;;
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
])
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
_LT_DECL([], [deplibs_check_method], [1],
[Method to check whether dependent libraries are shared objects])
_LT_DECL([], [file_magic_cmd], [1],
[Command to use when deplibs_check_method == "file_magic"])
])# _LT_CHECK_MAGIC_METHOD
# LT_PATH_NM
# ----------
# find the pathname to a BSD- or MS-compatible name lister
AC_DEFUN([LT_PATH_NM],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
tmp_nm="$ac_dir/$lt_tmp_nm"
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
;;
esac
;;
esac
fi
done
IFS="$lt_save_ifs"
done
: ${lt_cv_path_NM=no}
fi])
if test "$lt_cv_path_NM" != "no"; then
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
AC_SUBST([DUMPBIN])
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
fi
fi
test -z "$NM" && NM=nm
AC_SUBST([NM])
_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
[lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&AS_MESSAGE_LOG_FD
(eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&AS_MESSAGE_LOG_FD
(eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
cat conftest.out >&AS_MESSAGE_LOG_FD
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
fi
rm -f conftest*])
])# LT_PATH_NM
# Old names:
AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_PROG_NM], [])
dnl AC_DEFUN([AC_PROG_NM], [])
# LT_LIB_M
# --------
# check for math library
AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, cos, LIBM="-lm")
;;
esac
AC_SUBST([LIBM])
])# LT_LIB_M
# Old name:
AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_CHECK_LIBM], [])
# _LT_COMPILER_NO_RTTI([TAGNAME])
# -------------------------------
m4_defun([_LT_COMPILER_NO_RTTI],
[m4_require([_LT_TAG_COMPILER])dnl
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
if test "$GCC" = yes; then
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
_LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
[-fno-rtti -fno-exceptions], [],
[_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
[Compiler flag to turn off builtin functions])
])# _LT_COMPILER_NO_RTTI
# _LT_CMD_GLOBAL_SYMBOLS
# ----------------------
m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([LT_PATH_NM])dnl
AC_REQUIRE([LT_PATH_LD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_TAG_COMPILER])dnl
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
[
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
# Character class describing NM global symbol codes.
symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
# Define system-specific variables.
case $host_os in
aix*)
symcode='[[BCDT]]'
;;
cygwin* | mingw* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
if test "$host_cpu" = ia64; then
symcode='[[ABCDEGRST]]'
fi
;;
irix* | nonstopux*)
symcode='[[BCDEGRST]]'
;;
osf*)
symcode='[[BCDEGQRST]]'
;;
solaris*)
symcode='[[BDRT]]'
;;
sco3.2v5*)
symcode='[[DT]]'
;;
sysv4.2uw2*)
symcode='[[DT]]'
;;
sysv5* | sco5v6* | unixware* | OpenUNIX*)
symcode='[[ABDT]]'
;;
sysv4)
symcode='[[DFNSTU]]'
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in
*GNU* | *'with BFD'*)
symcode='[[ABCDGIRSTW]]' ;;
esac
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function
# and D for any global variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
" s[1]~/^[@?]/{print s[1], s[1]; next};"\
" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(void);
void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
else
rm -f "$nlist"T
fi
# Make sure that we snagged all the symbols we need.
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
_LT_EOF
# Now generate the symbol file.
eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
void *address;
}
lt__PROGRAM__LTX_preloaded_symbols[[]] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt__PROGRAM__LTX_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_save_LIBS="$LIBS"
lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS="$lt_save_LIBS"
CFLAGS="$lt_save_CFLAGS"
else
echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
fi
else
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
break
else
lt_cv_sys_global_symbol_pipe=
fi
done
])
if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(ok)
fi
_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
[Transform the output of nm in a proper C declaration])
_LT_DECL([global_symbol_to_c_name_address],
[lt_cv_sys_global_symbol_to_c_name_address], [1],
[Transform the output of nm in a C name address pair])
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
]) # _LT_CMD_GLOBAL_SYMBOLS
# _LT_COMPILER_PIC([TAGNAME])
# ---------------------------
m4_defun([_LT_COMPILER_PIC],
[m4_require([_LT_TAG_COMPILER])dnl
_LT_TAGVAR(lt_prog_compiler_wl, $1)=
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)=
AC_MSG_CHECKING([for $compiler option to produce PIC])
m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
mingw* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
else
case $host_os in
aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
chorus*)
case $cc_basename in
cxch68*)
# Green Hills C++ Compiler
# _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
;;
esac
;;
dgux*)
case $cc_basename in
ec++*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
ghcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
if test "$host_cpu" != ia64; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
fi
;;
aCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
;;
*)
;;
esac
;;
interix*)
# This is c89, which is MS Visual C++ (no shared libs)
# Anyone wants to do a port?
;;
irix5* | irix6* | nonstopux*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
# CC pic flag -KPIC is the default.
;;
*)
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
ecpc* )
# old Intel C++ for x86_64 which still supported -KPIC.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
icpc* )
# Intel C++, used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
cxx*)
# Compaq C++
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
xlc* | xlC*)
# IBM XL 8.0 on PPC
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
esac
;;
esac
;;
lynxos*)
;;
m88k*)
;;
mvs*)
case $cc_basename in
cxx*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
;;
*)
;;
esac
;;
netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
;;
RCC*)
# Rational C++ 2.4.1
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
cxx*)
# Digital/Compaq C++
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
;;
esac
;;
psos*)
;;
solaris*)
case $cc_basename in
CC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
gcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
;;
*)
;;
esac
;;
sunos4*)
case $cc_basename in
CC*)
# Sun C++ 4.x
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
lcc*)
# Lucid
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
esac
;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
*)
;;
esac
;;
vxworks*)
;;
*)
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
],
[
if test "$GCC" = yes; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
enable_shared=no
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
aix*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC (with -KPIC) is the default.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# Lahey Fortran 8.1.
lf95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
;;
pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
ccc*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All Alpha code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
xl*)
# IBM XL C 8.0/Fortran 10.1 on PPC
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
*Sun\ F*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
esac
;;
esac
;;
newsos6)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All OSF/1 code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
rdos*)
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
solaris*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
case $cc_basename in
f77* | f90* | f95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
esac
;;
sunos4*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4*MP*)
if test -d /usr/nec ;then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
unicos*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
uts4*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
*)
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
])
case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
;;
esac
AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
[How to pass a linker flag through the compiler])
#
# Check to make sure the PIC flag actually works.
#
if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
_LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
[_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
[$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
[case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
*) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
esac],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
fi
_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
[Additional compiler flags for building library objects])
#
# Check to make sure the static flag actually works.
#
wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
_LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_TAGVAR(lt_prog_compiler_static, $1)=])
_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
[Compiler flag to prevent dynamic linking])
])# _LT_COMPILER_PIC
# _LT_LINKER_SHLIBS([TAGNAME])
# ----------------------------
# See if the linker supports building shared libraries.
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
m4_require([_LT_TAG_COMPILER])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_if([$1], [CXX], [
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_cmds, $1)=
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(old_archive_from_new_cmds, $1)=
_LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
_LT_TAGVAR(thread_safe_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
_LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
# Exclude shared library initialization/finalization symbols.
dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
if test "$with_gnu_ld" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
*\ 2.11.*) ;; # other 2.11 versions
*) supports_anon_versioning=yes ;;
esac
# See if GNU ld supports shared libraries.
case $host_os in
aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
_LT_EOF
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
tmp_addflag=
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
xlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
;;
*)
# For security reasons, it is highly recommended that you always
# use absolute paths for naming shared libraries, and exclude the
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
sunos4*)
_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
runpath_var=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
_LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
_LT_TAGVAR(hardcode_direct, $1)=unsupported
fi
;;
aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
_LT_TAGVAR(archive_cmds, $1)=''
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
_LT_TAGVAR(hardcode_direct, $1)=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=
fi
;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
_LT_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
;;
bsdi[[45]]*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
_LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
dgux*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
freebsd1*)
_LT_TAGVAR(ld_shlibs, $1)=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
hpux9*)
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
fi
;;
hpux11*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
hppa*64*|ia64*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
AC_LINK_IFELSE(int foo(void) {},
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
)
LDFLAGS="$save_LDFLAGS"
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
newsos6)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
else
case $host_os in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
;;
esac
fi
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
os2*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
_LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
wlarc='${wl}'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'. GCC discards it without `$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
if test "$GCC" = yes; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
fi
;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4)
case $host_vendor in
sni)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
_LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
_LT_TAGVAR(hardcode_direct, $1)=no
;;
motorola)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4.3*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
_LT_TAGVAR(ld_shlibs, $1)=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
uts4*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
if test x$host_vendor = xsni; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
;;
esac
fi
fi
])
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
_LT_DECL([], [extract_expsyms_cmds], [2],
[The commands to extract the exported symbol list from a shared archive])
#
# Do we need to explicitly link libc?
#
case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
x|xyes)
# Assume -lc should be added
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $_LT_TAGVAR(archive_cmds, $1) in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
'$CC '*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
_LT_TAGVAR(allow_undefined_flag, $1)=
if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
else
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
fi
_LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
$RM conftest*
AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
;;
esac
fi
;;
esac
_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
[Whether or not to add -lc for building shared libraries])
_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
[enable_shared_with_static_runtimes], [0],
[Whether or not to disallow shared libs when runtime libs are static])
_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
[Compiler flag to allow reflexive dlopens])
_LT_TAGDECL([], [whole_archive_flag_spec], [1],
[Compiler flag to generate shared objects directly from archives])
_LT_TAGDECL([], [compiler_needs_object], [1],
[Whether the compiler copes with passing no objects directly])
_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
[Create an old-style archive from a shared archive])
_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
[Create a temporary old-style archive to link instead of a shared archive])
_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
_LT_TAGDECL([], [archive_expsym_cmds], [2])
_LT_TAGDECL([], [module_cmds], [2],
[Commands used to build a loadable module if different from building
a shared archive.])
_LT_TAGDECL([], [module_expsym_cmds], [2])
_LT_TAGDECL([], [with_gnu_ld], [1],
[Whether we are building with GNU ld or not])
_LT_TAGDECL([], [allow_undefined_flag], [1],
[Flag that allows shared libraries with undefined symbols to be built])
_LT_TAGDECL([], [no_undefined_flag], [1],
[Flag that enforces no undefined symbols])
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
[Flag to hardcode $libdir into a binary during linking.
This must work even if $libdir does not exist])
_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
[[If ld is used when linking, flag to hardcode $libdir into a binary
during linking. This must work even if $libdir does not exist]])
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
[Whether we need a single "-rpath" flag with a separated argument])
_LT_TAGDECL([], [hardcode_direct], [0],
[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
DIR into the resulting binary])
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
"absolute", i.e impossible to change by setting ${shlibpath_var} if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
into the resulting binary])
_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
[Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
into the resulting binary])
_LT_TAGDECL([], [hardcode_automatic], [0],
[Set to "yes" if building a shared library automatically hardcodes DIR
into the library and all subsequent libraries and executables linked
against it])
_LT_TAGDECL([], [inherit_rpath], [0],
[Set to yes if linker adds runtime paths of dependent libraries
to runtime path list])
_LT_TAGDECL([], [link_all_deplibs], [0],
[Whether libtool must link a program against all its dependency libraries])
_LT_TAGDECL([], [fix_srcfile_path], [1],
[Fix the shell variable $srcfile for the compiler])
_LT_TAGDECL([], [always_export_symbols], [0],
[Set to "yes" if exported symbols are required])
_LT_TAGDECL([], [export_symbols_cmds], [2],
[The commands to list exported symbols])
_LT_TAGDECL([], [exclude_expsyms], [1],
[Symbols that should not be listed in the preloaded symbols])
_LT_TAGDECL([], [include_expsyms], [1],
[Symbols that must always be exported])
_LT_TAGDECL([], [prelink_cmds], [2],
[Commands necessary for linking programs (against libraries) with templates])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
dnl [Compiler flag to generate thread safe objects])
])# _LT_LINKER_SHLIBS
# _LT_LANG_C_CONFIG([TAG])
# ------------------------
# Ensure that the configuration variables for a C compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
# the compiler configuration to `libtool'.
m4_defun([_LT_LANG_C_CONFIG],
[m4_require([_LT_DECL_EGREP])dnl
lt_save_CC="$CC"
AC_LANG_PUSH(C)
# Source file extension for C test sources.
ac_ext=c
# Object file extension for compiled C test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'
_LT_TAG_COMPILER
# Save the default compiler, since it gets overwritten when the other
# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
if test -n "$compiler"; then
_LT_COMPILER_NO_RTTI($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
LT_SYS_DLOPEN_SELF
_LT_CMD_STRIPLIB
# Report which library types will actually be built
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_CONFIG($1)
fi
AC_LANG_POP
CC="$lt_save_CC"
])# _LT_LANG_C_CONFIG
# _LT_PROG_CXX
# ------------
# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
# compiler, we have our own version here.
m4_defun([_LT_PROG_CXX],
[
pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
AC_PROG_CXX
if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
(test "X$CXX" != "Xg++"))) ; then
AC_PROG_CXXCPP
else
_lt_caught_CXX_error=yes
fi
popdef([AC_MSG_ERROR])
])# _LT_PROG_CXX
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([_LT_PROG_CXX], [])
# _LT_LANG_CXX_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a C++ compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
# the compiler configuration to `libtool'.
m4_defun([_LT_LANG_CXX_CONFIG],
[AC_REQUIRE([_LT_PROG_CXX])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
AC_LANG_PUSH(C++)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for C++ test sources.
ac_ext=cpp
# Object file extension for compiled C++ test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the CXX compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_caught_CXX_error" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
lt_save_LD=$LD
lt_save_GCC=$GCC
GCC=$GXX
lt_save_with_gnu_ld=$with_gnu_ld
lt_save_path_LD=$lt_cv_path_LD
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
else
$as_unset lt_cv_prog_gnu_ld
fi
if test -n "${lt_cv_path_LDCXX+set}"; then
lt_cv_path_LD=$lt_cv_path_LDCXX
else
$as_unset lt_cv_path_LD
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
if test -n "$compiler"; then
# We don't want -fno-exception when compiling C++ code, so set the
# no_builtin_flag separately
if test "$GXX" = yes; then
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
else
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
if test "$GXX" = yes; then
# Set up default GNU C++ configuration
LT_PATH_LD
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# If archive_cmds runs LD, not CC, wlarc should be empty
# XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
# investigate it a little bit more. (MM)
wlarc='${wl}'
# ancient GNU ld didn't support --whole-archive et. al.
if eval "`$CC -print-prog-name=ld` --help 2>&1" |
$GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
with_gnu_ld=no
wlarc=
# A generic and very simple default shared library creation
# command for GNU C++ for the case where it uses the native
# linker, instead of GNU ld. If possible, this setting should
# overridden to take advantage of the native linker features on
# the platform it is being used on.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
else
GXX=no
with_gnu_ld=no
wlarc=
fi
# PORTME: fill in a description of your system's C++ link characteristics
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
_LT_TAGVAR(ld_shlibs, $1)=yes
case $host_os in
aix3*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
aix_use_runtimelinking=yes
break
;;
esac
done
;;
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
_LT_TAGVAR(archive_cmds, $1)=''
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
if test "$GXX" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
_LT_TAGVAR(hardcode_direct, $1)=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=
fi
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to
# export.
_LT_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an empty
# executable.
_LT_SYS_MODULE_PATH_AIX
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared
# libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
chorus*)
case $cc_basename in
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
cygwin* | mingw* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
dgux*)
case $cc_basename in
ec++*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
ghcx*)
# Green Hills C++ Compiler
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
freebsd[[12]]*)
# C++ shared libraries reported to be fairly broken before
# switch to ELF
_LT_TAGVAR(ld_shlibs, $1)=no
;;
freebsd-elf*)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
gnu*)
;;
hpux9*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
# but as the default
# location of the library.
case $cc_basename in
CC*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aCC*)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
;;
*)
if test "$GXX" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
hpux10*|hpux11*)
if test $with_gnu_ld = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
hppa*64*|ia64*)
;;
*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
esac
fi
case $host_cpu in
hppa*64*|ia64*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
# but as the default
# location of the library.
;;
esac
case $cc_basename in
CC*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aCC*)
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
;;
*)
if test "$GXX" = yes; then
if test $with_gnu_ld = no; then
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
CC*)
# SGI C++
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
# Archives containing C++ object files must be created using
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
;;
*)
if test "$GXX" = yes; then
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
_LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# Archives containing C++ object files must be created using
# "CC -Bstatic", where "CC" is the KAI C++ compiler.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
;;
icpc* | ecpc* )
# Intel C++
with_gnu_ld=yes
# version 8.0 and above of icpc choke on multiply defined symbols
# if we add $predep_objects and $postdep_objects, however 7.1 and
# earlier do not add the objects themselves.
case `$CC -V 2>&1` in
*"Version 7."*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 8.0 or newer
tmp_idyn=
case $host_cpu in
ia64*) tmp_idyn=' -i_dynamic';;
esac
_LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
case `$CC -V` in
*pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
$RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
*) # Version 6 will use weak symbols
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
;;
cxx*)
# Compaq C++
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
runpath_var=LD_RUN_PATH
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
;;
xl*)
# IBM XL 8.0 on PPC, with GNU ld
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
# $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
# would be better.
output_verbose_link_cmd='echo'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
;;
esac
;;
esac
;;
lynxos*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
m88k*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
mvs*)
case $cc_basename in
cxx*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
wlarc=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
fi
# Workaround some broken pre-1.5 toolchains
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
;;
*nto* | *qnx*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
openbsd2*)
# C++ shared libraries are fairly broken
_LT_TAGVAR(ld_shlibs, $1)=no
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd=echo
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
_LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Archives containing C++ object files must be created using
# the KAI C++ compiler.
case $host in
osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
esac
;;
RCC*)
# Rational C++ 2.4.1
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
cxx*)
case $host in
osf3*)
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
;;
*)
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
echo "-hidden">> $lib.exp~
$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
;;
esac
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
;;
*)
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
case $host in
osf3*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
psos*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
sunos4*)
case $cc_basename in
CC*)
# Sun C++ 4.x
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
lcc*)
# Lucid
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
solaris*)
case $cc_basename in
CC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(archive_cmds_need_lc,$1)=yes
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
output_verbose_link_cmd='echo'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
;;
gcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
# The C++ compiler must be used to create the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
;;
*)
# GNU C++ compiler with Solaris linker
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
if $CC --version | $GREP -v '^2\.7' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
else
# g++ 2.7 appears to require `-G' NOT `-shared' on this
# platform.
_LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
;;
esac
fi
;;
esac
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
case $cc_basename in
CC*)
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
case $cc_basename in
CC*)
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
vxworks*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
_LT_TAGVAR(GCC, $1)="$GXX"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_SYS_HIDDEN_LIBDEPS($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
CC=$lt_save_CC
LDCXX=$LD
LD=$lt_save_LD
GCC=$lt_save_GCC
with_gnu_ld=$lt_save_with_gnu_ld
lt_cv_path_LDCXX=$lt_cv_path_LD
lt_cv_path_LD=$lt_save_path_LD
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
fi # test "$_lt_caught_CXX_error" != yes
AC_LANG_POP
])# _LT_LANG_CXX_CONFIG
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
_LT_TAGVAR(predeps, $1)=
_LT_TAGVAR(postdeps, $1)=
_LT_TAGVAR(compiler_lib_search_path, $1)=
dnl we can't use the lt_simple_compile_test_code here,
dnl because it contains code intended for an executable,
dnl not a library. It's possible we should let each
dnl tag define a new lt_????_link_test_code variable,
dnl but it's only used here...
m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
int a;
void foo (void) { a = 0; }
_LT_EOF
], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
_LT_EOF
], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
subroutine foo
implicit none
integer*4 a
a=0
return
end
_LT_EOF
], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
subroutine foo
implicit none
integer a
a=0
return
end
_LT_EOF
], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
public class foo {
private int a;
public void bar (void) {
a = 0;
}
};
_LT_EOF
])
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
# Sentinel used to keep track of whether or not we are before
# the conftest object file.
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
case $p in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
if test $p = "-L" ||
test $p = "-R"; then
prev=$p
continue
else
prev=
fi
if test "$pre_test_object_deps_done" = no; then
case $p in
-L* | -R*)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
_LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
else
_LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
fi
;;
# The "-l" case would never come before the object being
# linked, so don't bother handling this case.
esac
else
if test -z "$_LT_TAGVAR(postdeps, $1)"; then
_LT_TAGVAR(postdeps, $1)="${prev}${p}"
else
_LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
fi
fi
;;
*.$objext)
# This assumes that the test object file only shows up
# once in the compiler output.
if test "$p" = "conftest.$objext"; then
pre_test_object_deps_done=yes
continue
fi
if test "$pre_test_object_deps_done" = no; then
if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
_LT_TAGVAR(predep_objects, $1)="$p"
else
_LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
fi
else
if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
_LT_TAGVAR(postdep_objects, $1)="$p"
else
_LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
fi
fi
;;
*) ;; # Ignore the rest.
esac
done
# Clean up.
rm -f a.out a.exe
else
echo "libtool.m4: error: problem compiling $1 test program"
fi
$RM -f confest.$objext
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
[case $host_os in
interix[[3-9]]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
_LT_TAGVAR(predep_objects,$1)=
_LT_TAGVAR(postdep_objects,$1)=
_LT_TAGVAR(postdeps,$1)=
;;
linux*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
# The more standards-conforming stlport4 library is
# incompatible with the Cstd library. Avoid specifying
# it if it's in CXXFLAGS. Ignore libCrun as
# -library=stlport4 depends on it.
case " $CXX $CXXFLAGS " in
*" -library=stlport4 "*)
solaris_use_stlport4=yes
;;
esac
if test "$solaris_use_stlport4" != yes; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
esac
;;
solaris*)
case $cc_basename in
CC*)
# The more standards-conforming stlport4 library is
# incompatible with the Cstd library. Avoid specifying
# it if it's in CXXFLAGS. Ignore libCrun as
# -library=stlport4 depends on it.
case " $CXX $CXXFLAGS " in
*" -library=stlport4 "*)
solaris_use_stlport4=yes
;;
esac
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
if test "$solaris_use_stlport4" != yes; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
esac
;;
esac
])
case " $_LT_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac
_LT_TAGVAR(compiler_lib_search_dirs, $1)=
if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
_LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
fi
_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
[The directories searched by this compiler when creating a shared library])
_LT_TAGDECL([], [predep_objects], [1],
[Dependencies to place before and after the objects being linked to
create a shared library])
_LT_TAGDECL([], [postdep_objects], [1])
_LT_TAGDECL([], [predeps], [1])
_LT_TAGDECL([], [postdeps], [1])
_LT_TAGDECL([], [compiler_lib_search_path], [1],
[The library search path used internally by the compiler when linking
a shared library])
])# _LT_SYS_HIDDEN_LIBDEPS
# _LT_PROG_F77
# ------------
# Since AC_PROG_F77 is broken, in that it returns the empty string
# if there is no fortran compiler, we have our own version here.
m4_defun([_LT_PROG_F77],
[
pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
AC_PROG_F77
if test -z "$F77" || test "X$F77" = "Xno"; then
_lt_disable_F77=yes
fi
popdef([AC_MSG_ERROR])
])# _LT_PROG_F77
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([_LT_PROG_F77], [])
# _LT_LANG_F77_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a Fortran 77 compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_F77_CONFIG],
[AC_REQUIRE([_LT_PROG_F77])dnl
AC_LANG_PUSH(Fortran 77)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for f77 test sources.
ac_ext=f
# Object file extension for compiled f77 test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the F77 compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_disable_F77" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
return
end
"
# Code to be used in simple link tests
lt_simple_link_test_code="\
program t
end
"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
CC=${F77-"f77"}
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
GCC=$G77
if test -n "$compiler"; then
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_TAGVAR(GCC, $1)="$G77"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
GCC=$lt_save_GCC
CC="$lt_save_CC"
fi # test "$_lt_disable_F77" != yes
AC_LANG_POP
])# _LT_LANG_F77_CONFIG
# _LT_PROG_FC
# -----------
# Since AC_PROG_FC is broken, in that it returns the empty string
# if there is no fortran compiler, we have our own version here.
m4_defun([_LT_PROG_FC],
[
pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
AC_PROG_FC
if test -z "$FC" || test "X$FC" = "Xno"; then
_lt_disable_FC=yes
fi
popdef([AC_MSG_ERROR])
])# _LT_PROG_FC
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([_LT_PROG_FC], [])
# _LT_LANG_FC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for a Fortran compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_FC_CONFIG],
[AC_REQUIRE([_LT_PROG_FC])dnl
AC_LANG_PUSH(Fortran)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for fc test sources.
ac_ext=${ac_fc_srcext-f}
# Object file extension for compiled fc test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the FC compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_disable_FC" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
return
end
"
# Code to be used in simple link tests
lt_simple_link_test_code="\
program t
end
"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
CC=${FC-"f95"}
compiler=$CC
GCC=$ac_cv_fc_compiler_gnu
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
if test -n "$compiler"; then
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_SYS_HIDDEN_LIBDEPS($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
GCC=$lt_save_GCC
CC="$lt_save_CC"
fi # test "$_lt_disable_FC" != yes
AC_LANG_POP
])# _LT_LANG_FC_CONFIG
# _LT_LANG_GCJ_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for the GNU Java Compiler compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_GCJ_CONFIG],
[AC_REQUIRE([LT_PROG_GCJ])dnl
AC_LANG_SAVE
# Source file extension for Java test sources.
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
GCC=yes
CC=${GCJ-"gcj"}
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_TAGVAR(LD, $1)="$LD"
_LT_CC_BASENAME([$compiler])
# GCJ did not exist at the time GCC didn't implicitly link libc in.
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
if test -n "$compiler"; then
_LT_COMPILER_NO_RTTI($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi
AC_LANG_RESTORE
GCC=$lt_save_GCC
CC="$lt_save_CC"
])# _LT_LANG_GCJ_CONFIG
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_RC_CONFIG],
[AC_REQUIRE([LT_PROG_RC])dnl
AC_LANG_SAVE
# Source file extension for RC test sources.
ac_ext=rc
# Object file extension for compiled RC test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
GCC=
CC=${RC-"windres"}
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
if test -n "$compiler"; then
:
_LT_CONFIG($1)
fi
GCC=$lt_save_GCC
AC_LANG_RESTORE
CC="$lt_save_CC"
])# _LT_LANG_RC_CONFIG
# LT_PROG_GCJ
# -----------
AC_DEFUN([LT_PROG_GCJ],
[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
[m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
[AC_CHECK_TOOL(GCJ, gcj,)
test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)])])[]dnl
])
# Old name:
AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
# LT_PROG_RC
# ----------
AC_DEFUN([LT_PROG_RC],
[AC_CHECK_TOOL(RC, windres,)
])
# Old name:
AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_RC], [])
# _LT_DECL_EGREP
# --------------
# If we don't have a new enough Autoconf to choose the best grep
# available, choose the one first in the user's PATH.
m4_defun([_LT_DECL_EGREP],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_REQUIRE([AC_PROG_FGREP])dnl
test -z "$GREP" && GREP=grep
_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
_LT_DECL([], [EGREP], [1], [An ERE matcher])
_LT_DECL([], [FGREP], [1], [A literal string matcher])
dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
AC_SUBST([GREP])
])
# _LT_DECL_OBJDUMP
# --------------
# If we don't have a new enough Autoconf to choose the best objdump
# available, choose the one first in the user's PATH.
m4_defun([_LT_DECL_OBJDUMP],
[AC_CHECK_TOOL(OBJDUMP, objdump, false)
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
AC_SUBST([OBJDUMP])
])
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates
# as few characters as possible. Prefer GNU sed if found.
m4_defun([_LT_DECL_SED],
[AC_PROG_SED
test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"
_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED
m4_ifndef([AC_PROG_SED], [
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
# macro and use it instead. #
m4_defun([AC_PROG_SED],
[AC_MSG_CHECKING([for a sed that does not truncate output])
AC_CACHE_VAL(lt_cv_path_SED,
[# Loop through the user's path and test for sed and gsed.
# Then use that list of sed's as ones to test for truncation.
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
fi
done
done
done
IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
# along with /bin/sed that truncates output.
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
test ! -f $lt_ac_sed && continue
cat /dev/null > conftest.in
lt_ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >conftest.in
# Check for GNU sed and select it if it is found.
if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
lt_cv_path_SED=$lt_ac_sed
break
fi
while true; do
cat conftest.in conftest.in >conftest.tmp
mv conftest.tmp conftest.in
cp conftest.in conftest.nl
echo >>conftest.nl
$lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
cmp -s conftest.out conftest.nl || break
# 10000 chars as input seems more than enough
test $lt_ac_count -gt 10 && break
lt_ac_count=`expr $lt_ac_count + 1`
if test $lt_ac_count -gt $lt_ac_max; then
lt_ac_max=$lt_ac_count
lt_cv_path_SED=$lt_ac_sed
fi
done
done
])
SED=$lt_cv_path_SED
AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])#AC_PROG_SED
])#m4_ifndef
# Old name:
AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_SED], [])
# _LT_CHECK_SHELL_FEATURES
# ------------------------
# Find out whether the shell is Bourne or XSI compatible,
# or has some other useful features.
m4_defun([_LT_CHECK_SHELL_FEATURES],
[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
= c,a/b,, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
AC_MSG_RESULT([$xsi_shell])
_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
AC_MSG_CHECKING([whether the shell understands "+="])
lt_shell_append=no
( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
>/dev/null 2>&1 \
&& lt_shell_append=yes
AC_MSG_RESULT([$lt_shell_append])
_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
fi
_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
A) # ASCII based system
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
lt_SP2NL='tr \040 \012'
lt_NL2SP='tr \015\012 \040\040'
;;
*) # EBCDIC based system
lt_SP2NL='tr \100 \n'
lt_NL2SP='tr \r\n \100\100'
;;
esac
_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
])# _LT_CHECK_SHELL_FEATURES
# _LT_PROG_XSI_SHELLFNS
# ---------------------
# Bourne and XSI compatible variants of some useful shell functions.
m4_defun([_LT_PROG_XSI_SHELLFNS],
[case $xsi_shell in
yes)
cat << \_LT_EOF >> "$cfgfile"
# func_dirname file append nondir_replacement
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
func_dirname ()
{
case ${1} in
*/*) func_dirname_result="${1%/*}${2}" ;;
* ) func_dirname_result="${3}" ;;
esac
}
# func_basename file
func_basename ()
{
func_basename_result="${1##*/}"
}
# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
# call:
# dirname: Compute the dirname of FILE. If nonempty,
# add APPEND to the result, otherwise set result
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
# value retuned in "$func_basename_result"
# Implementation must be kept synchronized with func_dirname
# and func_basename. For efficiency, we do not delegate to
# those functions but instead duplicate the functionality here.
func_dirname_and_basename ()
{
case ${1} in
*/*) func_dirname_result="${1%/*}${2}" ;;
* ) func_dirname_result="${3}" ;;
esac
func_basename_result="${1##*/}"
}
# func_stripname prefix suffix name
# strip PREFIX and SUFFIX off of NAME.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
func_stripname ()
{
# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
# positional parameters, so assign one to ordinary parameter first.
func_stripname_result=${3}
func_stripname_result=${func_stripname_result#"${1}"}
func_stripname_result=${func_stripname_result%"${2}"}
}
# func_opt_split
func_opt_split ()
{
func_opt_split_opt=${1%%=*}
func_opt_split_arg=${1#*=}
}
# func_lo2o object
func_lo2o ()
{
case ${1} in
*.lo) func_lo2o_result=${1%.lo}.${objext} ;;
*) func_lo2o_result=${1} ;;
esac
}
# func_xform libobj-or-source
func_xform ()
{
func_xform_result=${1%.*}.lo
}
# func_arith arithmetic-term...
func_arith ()
{
func_arith_result=$(( $[*] ))
}
# func_len string
# STRING may not start with a hyphen.
func_len ()
{
func_len_result=${#1}
}
_LT_EOF
;;
*) # Bourne compatible functions.
cat << \_LT_EOF >> "$cfgfile"
# func_dirname file append nondir_replacement
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
func_dirname ()
{
# Extract subdirectory from the argument.
func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
if test "X$func_dirname_result" = "X${1}"; then
func_dirname_result="${3}"
else
func_dirname_result="$func_dirname_result${2}"
fi
}
# func_basename file
func_basename ()
{
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
}
dnl func_dirname_and_basename
dnl A portable version of this function is already defined in general.m4sh
dnl so there is no need for it here.
# func_stripname prefix suffix name
# strip PREFIX and SUFFIX off of NAME.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
# func_strip_suffix prefix name
func_stripname ()
{
case ${2} in
.*) func_stripname_result=`$ECHO "X${3}" \
| $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
*) func_stripname_result=`$ECHO "X${3}" \
| $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
esac
}
# sed scripts:
my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
my_sed_long_arg='1s/^-[[^=]]*=//'
# func_opt_split
func_opt_split ()
{
func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
}
# func_lo2o object
func_lo2o ()
{
func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
}
# func_xform libobj-or-source
func_xform ()
{
func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
}
# func_arith arithmetic-term...
func_arith ()
{
func_arith_result=`expr "$[@]"`
}
# func_len string
# STRING may not start with a hyphen.
func_len ()
{
func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
}
_LT_EOF
esac
case $lt_shell_append in
yes)
cat << \_LT_EOF >> "$cfgfile"
# func_append var value
# Append VALUE to the end of shell variable VAR.
func_append ()
{
eval "$[1]+=\$[2]"
}
_LT_EOF
;;
*)
cat << \_LT_EOF >> "$cfgfile"
# func_append var value
# Append VALUE to the end of shell variable VAR.
func_append ()
{
eval "$[1]=\$$[1]\$[2]"
}
_LT_EOF
;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [0], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# Generated from ltversion.in.
# serial 3017 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
m4_define([LT_PACKAGE_REVISION], [1.3017])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.2.6b'
macro_revision='1.3017'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 4 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless `enable' is passed literally.
# For symmetry, `disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# AM_PROG_CC_C_O
# --------------
# Like AC_PROG_CC_C_O, but changed for automake.
AC_DEFUN([AM_PROG_CC_C_O],
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
dnl Make sure AC_PROG_CC is never called again, or it will override our
dnl setting of CC.
m4_define([AC_PROG_CC],
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
ngspice-24/install-sh 0000755 0001750 0001750 00000032537 11712022321 015620 0 ustar sylvestre sylvestre #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
ngspice-24/compile_min.sh 0000644 0001750 0001750 00000006371 11712022254 016445 0 ustar sylvestre sylvestre #!/bin/bash
# ngspice build script for MINGW-w64, release version, 32 or 64 bit
# compile_min.sh
#Procedure:
# Install MSYS, plus bison, flex, auto tools, perl, libiconv, libintl
# Install MINGW-w64, activate OpenMP support
# See either http://mingw-w64.sourceforge.net/ or http://tdm-gcc.tdragon.net/
# (allows to generate either 32 or 64 bit executables by setting flag -m32 or -m64)
# set path to compiler in msys/xx/etc/fstab (e.g. c:/MinGW64 /mingw)
# start compiling with
# './compile_min.sh' or './compile_min.sh 64'
# Options:
# --adms and --enable-adms will install extra HICUM, EKV and MEXTRAM models via the
# adms interface.
# Please see http://ngspice.sourceforge.net/admshowto.html for more info on adms.
# CIDER, XSPICE, and OpenMP may be selected at will.
# --disable-debug will give O2 optimization (versus O0 for debug) and removes all debugging info.
if test "$1" = "64"; then
if [ ! -d "release64" ]; then
mkdir release64
if [ $? -ne 0 ]; then echo "mkdir release64 failed"; exit 1 ; fi
fi
else
if [ ! -d "release" ]; then
mkdir release
if [ $? -ne 0 ]; then echo "mkdir release failed"; exit 1 ; fi
fi
fi
# If compiling sources from CVS, you may need to uncomment the following two lines:
#./autogen.sh
#if [ $? -ne 0 ]; then echo "./autogen.sh failed"; exit 1 ; fi
# Alternatively, if compiling sources from CVS, and want to add adms created devices,
# you may need to uncomment the following two lines (and don't forget to add adms option
# to the ../configure statement):
#./autogen.sh --adms
#if [ $? -ne 0 ]; then echo "./autogen.sh failed"; exit 1 ; fi
# In the following ../configure commands you will find an additional entry to the CFLAGS
# '-fno-omit-frame-pointer'. This entry compensates for a compiler bug of actual mingw gcc 4.6.1.
echo
if test "$1" = "64"; then
cd release64
if [ $? -ne 0 ]; then echo "cd release64 failed"; exit 1 ; fi
echo "configuring for 64 bit"
echo
# You may add --enable-adms to the following command for adding adms generated devices
../configure --with-windows --enable-xspice --enable-cider --enable-openmp --disable-debug prefix="C:/Spice64" CFLAGS="-m64 -fno-omit-frame-pointer" LDFLAGS="-m64"
else
cd release
if [ $? -ne 0 ]; then echo "cd release failed"; exit 1 ; fi
echo "configuring for 32 bit"
echo
# You may add --enable-adms to the following command for adding adms generated devices
../configure --with-windows --enable-xspice --enable-cider --enable-openmp --disable-debug prefix="C:/Spice" CFLAGS="-m32 -fno-omit-frame-pointer" LDFLAGS="-m32"
fi
if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi
echo
# make clean is required for properly making the code models
echo "cleaning (see make_clean.log)"
make clean 2>&1 | tee make_clean.log
exitcode=${PIPESTATUS[0]}
if [ $exitcode -ne 0 ]; then echo "make clean failed"; exit 1 ; fi
echo "compiling (see make.log)"
make 2>&1 | tee make.log
exitcode=${PIPESTATUS[0]}
if [ $exitcode -ne 0 ]; then echo "make failed"; exit 1 ; fi
# 32 bit: Install to C:\Spice
# 64 bit: Install to C:\Spice64
echo "installing (see make_install.log)"
make install 2>&1 | tee make_install.log
exitcode=${PIPESTATUS[0]}
if [ $exitcode -ne 0 ]; then echo "make install failed"; exit 1 ; fi
echo "success"
exit 0
ngspice-24/Makefile.am 0000644 0001750 0001750 00000002633 11712022254 015647 0 ustar sylvestre sylvestre ## Process this file with automake to produce Makefile.in
SUBDIRS = @XGRAPHDIR@ src man tests
DIST_SUBDIRS = @XGRAPHDIR@ src man tests
EXTRA_DIST = FAQ autogen.sh Stuarts_Poly_Notes \
ANALYSES BUGS AUTHORS ChangeLog \
DEVICES NEWS README README.tcl \
README.adms contrib \
doc examples m4 visualc @NOTXGRAPH@ \
xgraph/aclocal.m4 \
compile_min.sh
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
missing mkinstalldirs stamp-h.in ltconfig \
ltmain.sh autom4te.cache \
depcomp ylwrap
ACLOCAL_AMFLAGS = -I m4
dist-hook:
rm -rf `find $(distdir)/contrib -name CVS`
rm -rf `find $(distdir)/patches -name CVS`
rm -rf `find $(distdir)/examples -name CVS`
rm -rf `find $(distdir)/visualc -name CVS`
rm -rf `find $(distdir)/visualc/include -name CVS`
rm -rf `find $(distdir)/xgraph -name .cvsignore`
rm -rf `find $(distdir)/xgraph -name .deps`
rm -rf `find $(distdir)/xgraph -name CVS`
rm -rf `find $(distdir)/xgraph -name config.status`
rm -rf `find $(distdir)/xgraph -name config.log`
rm -rf `find $(distdir)/xgraph -name Makefile`
rm -rf `find $(distdir)/xgraph/bitmaps -name CVS`
rm -rf `find $(distdir)/xgraph/examples -name CVS`
rm -rf `find $(distdir)/unsupported -name CVS`
mrproper: maintainer-clean
rm -f `find . -type f -name "*~" -print`
rm -f `find . -type f -name "*.orig" -print`
rm -f `find . -type f -name "*.rej" -print`
ngspice-24/configure 0000755 0001750 0001750 00002072076 11712022335 015534 0 ustar sylvestre sylvestre #! /bin/sh
# From configure.ac Revision.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.67 for ngspice 24.
#
# Report bugs to | |