mozart-stdlib-20060615/0000755000175000017500000000000010446620511014101 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/0000755000175000017500000000000010444200427016672 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/adt/0000755000175000017500000000000010444200427017442 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/adt/Cell.oz0000644000175000017500000000060607410210737020701 0ustar kevingkevingfunctor export New prepare fun {CellPack C} fun {CellGet} {Access C} end proc {CellPut V} {Assign C V} end proc {CellGetPut V1 V2} {Exchange C V1 V2} end fun {CellClone} {CellPack {NewCell {Access C}}} end in cell( get : CellGet put : CellPut getPut : CellGetPut clone : CellClone) end fun {New V} {CellPack {NewCell V}} end endmozart-stdlib-20060615/mozart-stdlib/adt/Counter.oz0000644000175000017500000000144407410210737021442 0ustar kevingkevingfunctor export New NewFromInt prepare fun {CounterPack C} fun {CounterGet } {Access C } end proc {CounterPut I} {Assign C I} end proc {CounterGetPut I1 I2} {Exchange C I1 I2} end fun {CounterNext} I1 I2 in {Exchange C I1 I2} I2=I1+1 I1 end proc {CounterPlus I} I1 I2 in {Exchange C I1 I2} I2=I1+I end proc {CounterTimes I} I1 I2 in {Exchange C I1 I2} I2=I1*I end fun {CounterClone} {NewFromInt {Access C}} end in counter( get : CounterGet put : CounterPut getPut : CounterGetPut next : CounterNext plus : CounterPlus times : CounterTimes clone : CounterClone) end fun {NewFromInt I} {CounterPack {NewCell I}} end fun {New} {NewFromInt 1} end end mozart-stdlib-20060615/mozart-stdlib/adt/Dictionary.oz0000644000175000017500000000251607410210737022131 0ustar kevingkevingfunctor export New NewFromRecord prepare RemoveAll = Dictionary.removeAll Keys = Dictionary.keys Items = Dictionary.items Entries = Dictionary.entries IsEmpty = Dictionary.isEmpty Remove = Dictionary.remove Member = Dictionary.member Clone = Dictionary.clone ToRecord = Dictionary.toRecord ToDict = Record.toDictionary fun {DictPack D} fun {DictGet K } D.K end proc {DictPut K V} D.K := V end fun {DictCondGet K V} {CondSelect D K V} end proc {DictReset } {RemoveAll D} end fun {DictKeys } {Keys D} end fun {DictItems } {Items D} end fun {DictEntries } {Entries D} end fun {DictIsEmpty } {IsEmpty D} end proc {DictRemove K } {Remove D K} end fun {DictMember K } {Member D K} end fun {DictClone } {DictPack {Clone D}} end fun {DictToRecord L } {ToRecord L D} end in dictionary( get : DictGet put : DictPut condGet : DictCondGet reset : DictReset keys : DictKeys items : DictItems entries : DictEntries isEmpty : DictIsEmpty remove : DictRemove member : DictMember clone : DictClone toRecord : DictToRecord) end fun {New} {DictPack {NewDictionary}} end fun {NewFromRecord R} {DictPack {ToDict R}} end endmozart-stdlib-20060615/mozart-stdlib/adt/Generator.oz0000644000175000017500000000614607415337030021756 0ustar kevingkevingfunctor export Concat Tails Count Member Keys Items Entries prepare %% create a new generator that is the concatenation of a list %% of generators fun {Concat Gs} C={NewCell Gs} fun {ConcatGenerator} case {Access C} of nil then raise empty end [] G|Gs then try {G} catch E then case E of error(...) then raise E end [] failure(...) then raise E end else {Assign C Gs} {ConcatGenerator} end end end end in ConcatGenerator end %% generator for all non-empty tails of a list fun {Tails L} C={NewCell L} fun {TailsGenerator} New in case {Exchange C $ New} of nil then New=nil raise empty end [] H|T then New=T H end end in TailsGenerator end %% counting generator. the direction of counting (up or %% down) is given by the 3rd argument (the step). fun {Count From To By} if To==unit then {NewCountGenerator From By} elseif By<0 then {NewCountDownGenerator From To By} else {NewCountUpGenerator From To By} end end fun {NewCountGenerator From By} C={NewCell From} fun {CountGenerator} Old New in {Exchange C Old New} New=Old+By Old end in CountGenerator end fun {NewCountUpGenerator From To By} C={NewCell From} fun {CountUpGenerator} Old New in {Exchange C Old New} if Old>To then New=Old raise empty end else New=Old+By Old end end in CountUpGenerator end fun {NewCountDownGenerator From To By} C={NewCell From} fun {CountDownGenerator} Old New in {Exchange C Old New} if Old Mozart Standard Library: Functional Cells

Functional Cells

Denys Duchier

module
x-oz://system/adt/Cell.ozf

This is a functional wrapper around the standard cell datatype.

Exports

The module exports only one function: a New constructor

{Cell.new V}
creates a new instance of a functional cell, initialized with value V.

Instance API

Each functional cell instance C has the following features:

{C.get ?V}
return the current value V of C
{C.put V}
set the current value of C to V
{C.getPut Old New}
atomically, gets the current value Old of C and replaces it with New
{C.clone ?C2}
returns a new functional cell instance, initialized with C's current value

mozart-stdlib-20060615/mozart-stdlib/adt/counter.html0000644000175000017500000000477510052245725022031 0ustar kevingkeving Mozart Standard Library: Functional Counters

Functional Counters

Denys Duchier

module
x-oz://system/adt/Counter.ozf

This module provides a functional interface for counters

Exports

The modules exports 2 constructors:

{Counter.newFromInt +I ?C}
returns a new functional counter instance, initialized to integer value I
{Counter.new ?C}
return a new functional counter instance, initialized to 1

Instance API

Each functional counter instance C has the following features:

{C.get ?I}
returns the current value I of C
{C.put +I}
sets the current value of C to I
{C.getPut Old New}
atomically gets the current value Old of C and sets it to the new value New
{C.next ?I}
returns the current value I of C and increments the counter
{C.plus +N}
increments C by N
{C.times +N}
multiplies the content of C by N
{C.clone ?C2}
returns a new counter C2 currently holding the same integer value as C

mozart-stdlib-20060615/mozart-stdlib/adt/dictionary.html0000644000175000017500000000614410437034374022512 0ustar kevingkeving Mozart Standard Library: Functional Dictionaries

Functional Dictionaries

Denys Duchier

module
x-oz://system/adt/Dictionary.ozf

This module provides functional interface for dictionaries

Exports

The module exports the following constructors:

{Dictionary.new ?D}
returns a new empty functional dictionary D
{Dictionary.newFromRecord +R ?D}
returns a new functional dictionary D initialized using the key/value mapping provided by record R

Instance API

Each functional dictionary instance D has the following features:

{D.get +Key ?Value}
returns the Value for the given Key, or raises an exception if none
{D.put +Key +Value}
sets the Value for the given Key
{D.condGet +Key +Default ?Value}
returns the Value for the given Key, or the Default if none
{D.reset}
remove all entries
{D.keys ?L}
returns the list L of all keys in D
{D.items ?L}
returns the list L of all values in D
{D.entries ?L}
returns the list L of all pairs Key#Values for entries in D
{D.isEmpty ?B}
returns true iff D is empty
{D.remove +Key}
remove the entry for Key if any
{D.member +Key ?B}
returns true iff there is an entry for Key
{D.clone ?D2}
returns a new functional dictionary instance D2 that is a clone of D
{D.toRecord +L ?R}
return the current entries in D in the form of a record R with label L

mozart-stdlib-20060615/mozart-stdlib/adt/generator.html0000644000175000017500000000544210052245725022330 0ustar kevingkeving Mozart Standard Library: Generators

Generators

Denys Duchier

module
x-oz://system/adt/Generators.ozf

This module provides very experimental support for generators. Generators can be used in the for loop with the from keywords. Be warned that this design could very well change in the future.

Exports

{Generator.concat [G1 ... Gn] ?G}
creates a new generator G which is the concatenation of generators G1 through Gn
{Generator.tails +L ?G}
creates a generator G that produces all non-empty tails of list L
{Generator.count +From +To +By ?G}
creates a generator G that produces all integers starting at From and ending at most at To by steps of By. Whether we count up or down depends on the sign of By
{Generator.member +L ?G}
creates a generator G that produces the elements of list L
{Generator.keys +M ?G}
creates a generator G that produces the keys of mapping M. The latter can be a record, an array, or a dictionary.
{Generator.items +M ?G}
creates a generator G that produces the values of mapping M. The latter can be a record, an array, or a dictionary.
{Generator.entries +M ?G}
creates a generator G that produces the entries of mapping M. The latter can be a record, an array, or a dictionary.

mozart-stdlib-20060615/mozart-stdlib/adt/index.html0000644000175000017500000000351110052517363021444 0ustar kevingkeving Mozart Standard Library

Abstract Datatypes

Denys Duchier


In this section of the standard library, you'll find convenient abstract datatypes such as stacks and queues, and functional wrappers for standard datatypes such as cell and dictionaries.


mozart-stdlib-20060615/mozart-stdlib/adt/makefile.oz0000644000175000017500000000044110052517363021575 0ustar kevingkevingmakefile( uri : 'x-oz://system/adt' lib : ['Stack.ozf' 'Queue.ozf' 'Counter.ozf' 'Dictionary.ozf' 'Cell.ozf' %%'Generator.ozf' ] doc : [ 'index.html' 'cell.html' 'counter.html' 'dictionary.html' %%'generator.html' 'queue.html' 'stack.html' ] ) mozart-stdlib-20060615/mozart-stdlib/adt/queue.html0000644000175000017500000000607710052245725021473 0ustar kevingkeving Mozart Standard Library: Functional Queues

Functional Queues

Denys Duchier

module
x-oz://system/adt/Queue.ozf

This module provides a functional implemention of queues

Exports

The modules exports the following constructors:

{Queue.new ?Q}
returns a new functional queue instance Q, currently empty
{Queue.newFromList +L ?Q}
returns a new functional queue instance Q, initialized with the elements of list L

Instance API

Each functional queue instance Q has the following features:

{Q.get ?V}
returns the next value V available from Q, or raises exception empty if none
{Q.put +V}
enters a new value V into the queue
{Q.getPut ?Old +New}
atomically, gets the next value Old available from Q and enters the value New. If Q was empty, New is Old and Q is still empty
{Q.top ?V}
returns the next value V available from Q without actually removing it from Q
{Q.toList ?L}
returns the list L of all values in Q
{Q.toListKill ?L}
returns the list L of all values in Q and makes Q unusable until a subsequent {Q.reset}. This is more efficient that {Q.toList ?L} because no copy is required
{Q.isEmpty ?B}
returns true iff Q is empty
{Q.reset}
discards Q's content and resets it to an empty queue
{Q.clone ?Q2}
returns a new functional queue instance Q2 which is a clone of Q

mozart-stdlib-20060615/mozart-stdlib/adt/stack.html0000644000175000017500000000573010052245725021447 0ustar kevingkeving Mozart Standard Library: Functional Stacks

Functional Stacks

Denys Duchier

module
x-oz://system/adt/Stack.ozf

This module provides a functional implementation of stacks

Exports

The module exports the following constructors:

{Stack.new ?S}
returns a new functional stack instance S, currently empty
{Stack.newFromList +L ?S}
returns a new functional stack instance S initialized with the elements of list L

Instance API

Each functional stack instance S has the following features:

{S.get ?V}
returns the next value V available from S, or raises exception empty if none
{S.put +V}
pushes a new value V onto the stack
{S.getPut ?Old +New}
atomically, gets the next value Old available from S and pushes the value New. If S was empty, New is Old and S is still empty
{S.top ?V}
returns the value V available on top of S without actually removing it
{S.toList ?L}
returns the list L of all values in S
{S.toListKill ?L}
returns the list L of all values in S and makes S unusable until a subsequent {S.reset}.
{S.isEmpty ?B}
returns true iff S is empty
{S.reset}
discards S's content and resets it to an empty stack
{S.clone ?S2}
returns a new functional queue instance S2 which is a clone of S

mozart-stdlib-20060615/mozart-stdlib/net/0000755000175000017500000000000010444200427017460 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/net/Message.oz0000644000175000017500000000161310051763532021424 0ustar kevingkevingfunctor export 'class' : Message import MessageParser at 'MessageParser.ozf' prepare ToLower = Char.toLower S2A = String.toAtom define class Message from MessageParser.'class' attr headers HeadersTail body meth init(L eol:EOL<=[crlf lf]) {self acceptCRLF({Member crlf EOL})} {self acceptLF( {Member lf EOL})} {self acceptCR( {Member cr EOL})} local L in headers <- L HeadersTail <- L body <- nil end {self parse(L)} end meth messageHeader(Header Value) L in (( {self messageHeaderTag(Header $)} # {self messageHeaderValue(Value $)} ) |L) = (HeadersTail<-L) end meth messageBody(L) body<-L end meth messageEnd() @HeadersTail=nil end meth messageHeaderTag(Header $) {S2A {Map Header ToLower}} end meth messageHeaderValue(Value $) Value end end end mozart-stdlib-20060615/mozart-stdlib/net/MessageParser.oz0000644000175000017500000000466110051763532022607 0ustar kevingkevingfunctor export 'class' : MessageParser prepare IsSpace = Char.isSpace fun {DropInitialSpaces L} case L of H|T andthen (H==& orelse H==&\t) then {DropInitialSpaces T} else L end end class MessageParser attr AcceptCRLF : false AcceptLF : false AcceptCR : false meth acceptCRLF(B) AcceptCRLF<-B end meth acceptLF( B) AcceptLF <-B end meth acceptCR( B) AcceptCR <-B end meth messageStart() skip end meth messageEnd() skip end meth messageHeader(Header Value) skip end meth messageBody() skip end meth parse(L) {self messageStart} MessageParser,MaybeHeader(L) {self messageEnd} end meth EOL(L $) case L of &\r|&\n|L andthen @AcceptCRLF then L [] &\r |L andthen @AcceptCR then L [] &\n|L andthen @AcceptLF then L else unit end end meth MaybeHeader(L) if L==nil then skip elsecase MessageParser,EOL(L $) of unit then H in MessageParser,Header(L H H) [] L then {self messageBody(L)} end end meth Header(L Head Tail) case L of H|T then if H==&: then V in Tail=nil MessageParser,AfterSemiColon( {DropInitialSpaces T} Head V V) elseif {IsSpace H} then Tail=nil MessageParser,AfterHeader(T Head) else Tail2 in Tail=(H|Tail2) MessageParser,Header(T Head Tail2) end else raise messageParser(unexpectedEndOfMessage) end end end meth AfterHeader(L Header) case L of H|T then if H==&: then H in MessageParser,AfterSemiColon( {DropInitialSpaces T} Header H H) elseif {IsSpace H} then MessageParser,AfterHeader(T Header) else raise messageParser(expectedSpaceOrSemiColon:L) end end else raise messageParser(unexpectedEndOfMessage) end end end meth AfterSemiColon(L Header Value Tail) case MessageParser,EOL(L $) of unit then case L of H|T then Tail2 in Tail=(H|Tail2) MessageParser,AfterSemiColon(T Header Value Tail2) else Tail=nil {self messageHeader(Header Value)} end [] L then case L of H|T andthen (H==& orelse H==&\t) then Tail2 in Tail=(H|Tail2) MessageParser,AfterSemiColon(T Header Value Tail2) else Tail=nil {self messageHeader(Header Value)} MessageParser,MaybeHeader(L) end end end end endmozart-stdlib-20060615/mozart-stdlib/net/URL.oz0000644000175000017500000003512510047162470020506 0ustar kevingkevingfunctor export 'class' : URLClass Is Make prepare VS2S = VirtualString.toString VS2A = VirtualString.toAtom ToTuple = List.toTuple ToRecord = List.toRecord Tokens = String.tokens Token = String.token CharIsAlNum = Char.isAlNum ToLower = Char.toLower IS_URL = {NewName} fun {Is X} {HasFeature X IS_URL} end %% a url may contain occurrences of %XY escape sequences %% Here is how to decode them local D = x(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7 &8:8 &9:9 &a:10 &b:11 &c:12 &d:13 &e:14 &f:15 &A:10 &B:11 &C:12 &D:13 &E:14 &F:15) in fun {Decode L} case L of nil then nil [] H|T then if H==&% then case T of X1|X2|T then (D.X1*16)+D.X2 | {Decode T} else H | {Decode T} end else H | {Decode T} end end end end proc {SplitAt S Pred Prefix Sep Suffix} case S of nil then Prefix=Suffix=nil Sep=unit [] H|T then if {Pred H} then Prefix=nil Sep=H Suffix=T else More in Prefix=H|More {SplitAt T Pred More Sep Suffix} end end end fun {SepStart C} C==&: orelse C==&/ orelse C==&\\ orelse C==&? orelse C==&# orelse C==&{ end fun {SepAuthority C} C==&/ orelse C==&\\ orelse C==&? orelse C==&# orelse C==&{ end SepPath = SepAuthority fun {SepQuery C} C==&# orelse C==&{ end fun {SepFragment C} C==&{ end fun {Parse S} {ParseFromString {VS2S S}} end URL_EMPTY = url(scheme : unit authority : unit device : unit absolute : false path : nil query : unit fragment : unit info : unit) fun {ParseFromString S} {ParseStart S URL_EMPTY} end fun {ParseStart S U} Prefix Sep Suffix in {SplitAt S SepStart Prefix Sep Suffix} case Sep of unit then {AdjoinAt U path [{Decode Prefix}]} [] &: then case Prefix of [C] then U2 = {AdjoinAt U device C} in case Suffix of H|T then if H==&/ orelse H==&\\ then {ParsePath T nil {AdjoinAt U2 absolute true}} else {ParseDevice Suffix U2} end [] nil then U2 end else U2 = {AdjoinAt U scheme Prefix} in case Suffix of &/|&/|T then {ParseAuthority T U2} [] &/ |T then {ParsePath T nil {AdjoinAt U2 absolute true}} else {ParseDevice Suffix U2} end end [] &/ then case Prefix of nil then case Suffix of &/|T then {ParseAuthority T U} else {ParsePath Suffix nil {AdjoinAt U absolute true}} end else {ParsePath Suffix [{Decode Prefix}] U} end [] &\\ then case Prefix of nil then {ParsePath Suffix nil {AdjoinAt U absolute true}} else {ParsePath Suffix [{Decode Prefix}] U} end [] &? then {ParseQuery Suffix if Prefix==nil then U else {AdjoinAt U path [{Decode Prefix}]} end} [] &# then {ParseFragment Suffix if Prefix==nil then U else {AdjoinAt U path [{Decode Prefix}]} end} [] &{ then {ParseInfo Suffix if Prefix==nil then U else {AdjoinAt U path [{Decode Prefix}]} end} end end fun {ParseAuthority S U} Prefix Sep Suffix {SplitAt S SepAuthority Prefix Sep Suffix} U2 = {AdjoinAt U authority Prefix} in case Sep of unit then U2 [] &/ then {ParsePath Suffix nil {AdjoinAt U2 absolute true}} [] &\\ then {ParsePath Suffix nil {AdjoinAt U2 absolute true}} [] &? then {ParseQuery Suffix U2} [] &# then {ParseFragment Suffix U2} [] &{ then {ParseInfo Suffix U2} end end fun {ParseDevice S U} case S of C|&:|T then {ParsePath T nil {AdjoinAt U device C}} else {ParsePath S nil U} end end fun {ParsePath S L U} Prefix Sep Suffix {SplitAt S SepPath Prefix Sep Suffix} COM={Decode Prefix} L2 = case COM of "." then if L==nil then [COM] else L end [] ".." then case L of nil then [COM] [] ["."] then [COM] [] [_] then COM|L else L.2 end else COM|L end in case Sep of unit then {AdjoinAt U path {Reverse L2}} [] &/ then {ParsePath Suffix L2 U} [] &\\ then {ParsePath Suffix L2 U} [] &? then {ParseQuery Suffix {AdjoinAt U path {Reverse L2}}} [] &# then {ParseFragment Suffix {AdjoinAt U path {Reverse L2}}} [] &{ then {ParseInfo Suffix {AdjoinAt U path {Reverse L2}}} end end fun {ParseQuery S U} Prefix Sep Suffix {SplitAt S SepQuery Prefix Sep Suffix} U2 = {AdjoinAt U query Prefix} in case Sep of unit then U2 [] &# then {ParseFragment Suffix U2} [] &{ then {ParseInfo Suffix U2} end end fun {ParseFragment S U} Prefix Sep Suffix {SplitAt S SepFragment Prefix Sep Suffix} U2 = {AdjoinAt U fragment Prefix} in if Sep==unit then U2 else {ParseInfo Suffix U2} end end fun {ParseInfo S U} case {Reverse S} of &}|L then {AdjoinAt U info {ToRecord info {Map {Tokens {Reverse L} &,} ParseInfoElem}}} end end fun {ParseInfoElem S} Prop Value in {Token S &= Prop Value} {VS2A Prop}#{VS2A Value} end %% URLToVS converts a url to a virtual string. The 2nd argument is %% a record whose features parametrize the conversion process. %% `full:true' %% indicates that full information is desired, including #FRAGMENT %% and {INFO} sections. Normally, the #FRAGMENT indicator is %% intended only for client-side usage. Similarly, but even more %% so, the {INFO} section is a Mozart extension, where, for %% example, it is indicated whether the url denotes a native %% functor or not. Thus, neither should be included when %% constructing a url for retrieval. %% `cache:true' %% indicates that a syntax appropriate for cache lookup is desired. %% the `:' after the scheme and the '//' before the authority are %% in both cases replaced by a single `/'. %% `raw:true' %% indicates that no encoding should take place, i.e. special url %% characters are not escaped. %% `normalized:true' %% indicates that scheme, device and authority should be lowercased fun {URLToVS U How} Full = {CondSelect How full false} Cache = {CondSelect How cache false} Raw = {CondSelect How raw false} Normalized= {CondSelect How normalized false} CompAdd = if Cache then if Raw then CompAdd_c_raw else CompAdd_c_enc end else if Raw then CompAdd_raw else CompAdd_enc end end Scheme0 = {CondSelect U scheme unit} Scheme = if Normalized andthen Scheme0\=unit then {Map Scheme0 ToLower} else Scheme0 end Device0 = {CondSelect U device unit} Device = if Normalized andthen Device0\=unit then {ToLower Device0} else Device0 end Authority0= {CondSelect U authority unit} Authority = if Normalized andthen Authority0\=unit then {Map Authority0 ToLower} else Authority0 end Absolute = {CondSelect U absolute false} Path = {CondSelect U path nil} Query = {CondSelect U query unit} Fragment = if Full then {CondSelect U fragment unit} else unit end Info = if Full then {CondSelect U info unit} else unit end %% V1 = if Full andthen Info\=unit then {InfoPropsAdd {Record.toListInd Info} ['}'] true} else nil end V2 = if Full andthen Fragment\=unit then "#"|Fragment|V1 else V1 end V3 = if Query==unit then V2 else '?'|Query|V2 end V4 = {Append %% yes we want the nil here otherwise %%Slashit adds an erroneous slash {FoldR Path CompAdd nil} V3} V5 = if Absolute then {Slashit V4} else V4 end V6 = if Device==unit then V5 else [Device] |if Cache then {Slashit V5} else ':'|V5 end end V7 = if Authority==unit then V6 elseif Cache then if Authority==nil then V6 else Authority|{Slashit V6} end else '/'|'/'|Authority|{Slashit V6} end V8 = if Scheme==unit then V7 elseif Cache then Scheme|{Slashit V7} else Scheme|':'|V7 end in {ToTuple '#' V8} end fun {Slashit L} case L of nil then nil [] '/'|_ then L else '/'|L end end fun {InfoPropsAdd L Rest First} case L of nil then '{'|Rest [] (K#V)|T then {InfoPropsAdd T K|'='|V|if First then Rest else ','|Rest end false} end end fun {CompAdd_raw H L} H|{Slashit L} end fun {CompAdd_enc H L} {Encode H}|{Slashit L} end fun {CompAdd_c_raw H L} if H==nil then L else H|{Slashit L} end end fun {CompAdd_c_enc H L} if H==nil then L else {Encode H}|{Slashit L} end end fun {URLIsAbsolute U} {CondSelect U scheme unit}\=unit orelse {CondSelect U device unit}\=unit orelse {CondSelect U absolute false} orelse case {CondSelect U path nil} of (&~|_)|_ then true [] "." |_ then true [] ".." |_ then true else false end end %% resolving a relative url with respect to a base url fun {URLResolve Base Rel} if {CondSelect Rel scheme unit}\=unit then Rel else Scheme = {CondSelect Base scheme unit} Rel2 = if Scheme==unit then Rel else {AdjoinAt Rel scheme Scheme} end in if {CondSelect Rel2 authority unit}\=unit then Rel2 else Authority = {CondSelect Base authority unit} Rel3 = if Authority==unit then Rel2 else {AdjoinAt Rel2 authority Authority} end in if {CondSelect Rel3 device unit}\=unit then Rel3 else Device = {CondSelect Base device unit} Rel4 = if Device==unit then Rel3 else {AdjoinAt Rel3 device Device} end BPath = {CondSelect Base path unit} RAbs = {CondSelect Rel4 absolute false} in if RAbs orelse BPath==unit then Rel4 else Rel5 = if {CondSelect Base absolute false} then {AdjoinAt Rel4 absolute true} else Rel4 end RPath = {CondSelect Rel path nil} in {AdjoinAt Rel5 path {ResolvePaths BPath if RPath==unit orelse RPath==nil then [nil] else RPath end}} end end end end end fun {ResolvePaths Base Rel} {ResolvePathsX {SkipEmpties {Reverse Base}} Rel} end fun {SkipEmpties L} case L of nil|L then {SkipEmpties L} else L end end fun {ResolvePathsX Base Rel} case Rel of nil then {Reverse Base} [] H|T then case H of "." then {ResolvePathsX if Base==nil then [H] else Base end T} [] ".." then {ResolvePathsX case Base of nil then [H] [] ["."] then [H] [] [_] then H|Base else Base.2 end T} else {ResolvePathsX H|Base T} end end end %% for producing really normalized url vstrings, we need to encode %% its components. Encode performs the `escape encoding' of a %% string (e.g. a single path component). local D = x(0:&0 1:&1 2:&2 3:&3 4:&4 5:&5 6:&6 7:&7 8:&8 9:&9 10:&a 11:&b 12:&c 13:&d 14:&e 15:&f) in fun {Encode S} case S of nil then nil [] H|T then %% check that it is an `ascii' alphanum if H<128 andthen {CharIsAlNum H} orelse H==&; orelse H==&- orelse H==&_ orelse H==&. orelse H==&! orelse H==&~ orelse H==&* orelse H==&' orelse H==&( orelse H==&) orelse H==&: orelse H==&@ orelse H==&& orelse H==&= orelse H==&+ orelse H==&$ orelse H==&, then H|{Encode T} else X1 = H div 16 X2 = H mod 16 in &%|D.X1|D.X2|{Encode T} end end end end import Path at 'x-oz://system/os/Path.ozf' define fun {Make X} if {Is X} then X else {New URLClass init(X)} end end class URLClass feat !IS_URL:unit attr info meth INIT(R) info <- R end meth GetInfo($) @info end meth init(S) URLClass,INIT({Parse S}) end meth toVS($ full : FULL <=false cache : CACHE <=false raw : RAW <=false normalized : NORM <=false) {URLToVS @info unit(full:FULL cache:CACHE raw:RAW normalized:NORM)} end meth toString($ full : FULL <=false cache : CACHE <=false raw : RAW <=false normalized : NORM <=false) {VS2S URLClass,toVS($ full:FULL cache:CACHE raw:RAW normalized:NORM)} end meth toAtom($ full : FULL <=false cache : CACHE <=false raw : RAW <=false normalized : NORM <=false) {VS2A URLClass,toVS($ full:FULL cache:CACHE raw:RAW normalized:NORM)} end meth isAbsolute($) {URLIsAbsolute @info} end meth isRelative($) {Not {URLIsAbsolute @info}} end meth resolve(U $) {New URLClass INIT({URLResolve @info {{Make U} GetInfo($)}})} end meth isRoot($) @info.path == nil end meth dirname($) case {Reverse @info.path} of nil then self [] _|T then {New URLClass INIT({AdjoinAt @info path {Reverse T}})} end end meth basename($) {New URLClass INIT( case {Reverse @info.path} of nil then URL_EMPTY [] H|_ then {AdjoinAt URL_EMPTY path [H]} end)} end meth getScheme($) @info.scheme end meth getAuthority($) @info.authority end meth getDevice($) @info.device end meth getAbsolute($) @info.absolute end meth getPath($) @info.path end meth getQuery($) @info.query end meth getFragment($) @info.fragment end meth getInfo($) @info.info end meth normalized($) Scheme = @info.scheme Device = @info.device Authority = @info.authority SCHEME = if Scheme==unit then unit else {Map Scheme ToLower} end DEVICE = if Device==unit then unit else {ToLower Device} end AUTHORITY = if Authority==unit then unit else {Map Authority ToLower} end in if Scheme==SCHEME andthen Device==DEVICE andthen Authority==AUTHORITY then self else {New URLClass INIT({Adjoin @info url(scheme:SCHEME device:DEVICE authority:AUTHORITY)})} end end meth toPath($ windows:WIN<=false) S1 = {FoldL @info.path fun {$ Accu Comp} if Accu==nil then Comp else Accu#'/'#Comp end end nil} S2 = if URLClass,getAbsolute($) then '/'#S1 else S1 end WIN2 S3 = case URLClass,getDevice($) of unit then WIN2=WIN S2 [] C then WIN2=true [C]#S2 end in {New Path.'class' init(S3 windows:WIN2)} end end end mozart-stdlib-20060615/mozart-stdlib/net/index.html0000644000175000017500000000270010052245725021461 0ustar kevingkeving Mozart Standard Library: Network Support

Network Support

Denys Duchier

module
x-oz://system/net/URL.ozf

In this section of the library, you'll find convenient network-related support

mozart-stdlib-20060615/mozart-stdlib/net/makefile.oz0000644000175000017500000000010610052245725021611 0ustar kevingkevingmakefile( lib : ['URL.ozf'] doc : ['index.html' 'url.html'] )mozart-stdlib-20060615/mozart-stdlib/net/url.html0000644000175000017500000001102010052245725021147 0ustar kevingkeving Mozart Standard Library: URL

URL Support

Denys Duchier

module
x-oz://system/net/URL.ozf

This module provides an object-oriented API for URLs

Exports

The module exports a constructor and a test:

{URL.make +VS ?U}
returns a new instance U of a URL object, given a virtual string VS. If VS is actually already a URL object then it is simply returned
{URL.is +X ?B}
returns true iff X is an instance of a URL object

Instance API

Each URL object U has the following methods:

{U init(S)}
initializes U given a string S
{U toVS( $ full:FULL<=false cache:CACHE<=false raw:RAW<=false normalized:NORM<=false)}
{U toString($ full:FULL<=false cache:CACHE<=false raw:RAW<=false normalized:NORM<=false)}
{U toAtom( $ full:FULL<=false cache:CACHE<=false raw:RAW<=false normalized:NORM<=false)}
returns respectively a virtual string, a string, or an atom for the textual representation of the URL.
full:true
indicates that full information is desired, including the possible #FRAGMENT and {INFO} sections of the URL. Normally, these are omitted.
cache:true
indicates that a syntax appropriate for cache lookup is desired. The : after the schme and the // before the authority are both replaced by a single /
raw:true
indicates that no encoding should take place, i.e. special url characters are not % encoded
normalized:true
indicates that the scheme, device and authority should all be lowercased to produce a normalized representation
{U isAbsolute($)}
returns true iff the URL is absolute
{U isRelative($)}
returns true iff the URL is relative, i.e. not absolute
{U resolve(+U2 $)}
given another URL object U2 as an argument, returns a new URL object which results from resolving U2 relative to U. Note that U is considered as a whole, not just its base
{U isRoot($)}
returns true iff U's path is empty
{U dirname($)}
returns a new URL object representing the parent URL of U
{U basename($)}
returns a new URL object representing just the last component of U's path
{U getScheme($)}
{U getAuthority($)}
{U getDevice($)}
{U getAbsolute($)}
{U getPath($)}
{U getQuery($)}
{U getFragment($)}
{U getInfo($)}
return the corresponding (typically string) element of the URL or unit when not available
{U normalized($)}
return a new URL object which is the normalized representation of U (i.e. scheme, device and authority lowercased)
{U toPath($ windows:WIN<=false)}
return a path object corresponding to U. WIN indicates whether it should be considered a Windows-style path

mozart-stdlib-20060615/mozart-stdlib/Generator.oz0000644000175000017500000000173110052514003021165 0ustar kevingkevingfunctor export Tails Count require BootValue( newReadOnly : NewReadOnly bindReadOnly: BindReadOnly) at 'x-oz://boot/Value' prepare proc {Tails L R} {NewReadOnly R} thread {TailsLoop L R}end end proc {TailsLoop L R} {WaitNeeded R} case L of nil then {BindReadOnly R nil} [] _|L2 then R2={NewReadOnly} in {BindReadOnly R L|R2} {TailsLoop L2 R2} end end proc {Count From To By R} R={NewReadOnly} in thread {if By<0 then CountDown else CountUp end From To By R} end end proc {CountDown From To By R} {WaitNeeded R} if FromTo then {BindReadOnly R nil} else R2={NewReadOnly} in {BindReadOnly R From|R2} {CountUp From+By To By R2} end end end mozart-stdlib-20060615/mozart-stdlib/HOWTO0000644000175000017500000000012107401705471017517 0ustar kevingkevingCreating a source release: ozmake -cp mozart-stdlib-`date '+%Y%m%d'`.src.pkg -v mozart-stdlib-20060615/mozart-stdlib/Makefile.in0000644000175000017500000000530010052416015020732 0ustar kevingkevingVPATH = @srcdir@ SRCDIR = @srcdir@ PREFIX = @prefix@ CYGPATH = $(SRCDIR)/cygpath.sh CYG_PREFIX = $(shell $(CYGPATH) $(PREFIX)) CYG_SRCDIR = $(shell $(CYGPATH) $(SRCDIR)) OZENGINE = @VAR_OZE@ BUILDDIR = @BUILDDIR@ CYG_BUILDDIR_OZMAKE = $(shell $(CYGPATH) $(BUILDDIR)/ozmake) OZTOOL = @VAR_OZTOOL@ PLATFORM = $(shell $(OZTOOL) platform) NOTDIRSRCDIR = $(notdir $(SRCDIR)) BUILDDATE = $(shell date '+%Y%m%d') VERSION = $(shell $(OZTOOL) version) ifeq ($(PLATFORM),win32-i486) OZEMULATOR = $(shell $(CYGPATH) $(PREFIX)/platform/win32-i486/emulator.dll) export OZEMULATOR endif all: build.ozmake $(OZENGINE) ozmake/ozmake.ozf --prefix=$(CYG_PREFIX) --srcdir=$(CYG_SRCDIR) build.ozmake: cd ozmake && $(MAKE) ozmake.ozf install: all $(OZENGINE) ozmake/ozmake.ozf --prefix=$(CYG_PREFIX) --srcdir=$(CYG_SRCDIR) --install --nosavedb $(OZENGINE) ozmake/ozmake.ozf --prefix=$(CYG_PREFIX) --srcdir=$(CYG_SRCDIR)/ozmake --builddir=$(CYG_BUILDDIR_OZMAKE) --install --nosavedb export CLEANDIR clean: $(MAKE) CLEANDIR="$(BUILDDIR)" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/adt" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/os" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/wp" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/wp/qhtml" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/wp/qtk" clean.dir $(MAKE) CLEANDIR="$(BUILDDIR)/xml" clean.dir cd ozmake && $(MAKE) clean clean.dir: -cd $(CLEANDIR) && rm -f *~ *.ozf distclean: clean -cd ozmake && $(MAKE) distclean -rm -f Makefile config.cache config.log config.status ###################################################################### # source tarball ###################################################################### COMPRESS= gzip -9 TAR= tar PACKDIR= /tmp/pack INSTALL_DIR= @INSTALL@ -d src: $(PACKDIR) echo "[" $(NOTDIRSRCDIR) "]" test -n "$(NOTDIRSRCDIR)" || { echo "bad"; exit 1; } ## Create empty temp directory -rm -rf $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std mkdir $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std ## Move source files to temp directory cd $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std && \ ((cd $(SRCDIR) && $(TAR) -cf - .) | tar -xf -) ## Remove CVS cruft cd $(PACKDIR) && \ (tbr=`find $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std -name CVS -type d 2>/dev/null` ; \ rm -rf $$tbr ; \ find $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std -name '.cvsignore' -type f -exec rm -f '{}' ';' ;) \ ## tar up and compress (cd $(PACKDIR) && $(TAR) -cf - mozart-$(VERSION).$(BUILDDATE)-std) | \ $(COMPRESS) > mozart-$(VERSION).$(BUILDDATE)-std.tar.gz ## remove temp directory rm -rf $(PACKDIR)/mozart-$(VERSION).$(BUILDDATE)-std $(PACKDIR): INSTALL_DIR_CHMOD=777; export INSTALL_DIR_CHMOD && $(INSTALL_DIR) $@ mozart-stdlib-20060615/mozart-stdlib/Mapping.oz0000644000175000017500000000457410052746711020657 0ustar kevingkevingfunctor export Get Put CondGet condSelect:CondGet Is IsMutable Items toList:Items Keys arity:Keys Entries toListInd:Entries Clone Exchange ToRecord prepare fun {Get M Key} M.Key end proc {Put M Key Value} M.Key := Value end fun {CondGet M Key Default} {CondSelect M Key Default} end fun {Is X} {IsRecord X} orelse {IsArray X} orelse {IsDictionary X} end fun {IsMutable X} {IsArray X} orelse {IsDictionary X} end RecToList = Record.toList ArrayHi = Array.high ArrayLo = Array.low fun {ArrayToList A} Lo = {ArrayLo A} Hi = {ArrayHi A} in {ArrayToListX A Lo Hi} end fun {ArrayToListX A Lo Hi} if Lo>Hi then nil else A.Lo|{ArrayToListX A Lo+1 Hi} end end DictItems = Dictionary.items fun {Items X} if {IsDictionary X} then {DictItems X} elseif {IsRecord X} then {RecToList X} else {ArrayToList X} end end DictKeys = Dictionary.keys fun {Keys X} if {IsDictionary X} then {DictKeys X} elseif {IsRecord X} then {Arity X} else {ArrayArity X} end end ListNumber = List.number fun {ArrayArity A} Lo = {ArrayLo A} Hi = {ArrayHi A} in {ListNumber Lo Hi 1} end DictEntries = Dictionary.entries RecToListInd = Record.toListInd fun {Entries X} if {IsDictionary X} then {DictEntries X} elseif {IsRecord X} then {RecToListInd X} else {ArrayToListInd X} end end fun {ArrayToListInd A} Lo = {ArrayLo A} Hi = {ArrayHi A} in {ArrayToListIndX A Lo Hi} end fun {ArrayToListIndX A Lo Hi} if Lo>Hi then nil else (Lo#A.Lo)|{ArrayToListX A Lo+1 Hi} end end DictClone = Dictionary.clone ArrayClone = Array.clone fun {Clone M} if {IsDictionary M} then {DictClone M} elseif {IsRecord M} then M else {ArrayClone M} end end DictExchange = Dictionary.exchange ArrayExchange = Array.exchange proc {Exchange M Key Old New} if {IsDictionary M} then {DictExchange M Key Old New} elseif {IsRecord M} then M.Key=Old=New else {ArrayExchange M Key Old New} end end DictToRecord = Dictionary.toRecord ArrayToRecord = Array.toRecord fun {ToRecord Label M} if {IsDictionary M} then {DictToRecord Label M} elseif {IsRecord M} then {Adjoin M Label} else {ArrayToRecord Label M} end end end mozart-stdlib-20060615/mozart-stdlib/README0000644000175000017500000000065410407535112017560 0ustar kevingkevingTo install the Mozart Standard Library, you should have Mozart already installed on your system. Let us assume that Mozart is installed in $PREFIX. Now, to build the Standard Library, it is a good idea to do it in a different directory from the sources. Let us consider $STDLIB for the sources and $BUILD_STDLIB for building. You should do the following: cd $BUILD_STDLIB $STDLIB/configure --prefix=$PREFIX make make install mozart-stdlib-20060615/mozart-stdlib/String.oz0000644000175000017500000000553410052503322020514 0ustar kevingkevingfunctor export Make Length ToInt ToAtom ToFloat Capitalize Split SplitAtMost Join ToLower ToUpper Lstrip Rstrip Strip Replace ReplaceAtMost prepare CharToUpper = Char.toUpper CharToLower = Char.toLower CharIsSpace = Char.isSpace DropWhile = List.dropWhile Make = VirtualString.toString ToInt = StringToInt ToAtom = StringToAtom ToFloat = StringToFloat fun {Capitalize S} case S of H|T then {CharToUpper H}|T else S end end fun {SplitStart S Next Max} if S==nil then nil elseif Max==0 then [S] else Prefix Suffix in {Next S Prefix Suffix} Prefix|if Suffix==unit then nil else {SplitMore Suffix Next Max-1} end end end fun {SplitMore S Next Max} if Max==0 orelse S==nil then [S] else Prefix Suffix in {Next S Prefix Suffix} Prefix|if Suffix==unit then nil else {SplitMore Suffix Next Max-1} end end end fun {Split S Sep} {SplitStart S {NextSplitter Sep} ~1} end fun {SplitAtMost S Sep Max} {SplitStart S {NextSplitter Sep} Max} end proc {NextSplitWS S Prefix Suffix} case S of nil then Prefix=nil Suffix=unit [] H|T then if {CharIsSpace H} then Prefix=nil {DropWhile T CharIsSpace Suffix} else Prefix2 in Prefix=(H|Prefix2) {NextSplitWS T Prefix2 Suffix} end end end fun {WithPrefix SEP S} case SEP of nil then S [] H|SEP then case S of !H|S then {WithPrefix SEP S} else unit end end end proc {NextSplitSEP S SEP Prefix Suffix} case S of nil then Prefix=nil Suffix=unit elsecase {WithPrefix SEP S} of unit then case S of H|T then Prefix2 in Prefix=(H|Prefix2) {NextSplitSEP T SEP Prefix2 Suffix} end [] S then Prefix=nil Suffix=S end end proc {NextSplitNULL S Prefix Suffix} case S of nil then Prefix=nil Suffix=unit [] H|T then Prefix=[H] Suffix=T end end fun {NextSplitter Sep} case Sep of unit then NextSplitWS [] nil then NextSplitNULL else proc {$ S Prefix Suffix} {NextSplitSEP S Sep Prefix Suffix} end end end fun {Join L Sep} if L==nil then nil else {FoldR L fun {$ S Accu} if Accu==unit then S else {Append S {Append Sep Accu}} end end unit} end end fun {ToUpper S} {Map S CharToUpper} end fun {ToLower S} {Map S CharToLower} end fun {Lstrip S Chars} {DropWhile S if Chars==unit then CharIsSpace else fun {$ C} {Member C Chars} end end} end fun {Rstrip S Chars} {Reverse {Lstrip {Reverse S} Chars}} end fun {Strip S Chars} {Rstrip {Lstrip S Chars} Chars} end fun {Replace S Old New} {Join {Split S Old} New} end fun {ReplaceAtMost S Old New Max} {Join {SplitAtMost S Old Max} New} end endmozart-stdlib-20060615/mozart-stdlib/configure0000755000175000017500000010747210052415331020611 0ustar kevingkeving#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_default_prefix=/usr/local/oz # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=mozart-stdlib.hhc # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:528: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi srcdir=`cd $srcdir 2> /dev/null && pwd` if test "$prefix" = NONE; then prefix="$ac_default_prefix" fi BUILDDIR=`pwd` ac_aux_dir= for ac_dir in ozmake $srcdir/ozmake; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in ozmake $srcdir/ozmake" 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. for ac_prog in ozengine ozengine.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:584: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_VAR_OZE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$VAR_OZE" in /*) ac_cv_path_VAR_OZE="$VAR_OZE" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_VAR_OZE="$VAR_OZE" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_VAR_OZE="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi VAR_OZE="$ac_cv_path_VAR_OZE" if test -n "$VAR_OZE"; then echo "$ac_t""$VAR_OZE" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$VAR_OZE" && break done test -n "$VAR_OZE" || VAR_OZE="UNDEFINED" if test "$VAR_OZE" = "UNDEFINED"; then { echo "configure: error: ozengine not found" 1>&2; exit 1; } fi for ac_prog in oztool oztool.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:629: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_VAR_OZTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$VAR_OZTOOL" in /*) ac_cv_path_VAR_OZTOOL="$VAR_OZTOOL" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_VAR_OZTOOL="$VAR_OZTOOL" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_VAR_OZTOOL="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi VAR_OZTOOL="$ac_cv_path_VAR_OZTOOL" if test -n "$VAR_OZTOOL"; then echo "$ac_t""$VAR_OZTOOL" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$VAR_OZTOOL" && break done test -n "$VAR_OZTOOL" || VAR_OZTOOL="UNDEFINED" if test "$VAR_OZTOOL" = "UNDEFINED"; then { echo "configure: error: oztool not found" 1>&2; exit 1; } fi subdirs="ozmake" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:683: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@SET_MAKE@%$SET_MAKE%g s%@BUILDDIR@%$BUILDDIR%g s%@VAR_OZE@%$VAR_OZE%g s%@VAR_OZTOOL@%$VAR_OZTOOL%g s%@subdirs@%$subdirs%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@INSTALL@%$INSTALL%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= for ac_arg in $ac_configure_args; do if test -n "$ac_prev"; then ac_prev= continue fi case "$ac_arg" in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; esac done for ac_config_dir in ozmake; do # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. if test ! -d $srcdir/$ac_config_dir; then continue fi echo configuring in $ac_config_dir case "$srcdir" in .) ;; *) if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; else { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } fi ;; esac ac_popdir=`pwd` cd $ac_config_dir # A "../" for each directory in /$ac_config_dir. ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` case "$srcdir" in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; /*) # Absolute path. ac_sub_srcdir=$srcdir/$ac_config_dir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure; then ac_sub_configure=$ac_sub_srcdir/configure elif test -f $ac_sub_srcdir/configure.in; then ac_sub_configure=$ac_configure else echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case "$cache_file" in /*) ac_sub_cache_file=$cache_file ;; *) # Relative path. ac_sub_cache_file="$ac_dots$cache_file" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" # The eval makes quoting arguments work. if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir then : else { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } fi fi cd $ac_popdir done fi mozart-stdlib-20060615/mozart-stdlib/configure.in0000644000175000017500000000123610052355147021212 0ustar kevingkevingAC_INIT(mozart-stdlib.hhc) AC_PREFIX_DEFAULT(/usr/local/oz) AC_PROG_MAKE_SET srcdir=`cd $srcdir 2> /dev/null && pwd` if test "$prefix" = NONE; then prefix="$ac_default_prefix" fi BUILDDIR=`pwd` AC_SUBST(BUILDDIR) AC_CONFIG_AUX_DIR(ozmake) AC_PATH_PROGS(VAR_OZE,ozengine ozengine.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZE" = "UNDEFINED"; then AC_MSG_ERROR([ozengine not found]) fi AC_SUBST(VAR_OZE) AC_PATH_PROGS(VAR_OZTOOL,oztool oztool.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZTOOL" = "UNDEFINED"; then AC_MSG_ERROR([oztool not found]) fi AC_SUBST(VAR_OZTOOL) AC_CONFIG_SUBDIRS([ozmake]) AC_PROG_INSTALL AC_SUBST(INSTALL) AC_OUTPUT(Makefile) mozart-stdlib-20060615/mozart-stdlib/cygpath.sh0000755000175000017500000000015410012274110020657 0ustar kevingkeving#!/bin/sh case `uname -s` in CYGWIN*) cygpath -w "$1" | sed 's|\\|/|g' ;; *) echo "$1" ;; esac mozart-stdlib-20060615/mozart-stdlib/generator.html0000644000175000017500000000347110052517303021552 0ustar kevingkeving Mozart Standard Library: Lazy Generators

Lazy Generators

Denys Duchier

module
x-oz://system/Generator.ozf

This module provides lazy generators, i.e. functions that return lists which are lazily computed concurrently, by-need

Exports

{Generator.Tails +L ?Tails}
returns a lazy list of all non-empty tails of list L
{Generator.count +From +To +By ?L}
returns a lazy list of integers starting at From, ending at at most To, and in steps of By. Whether we count up or down is determined by the sign of By

mozart-stdlib-20060615/mozart-stdlib/index.html0000644000175000017500000000342110052517303020666 0ustar kevingkeving Mozart Standard Library

Mozart Standard Library


The standard library currently contains the following sections:

and the following general modules:
mozart-stdlib-20060615/mozart-stdlib/makefile.oz0000644000175000017500000000061310052612477021030 0ustar kevingkevingmakefile( mogul : 'mogul:/mozart/stdlib' uri : 'x-oz://system' lib : ['String.ozf' 'Mapping.ozf' 'Generator.ozf'] subdirs: [ %%'adt' 'os' 'op' 'adt' 'wp' 'xml' 'os' 'net' ] doc : [ 'index.html' 'ozdoc.css' 'page.gif' 'string.html' 'mapping.html' 'generator.html' ] ) mozart-stdlib-20060615/mozart-stdlib/mapping.html0000644000175000017500000000577510052746711021237 0ustar kevingkeving Mozart Standard Library: Mappings

Mappings

Denys Duchier

module
x-oz://system/Mapping.ozf

This module provides a uniform interface to standard mapping datatypes, i.e. records, dictionaries and arrays

Exports

{Mapping.get +M +Key ?Value}
returns the Value associated with Key in mapping M
{Mapping.put +M +Key +Value}
sets the Value associated with Key in mapping M (assuming the latter is mutable)
{Mapping.condGet +M +Key +Default ?Value}
{Mapping.condSelect +M +Key +Default ?Value}
returns the Value associated with Key in mapping M, or Default if none
{Mapping.is +M ?B}
returns true iff M is a mapping
{Mapping.isMutable +M ?B}
returns true iff M is a mutable mapping
{Mapping.items +M ?L}
{Mapping.toList +M ?L}
returns a list of the values in the mapping
{Mapping.keys +M ?L}
{Mapping.arity +M ?L}
returns a list of the keys of the mapping
{Mapping.entries +M ?L}
{Mapping.toListInd +M ?L}
returns a list of the entries Key#Value in the mapping
{Mapping.clone +M1 ?M2}
returns a clone M2 of the mapping M1
{Mapping.exchange +M +Key ?Old +New}
atomically exchanges the value for Key in mapping M: sets it to New while returning Old
{Mapping.toRecord +Label +M ?R}
returns a record R with label Label representing the entries in mapping M

mozart-stdlib-20060615/mozart-stdlib/mozart-stdlib.hhc0000644000175000017500000006664007403165643022200 0ustar kevingkeving
mozart-stdlib-20060615/mozart-stdlib/ozdoc.css0000644000175000017500000000450107401536450020531 0ustar kevingkevingBODY { margin-left: 160px; margin-right: 10px; background: url(page.gif) repeat-y white; } .margin { position: absolute; left: 10px; width: 130px; } DIV.maxi { margin-left: -160px; } BODY, P, H1, H2, H3, H4, TH, TD, A { font-family: tahoma,arial,helvetica,sans-serif; } PRE, CODE, KBD, SPAN.key, SPAN.buffer { font-family: "Andale Mono","lucida console",courier,monospace; } P { text-align: justify; } H1, H2, H3, H4, .synopsis P, P.margin, TH { text-align: left; } H1.title, H2.authors { text-align: center; } H3.authors { text-align: right; color: #000000; } H1 { color: #9B0000; } H2 { color: #FF9933; } H3, H4 { color: #881155; } UL.toc { list-style: none; } .allcaps { font-size: 80%; } SPAN.key { color: #669933; } CODE { color: #663366; } .code CODE { color: #000000; } .synopsis CODE { color: #000000; } SPAN.comment { color: #B22222; } SPAN.keyword { color: #A020F0; } SPAN.string { color: #BC8F8F; } SPAN.functionname { color: #0000FF; } SPAN.type { color: #228B22; } SPAN.variablename { color: #B8860B; } SPAN.reference { color: #5F9EA0; } SPAN.builtin { color: #DA70D6; } DIV.footnote { text-indent: 1em; font-family: tahoma,arial,helvetica,sans-serif; font-size: 10pt; } A:link { color: #666666; } A:visited { color: black; } .ignore { display: none; } P.linkmenu { text-align: center; font-weight: bold; color: #881155; } P.linkmenu A:link { color: #881155; } P.linkmenu A:visited { color: #881155; } SPAN.chunkborder { color: orange; font-weight: bold; } SPAN.chunktitle { color: olivedrab; font-family: sans-serif; font-weight: bold; } SPAN.chunktitle A:link { color: slateblue; } SPAN.chunktitle A:visited { color: slateblue; } SPAN.entrycategory { position:absolute; font-weight:bold; left:10px; width:130px; text-align:right; } SPAN.entrycategorybracket { display:none; } .PAPERYEAR,.PAPERAUTHOR { font-weight:bold; } MENU.PAPERLINKS LI { list-style-type:none; } .PAPERLINKS P { display:inline; text-indent:-40px; font-weight:normal; font-style:italic; } SPAN.BIBAUTHOR { font-size:small; font-style:italic; } SPAN.VERSION { font-size:10pt; } P.LI { margin-top:0px; margin-bottom:0px; font-weight:bold; text-indent:-20px; margin-left:20px; } mozart-stdlib-20060615/mozart-stdlib/page.gif0000644000175000017500000000020407401536450020300 0ustar kevingkevingGIF87a€ãÿÖYÿÙhÿÝwÿá†ÿä•ÿè¤ÿì³ÿðÂÿóÑÿ÷àÿûïÿÿÿ,€9ÈI«½8ëÍ»ÿ Q’(Kë¾p,Ïtmßx®ï|ïÿÀ pH,ȤrÉl:ŸÐ¨tJ­Z¯µ;mozart-stdlib-20060615/mozart-stdlib/string.html0000644000175000017500000000722710052612477021105 0ustar kevingkeving Mozart Standard Library: String Support

String Support

Denys Duchier

module
x-oz://system/String.ozf

This module provides additional convenience operation on strings. It should not be confused, with the base String which is always present and does not need to be imported.

Exports

{String.make +VS ?S}
turns a virtual string into a plain old regular string
{String.length +S ?N}
returns the length N of string S
{String.toInt +S ?I}
takes a string S and returns the integer I of which it is the textual representation
{String.toFloat +S ?F}
takes a string S and returns the float F of which it is the textual representation
{String.toInt +S ?A}
takes a string S and returns the corresponding atom A
{String.capitalize +S1 ?S2}
takes a string S1 and returns a string S2 which is identical except for the first letter which has been capitalized
{String.split +S +Sep ?L}
splits string S at all occurrences of string Sep and returns the resulting list L. Sep may also be unit in which case splits occur at all non-empty sequences of whitespace characters. It can also be nil, in which case splits occur between every two characters
{String.splitAtMost +S +Sep +N ?L}
same as above, but at most N splits are performed: the remainder of the string is returned as the last element of list L
{String.lstrip +S1 +Chars ?S2}
takes a string S1 and returns a string S2 where all characters at the left of S1 which are in Chars have been removed. Chars can also be unit, in which case it stands for all whitespace characters
{String.rstrip +S1 +Chars ?S2}
same thing but at the right-end of S1
{String.strip +S1 +Chars ?S2}
same thing at both ends
{String.replace +S1 +Old +New ?S2}
replace every occurrence of string Old in S1 by New
{String.replaceAtMost +S1 +Old +New +N ?S2}
same as above, but replace at most N occurrences of Old

mozart-stdlib-20060615/mozart-stdlib/os/0000755000175000017500000000000010444200427017313 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/os/Path.oz0000644000175000017500000002107510126263015020565 0ustar kevingkevingfunctor export Is Make 'class':Path ToString ToAtom Length IsAbsolute IsRelative Dirname Basename Exists Stat IsDir IsFile Size Mtime Resolve Getcwd Mkdir Mkdirs IsRoot Readdir Extension DropExtension AddExtension MaybeAddPlatform prepare VS2S = VirtualString.toString S2A = String.toAtom IS_PATH = {NewName} Token = String.token LLength = List.length fun {Is X} {HasFeature X IS_PATH} end %% {Split L P} returns a list of subsequences of L %% separated by an element for which P is true. %% The code was stolen from Christian's Tokens %% function from String.oz fun {Split L P} S in {SplitAux L P S S} end fun {SplitAux L P Js Jr} case L of nil then Jr=nil case Js of nil then nil else [Js] end [] H|T then if {P H} then NewJs in Jr=nil Js|{SplitAux T P NewJs NewJs} else NewJr in Jr=H|NewJr {SplitAux T P Js NewJr} end end end fun {IsSlashOrBackslash C} C==&/ orelse C==&\\ end fun {IsSlash C} C==&/ end fun {SplitWindows S} {Split S IsSlashOrBackslash} end fun {SplitPosix S} {Split S IsSlash} end fun {PathToString P} {P toString($)} end import OS Property Shell at 'Shell.ozf' define fun {Make X} if {Is X} then X else {New Path init(X)} end end IS_WINDOWS = {Property.get 'platform.os'}=='win32' %% we provide no locking for concurrent processing because, %% at worst, we only perform redundant work class Path feat !IS_PATH:unit attr info %% newFromRecord(+R ?P) makes it easier to create instances of %% classes derived from Path meth newFromRecord(R $) {New Path initFromRecord(R)} end meth initFromRecord(R) info <- R end meth new(S $ windows:WIN<=IS_WINDOWS exact:Exact<=false) {New Path init(S windows:WIN exact:Exact)} end %% init(...) is the main user-oriented constructor meth init(S windows:WIN<=IS_WINDOWS exact:Exact<=false) STR1 = {VS2S S} STR2 = if Exact then STR1 else case {Reverse STR1} of nil then nil [] H|T then Pred = if IS_WINDOWS then IsSlashOrBackslash else IsSlash end in if {Pred H} then {Reverse {List.dropWhile T Pred}} else STR1 end end end Drive NonDrive Items Items2 Items3 SlashInitial SlashFinal in if WIN then case STR2 of C|&:|L then Drive=C NonDrive=L [] L then Drive=unit NonDrive=L end else Drive=unit NonDrive=STR2 end Items = {if WIN then SplitWindows else SplitPosix end NonDrive} case Items of nil|L then SlashInitial=true Items2=L else SlashInitial=false Items2=Items end case {Reverse Items2} of nil|L then SlashFinal=true Items3={Reverse L} else SlashFinal=false Items3=Items2 end {self initFromRecord( unit( string : STR2 windows : WIN drive : Drive slashinitial : SlashInitial slashfinal : SlashFinal components : Items3 ))} end meth toString($) @info.string end meth toAtom($) {S2A @info.string} end meth length($) {LLength @info.string} end meth isAbsolute($) @info.slashinitial end meth isRelative($) {Not Path,isAbsolute($)} end meth dirname($) INFO = @info in if INFO.slashfinal then {self newFromRecord({AdjoinAt INFO slashfinal false} $)} else COM = INFO.components STR INFO2 = {Adjoin INFO unit( string : STR slashinitial : if COM==nil then false else INFO.slashinitial end slashfinal : false components : if COM==nil then nil else {Reverse {Reverse COM}.2} end )} in Path,ComputeString(INFO2 STR) {self newFromRecord(INFO2 $)} end end meth ComputeString(INFO $) INFO = @info DEV = INFO.drive INI = INFO.slashinitial FIN = INFO.slashfinal COM = INFO.components L1 = if DEV==unit then nil else [DEV &:] end L2 = if INI then L1#'/' else L1 end L3 = L2 # {FoldL COM fun {$ Accu C} Accu#(if Accu==nil then C else Accu#'/'#C end) end nil} L4 = if FIN then L3#'/' else L3 end in {VS2S L4} end meth basenameString($) INFO = @info in if INFO.slashfinal then nil else case {Reverse INFO.components} of nil then nil [] H|_ then [H] end end end meth basename($) INFO = @info in if INFO.slashfinal then {self new(nil $ window:INFO.windows)} else STR INFO2 = unit( string : STR drive : unit slashinitial : false slashfinal : false components : case {Reverse INFO.components} of nil then nil [] H|_ then [H] end windows : INFO.windows) in Path,ComputeString(INFO2 STR) {self newFromRecord(INFO2 $)} end end meth exists($) try Path,stat(_) true catch _ then false end end meth stat($) {OS.stat @info.string} end meth isDir($) (Path,stat($)).type == 'dir' end meth isFile($) (Path,stat($)).type == 'reg' end meth size($) (Path,stat($)).size end meth mtime($) (Path,stat($)).mtime end meth GetInfo($) @info end meth resolve(X $) P = {Make X} in if {P isAbsolute($)} then P else INFO = @info INFO2 = {P GetInfo($)} STR INFO3 = unit( string : STR drive : INFO.drive slashinitial : INFO.slashinitial slashfinal : INFO2.slashfinal components : {Append INFO.components INFO2.components} windows : INFO.windows) in Path,ComputeString(INFO3 STR) {self newFromRecord(INFO3 $)} end end meth getcwd($) {Getcwd} end meth mkdir() {OS.mkDir @info.string} end meth mkdirs() if @info.components==nil then skip else {Path,dirname($) mkdirs} end if Path,exists($) then skip else Path,mkdir end end meth rmdir() R = {CondSelect OS rmDir unit} in if R==unit then {Shell.executeCommand ['rmdir' @info.string]} else {R @info.string} end end meth isRoot($) @info.components==nil end meth readdir($) for S in {OS.getDir @info.string} collect:COL do if S=="." orelse S==".." then skip else {COL Path,resolve(S $)} end end end meth SplitExtension(Base Ext) BaseSTR = Path,basenameString($) in if {Member &. BaseSTR} then S1 S2 in {Token {Reverse BaseSTR} &. S1 S2} Base={Reverse S2} Ext={Reverse S1} else Base=BaseSTR Ext=unit end end meth extension($) Path,SplitExtension(_ $) end meth dropExtension($) {Path,dirname($) resolve(Path,SplitExtension($ _) $)} end meth addExtension(Ext $) {Path,dirname($) resolve((Path,basenameString($))#'.'#Ext $)} end meth maybeAddPlatform($) case Path,extension($) of "so" then {Path,dirname($) resolve((Path,basenameString($)) #'-'#{Property.get 'platform.name'} $)} else self end end meth makeExecutable() try {Shell.executeCommand ['chmod' '+x' @info.string]} catch E then if IS_WINDOWS then skip else raise E end end end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fun {ToString P} {{Make P} toString($)} end fun {ToAtom P} {{Make P} toAtom($)} end fun {Length P} {{Make P} length($)} end fun {IsAbsolute P} {{Make P} isAbsolute($)} end fun {IsRelative P} {{Make P} isRelative($)} end fun {Dirname P} {{{Make P} dirname($)} toString($)} end fun {Basename P} {{{Make P} basename($)} toString($)} end fun {Exists P} {{Make P} exists($)} end fun {Stat P} {{Make P} stat($)} end fun {IsDir P} {{Make P} isDir($)} end fun {IsFile P} {{Make P} isFile($)} end fun {Size P} {{Make P} size($)} end fun {Mtime P} {{Make P} mtime($)} end fun {Resolve P1 P2} {{{Make P1} resolve(P2 $)} toString($)} end fun {Getcwd} {Make {OS.getCWD}} end proc {Mkdir P} {{Make P} mkdir} end proc {Mkdirs P} {{Make P} mkdirs} end fun {IsRoot P} {{Make P} isRoot($)} end fun {Readdir P} {Map {{Make P} readdir($)} PathToString} end fun {Extension P} {{Make P} extension($)} end fun {DropExtension P} {{{Make P} dropExtension($)} toString($)} end fun {AddExtension P E} {{{Make P} addExtension(E $)} toString($)} end fun {MaybeAddPlatform P} {{{Make P} maybeAddPlatform(P $)} toString($)} end proc {Rmdir P} {{Make P} rmdir} end end mozart-stdlib-20060615/mozart-stdlib/os/Shell.oz0000644000175000017500000000345210046775672020761 0ustar kevingkevingfunctor export ExecuteProgram ExecuteCommand ToUserVS import Property(get) OS(getEnv system) prepare VS2S = VirtualString.toString ToLower = Char.toLower fun {QuoteUsing CMD Quote} %% CMD is a list: we are going to quote each element of %% this list using the Quote string specified and then %% we are going to concatenate all of them separated by %% single spaces {FoldL CMD %% in principle, we should be careful about embedded %% occurrences of characters used for quoting. We will %% ignore this issue for the time being. fun {$ VS I} VS#' '#Quote#I#Quote end nil} end %% and advantage of using an arbitrary VS as a Quote is that %% we can also use an empty VS, which is useful when we want %% to display commands in a readable way to the user. fun {ToUserVS CMD} {QuoteUsing CMD ''} end define ToProgramVS ToCommandVS %% arguments on the command given to the shell for execution %% need to be quoted to avoid problems with embedded spaces %% in filenames and special shell characters if {Property.get 'platform.os'}=='win32' then SHELL in case {Reverse {Map {VS2S {OS.getEnv 'COMSPEC'}} ToLower}} of &e|&x|&e|&.|&d|&m|&c|_ then SHELL = nil else SHELL = 'COMMAND.COM /C ' end fun {!ToProgramVS CMD} SHELL#{QuoteUsing CMD '"'} end fun {!ToCommandVS CMD} case CMD of H|T then SHELL#H#{QuoteUsing T '"'} end end else fun {!ToProgramVS CMD} {QuoteUsing CMD '\''} end !ToCommandVS = ToProgramVS end proc {Execute VS} if {OS.system VS}\=0 then raise shell(VS) end end end proc {ExecuteProgram CMD} {Execute {ToProgramVS CMD}} end proc {ExecuteCommand CMD} {Execute {ToProgramVS CMD}} end end mozart-stdlib-20060615/mozart-stdlib/os/index.html0000644000175000017500000000263310052245725021321 0ustar kevingkeving Mozart Standard Library: OS

OS Support

Denys Duchier


In this section of the library you will find convenient support for interacting with the operating system


mozart-stdlib-20060615/mozart-stdlib/os/makefile.oz0000644000175000017500000000014210052245725021444 0ustar kevingkevingmakefile( lib : ['Path.ozf' 'Shell.ozf'] doc : ['index.html' 'path.html' 'shell.html'] ) mozart-stdlib-20060615/mozart-stdlib/os/path.html0000644000175000017500000001544710052245725021155 0ustar kevingkeving Mozart Standard Library: Path

Path Support

Denys Duchier

module
x-oz://system/os/Path.ozf

This module provides an object-oriented interface for path and OS operations on them

Exports

The module exports not only the object-oriented API for path, but also a convenient functional API built on top of the later. It should be noted however that the functional API always needs to build path objects and thus is less efficient than the OO API, though possibly occasionally more convenient.

{Path.make +VS ?P}
given a virtual string VS, returns a new path object P. If VS is already a path object, then it is simply returned.
{Path.is +X ?B}
return true iff X is a path object
Path.'class'
The class which implements path objects
{Path.toString +X ?S}
{Path.toAtom +X ?A}
{Path.length +X ?N}
{Path.isAbsolute +X ?B}
{Path.isRelative +X ?B}
{Path.dirname +X ?S}
{Path.basename +X ?S}
{Path.exists +X ?B}
{Path.stat +X ?R}
{Path.isDir +X ?B}
{Path.isFile +X ?B}
{Path.size +X ?N}
{Path.mtime +X ?N}
{Path.resolve +X1 +X2 ?S}
{Path.getcwd ?S}
{Path.mkdir +X}
{Path.mkdirs +X}
{Path.isRoot +X ?B}
{Path.readdir +X ?L}
{Path.extension +X ?S}
{Path.dropExtension +X ?S}
{Path.addExtension +X +VS ?S}
{Path.maybeAddPlatform +X ?S}
{Path.rmdir +X}
for proper descriptions, see path methods below. Returned path objects are converted to strings where applicable

Instance API

Each path object P has the following methods:

{P init(+S windows:WIN<=ISWIN exact:EXACT<=false)}
initializes a path object from the string S. WIN indicates that it should be considered a Windows-style path: this usually defaults to false, except on Windows where it defaults to true. EXACT indicates whether we should keep a terminal slash; the default is false.
{P initFromRecord(+R)}
initializes the path object from its record-based representation
{P newFromRecord(R $)}
This method is meant to be overriden when you subclass the Path class. It's default definition is meth newFromRecord(R $) {New Path initFromRecord(R)} end
{P new(+S windows:WIN<=ISWIN exact:EXACT<=false)}
this method is also meant to be overriden to create derived instances from a string S
{P toString($)}
{P toAtom($)}
return a string (resp. an atom) textual representation of the path
{P length($)}
returns the length of the string that is the textual representation of the path
{P isAbsolute($)}
{P isRelative($)}
returns true (resp. false) iff the path is absolute
{P dirname($)}
returns a new path object representing the parent directory of P
{P basenameString($)}
returns the string representation for the last component of P
{P basename($)}
returns a new path object representing just the last component of path P
{P exists($)}
returns true iff path P exists
{P stat($)}
returns a record representation of the stat information for path P
{P isDir($)}
{P isFile($)}
returns true iff P is a directory (resp. a regular file)
{P size($)}
returns the size of file P in bytes
{P mtime($)}
returns the time of last modification as an integer
{P resolve(+P2 $)}
returns a new path object that results from resolving P2 relative to P (if P2 is not a path, it is made into one)
{P getcwd($)}
returns a path object representing the current working directory
{P mkdir}
creates directory P
{P mkdirs}
creates directory P and its ancestor directories too if necessary
{P rmdir}
removes directory P
{P isRoot($)}
returns true iff P is a root path
{P readdir($)}
returns a list of path objects representing the contents of directory P. Entries for . and .. are omitted. All other entries are resolved relative to P
{P extension($)}
returns the file extension for P, unit if none
{P dropExtension($)}
returns a new path object with the extension of P, if any, omitted
{P addExtension(+VS $)}
returns a new path object which is like P but with the extension VS added
{P maybeAddPlatform($)}
is P has extension so then a new path object is returned with the appropriate (for native functors) platform-specific suffix added, else P itself is returned
{P makeExecutable}
makes file P executable if this is meaningful on the current platform

mozart-stdlib-20060615/mozart-stdlib/os/shell.html0000644000175000017500000000413310052245725021316 0ustar kevingkeving Mozart Standard Library: Shell

Shell Support

Denys Duchier

module
x-oz://system/os/Shell.ozf

This module attempts to provide a portable interface for invoking the platform's shell

Exports

The module exports:

{Shell.executeProgram +L}
{Shell.executeCommand +L}
executes a program (resp. a shell command). L is a list of virtual strings for the program/command and its arguments. They are each appropriately quoted before being handed to the platform's real shell. If execution is not successful, an exception shell(VS) is raised where VS is the virtual string that was actually passed to the shell for execution.
{Shell.toUserVS +L ?VS}
returns a virtual string representation of the program/command invocation L which is only appropriate for displaying to a user because quoting is omitted.

mozart-stdlib-20060615/mozart-stdlib/ozmake/0000755000175000017500000000000010444200427020160 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/ozmake/Attribs.oz0000644000175000017500000006201410051162007022140 0ustar kevingkevingfunctor export 'class' : Attribs import Property Resolve OS Path at 'Path.ozf' Utils at 'Utils.ozf' URL Fixes at 'Fixes.ozf' prepare DB_OZMAKE = 'apps/ozmake/ozmake.db' DB_MOGUL = 'apps/ozmake/mogul.db' DB_CONFIG = 'apps/ozmake/config.db' DB_CONFIG_OLDSTYLE = 'apps/ozmake/DATABASE' define class Attribs attr %% the format is pickle-version dependent only %% for earlier versions (i.e. ones without an %% an explicit pickle format) Format : '1.3.0' Prefix : unit Dir : unit BuildDir : unit SrcDir : unit BinDir : unit LibDir : unit DocDir : unit LibRoot : unit DocRoot : unit TmpDir : unit UseMakePkg : unit MakeFile : unit MakeFileGiven : false Uri : unit Mogul : unit ExtractDir : unit Database : unit DatabaseGiven : false DatabaseIgnore : false Released : unit Clean : unit Veryclean : unit Author : unit BinTargets : nil LibTargets : nil DocTargets : nil SrcTargets : nil ProvidesTargets : unit FullBuild : false % if true, also build targets in src Blurb : unit InfoText : unit InfoHtml : unit Requires : unit Version : unit Verbose : false VeryVerbose: false Quiet : false JustPrint : false OptLevel : optimize Grade : none ReplaceFiles : false KeepZombies: false SaveDB : true IncludeDocs: true IncludeLibs: true IncludeBins: true ExtendPkg : false GNU : unit Package : unit PackageGiven:false Archive : if {Fixes.condGet '>=1.3.0' false} then 'http://www.mozart-oz.org/mogul/pkg' else 'http://www.mozart-oz.org/mogul/pkg/1.2.5/source' end LineWidth : 70 NoMakefile : true Local : false %% support for recursing into subdirs Subdirs : nil % list of subdirs AsSubdir : unit % name of current directory Submans : unit % managers for subdirectories Superman : unit % manager for parent directory Submakefiles:unit IncludeDirs: nil LibraryDirs: nil SysIncludeDirsOK:true SysLibraryDirsOK:true SysIncludeDirs:unit SysLibraryDirs:unit %% tools OzEngine : unit OzC : unit OzL : unit OzTool : unit ResolverExtended : false SubResolverStack : nil FromPackage: false XMogul : unit MogulDatabase : unit MogulDatabaseGiven : false MogulPkgURL : unit MogulDocURL : unit MogulDBURL : unit ConfigFile : unit MogulPkgDir : unit MogulDocDir : unit MogulDBDir : unit Categories : nil Exe : default Makepkgfile : unit MustExtract : true MogulAction : unit Contact : unit MogulRootID : unit MogulDir : unit MogulUrl : unit ConfigAction: unit TarTargets : nil Fast : true WantVersion : unit AutoDepend : true Args : unit Optlist : unit DoRequires : true Binary : unit Platform : unit PlatformGiven : false meth set_platform(V) PlatformGiven<-true Platform<-V end meth get_platform($) if @Platform==unit then if @Superman\=unit then Platform<-{@Superman get_platform($)} else Platform<-{Property.get 'platform.name'} end end @Platform end meth get_platform_given($) @PlatformGiven end meth set_binary(V) Binary<-V end meth get_binary($) if @Binary==unit then if @Superman\=unit then Binary<-{@Superman get_binary($)} else Binary<-false end end @Binary end meth set_args(V) Args<-V end meth get_args($) @Args end meth set_optlist(V) Optlist<-V end meth get_optlist($) @Optlist end meth set_dorequires(V) DoRequires<-V end meth get_dorequires($) @DoRequires end meth get_format($) @Format end meth set_prefix(D) Prefix<-{Path.expand D} end meth get_prefix($) if @Prefix==unit then if @Superman\=unit then Prefix<-{@Superman get_prefix($)} else DOTOZ={Property.condGet 'oz.dotoz' unit} in if DOTOZ==unit then Prefix<-{Path.expand {Path.resolve {Property.get 'user.home'} '.oz'}} else Prefix<-{Path.expand DOTOZ} end end end @Prefix end meth set_dir(D) Dir<-{Path.expandInCWD D} end meth set_tmpdir(D) TmpDir<-{Path.expandInCWD D} end meth get_tmpdir($) @TmpDir end meth get_tmpnam($) F={OS.tmpnam} in if @TmpDir==unit then F else U={Path.toURL F} in {Path.resolve @TmpDir {Path.toString {AdjoinAt U absolute false}}} end end meth set_builddir(D) BuildDir<-{Path.expandInCWD D} end meth get_builddir($) if @BuildDir==unit then if @Superman\=unit then BuildDir<-{Path.resolve {@Superman get_builddir($)} @AsSubdir} elseif @Dir\=unit then BuildDir<-@Dir else BuildDir<-{Path.expandInCWD nil} end end @BuildDir end meth set_srcdir(D) SrcDir<-{Path.expandInCWD D} end meth get_srcdir($) if @SrcDir==unit then if @Superman\=unit then SrcDir<-{Path.resolve {@Superman get_srcdir($)} @AsSubdir} elseif @Dir\=unit then SrcDir<-@Dir elseif @MakeFile\=unit then SrcDir<-{Path.dirname @MakeFile} else SrcDir<-{Path.expandInCWD nil} end end @SrcDir end meth set_libroot(D) LibRoot<-{Path.expand D} end meth get_libroot($) if @LibRoot==unit then if @Superman\=unit then LibRoot<-{@Superman get_libroot($)} else LibRoot<-{Path.resolve Attribs,get_prefix($) 'cache'} end end @LibRoot end meth set_libdir(D) LibDir<-{Path.expand D} end meth get_libdir($) if @LibDir==unit then if @Uri\=unit then LibDir<-{Path.resolve Attribs,get_libroot($) {Path.toCache Attribs,get_uri($)}} elseif @Superman\=unit then LibDir<-{Path.resolve {@Superman get_libdir($)} @AsSubdir} else LibDir<-{Path.resolve Attribs,get_libroot($) {Path.toCache Attribs,get_uri($)}} end end @LibDir end meth set_bindir(D) BinDir<-{Path.expand D} end meth get_bindir($) if @BinDir==unit then if @Superman\=unit then BinDir<-{@Superman get_bindir($)} else BinDir<-{Path.resolve Attribs,get_prefix($) 'bin'} end end @BinDir end meth set_docroot(D) DocRoot<-{Path.expand D} end meth get_docroot($) if @DocRoot==unit then if @Superman\=unit then DocRoot<-{@Superman get_docroot($)} else DocRoot<-{Path.resolve Attribs,get_prefix($) 'doc'} end end @DocRoot end meth set_docdir(D) DocDir<-{Path.expand D} end meth get_docdir($) if @DocDir==unit then if @Superman\=unit then DocDir<-{Path.resolve {@Superman get_docdir($)} @AsSubdir} else DocDir<-{Path.resolve Attribs,get_docroot($) {Utils.mogulToFilename Attribs,get_mogul($)}} end end @DocDir end meth set_uri(U) Uri<-U end meth get_uri($) if @Uri==unit andthen @Superman\=unit then Uri<-{Path.resolveAtom {@Superman get_uri($)} @AsSubdir} end if @Uri==unit then raise ozmake(get_uri) end else @Uri end end meth maybe_get_uri($) if @Uri==unit andthen @Superman\=unit then U = {@Superman maybe_get_uri($)} in if U\=unit then Uri<-{Path.resolveAtom U @AsSubdir} end end @Uri end meth set_mogul(M) Mogul<-M end meth get_mogul($) if @Mogul==unit andthen @Superman\=unit then Mogul<-{@Superman get_mogul($)} end if @Mogul==unit then raise ozmake(get_mogul) end else @Mogul end end meth get_mogul_relax($) try {self get_mogul($)} catch E then {Value.byNeedFail E} end end meth set_xmogul(ID) XMogul<-ID end meth get_xmogul($) @XMogul end meth set_extractdir(D) ExtractDir<-{Path.expand D} end meth get_extractdir($) if @ExtractDir==unit then if @BuildDir==unit andthen @Dir==unit andthen @XMogul\=unit then D={Utils.mogulToFilename @XMogul} in if {Path.exists D} then raise ozmake(extract:dir(D)) end end ExtractDir<-D else ExtractDir<-Attribs,get_builddir($) end end @ExtractDir end meth get_package_or_guess($) if {self get_package_given($)} then {self get_package($)} else MOG = {self get_mogul($)} VER = {self get_version($)} PKG = {Path.resolveAtom {self get_builddir($)} {Utils.mogulToFilename MOG}#if VER==unit then nil else '-'#VER end#'.pkg'} in {self trace('package argument not given, using: '#PKG)} PKG end end meth set_default_use_makepkg(B) if @UseMakePkg==unit then UseMakePkg<-(B==true) end end meth set_use_makepkg(B) UseMakePkg<-(B==true) end meth set_makefile(F) MakeFile<-{Path.expandInCWD F} MakeFileGiven<-true end meth get_makefile($) if @MakeFile==unit andthen @Superman\=unit then M={@Superman get_makefile($)} D={Path.dirname M} B={Path.basename M} in MakeFile<-{Path.resolve {Path.resolve D @AsSubdir} B} end if @MakeFile==unit andthen @UseMakePkg\=false then %% get_srcdir cannot call get_makefile but must look at %% @MakeFile directly F = {Path.resolve Attribs,get_srcdir($) 'MAKEPKG.oz'} in if {Path.exists F} then MakeFile<-F end end if @MakeFile==unit then MakeFile<-{Path.resolve Attribs,get_srcdir($) 'makefile.oz'} end @MakeFile end meth get_makefile_given($) if @Superman\=unit then {@Superman get_makefile_given($)} else @MakeFileGiven end end meth set_contact(L) Contact<-L end meth get_contact($) @Contact end meth set_database(F) Database<-{Path.expand F} DatabaseGiven<-true end meth get_database($) if @Database==unit then if @Superman\=unit then Database<-{@Superman get_database($)} else Database<-{Path.resolve Attribs,get_prefix($) DB_OZMAKE} end end @Database end meth get_database_given($) if @Superman\=unit then {@Superman get_database_given($)} else @DatabaseGiven end end meth get_database_oldstyle($) {Path.resolve Attribs,get_prefix($) 'DATABASE'} end meth set_released(D) Released<-D end meth get_released($) if @Released==unit andthen @Superman\=unit then Released<-{@Superman get_released($)} end @Released end meth set_clean(L) Clean<-L end meth get_clean($) if @Clean==unit andthen @Superman\=unit then Clean<-{@Superman get_clean($)} end @Clean end meth set_veryclean(L) Veryclean<-L end meth get_veryclean($) if @Veryclean==unit andthen @Superman\=unit then Veryclean<-{@Superman get_veryclean($)} end @Veryclean end meth set_author(L) Author<-L end meth get_author($) if @Author==unit andthen @Superman\=unit then Author<-{@Superman get_author($)} end @Author end meth get_oz_home($) {Path.expand {Property.get 'oz.home'}} end meth get_oz_bindir($) {Path.resolve Attribs,get_oz_home($) 'bin'} end meth get_oz_engine($) if @OzEngine==unit then P={Path.resolveAtom Attribs,get_oz_bindir($) 'ozengine.exe'} in if {Path.exists P} then OzEngine<-P else OzEngine<-{Path.resolveAtom Attribs,get_oz_bindir($) 'ozengine'} end end @OzEngine end meth get_oz_ozc($) if @OzC==unit then P={Path.resolveAtom Attribs,get_oz_bindir($) 'ozc.exe'} in if {Path.exists P} then OzC<-P else OzC<-{Path.resolveAtom Attribs,get_oz_bindir($) 'ozc'} end end @OzC end meth get_oz_ozl($) if @OzL==unit then P={Path.resolveAtom Attribs,get_oz_bindir($) 'ozl.exe'} in if {Path.exists P} then OzL<-P else OzL<-{Path.resolveAtom Attribs,get_oz_bindir($) 'ozl'} end end @OzL end meth get_oz_oztool($) if @OzTool==unit then P={Path.resolveAtom Attribs,get_oz_bindir($) 'oztool.exe'} in if {Path.exists P} then OzTool<-P else OzTool<-{Path.resolveAtom Attribs,get_oz_bindir($) 'oztool'} end end @OzTool end meth set_bin_targets(L) BinTargets<-L end meth get_bin_targets($) @BinTargets end meth set_lib_targets(L) LibTargets<-L end meth get_lib_targets($) @LibTargets end meth set_doc_targets(L) DocTargets<-L end meth get_doc_targets($) @DocTargets end meth set_src_targets(L) SrcTargets<-L end meth get_src_targets($) @SrcTargets end meth set_fullbuild(B) FullBuild<-B end meth get_fullbuild($) if @Superman\=unit then {@Superman get_fullbuild($)} else @FullBuild end end meth set_blurb(S) Blurb<-S end meth get_blurb($) @Blurb end meth set_info_text(S) InfoText<-S end meth get_info_text($) @InfoText end meth set_info_html(S) InfoHtml<-S end meth get_info_html($) @InfoHtml end meth get_requires($) @Requires end meth set_requires(L) Requires<-L end meth set_verbose(L) case {Reverse L} of true|true|_ then VeryVerbose<-true Verbose<-true [] true|_ then Verbose<-true else Verbose<-false end end meth get_verbose($) if @Superman\=unit then {@Superman get_verbose($)} else @Verbose end end meth get_veryVerbose($) if @Superman\=unit then {@Superman get_veryVerbose($)} else @VeryVerbose end end meth set_quiet(B) Quiet<-B end meth get_quiet($) if @Superman\=unit then {@Superman get_quiet($)} else @Quiet end end meth set_justprint(B) JustPrint<-B end meth get_justprint($) if @Superman\=unit then {@Superman get_justprint($)} else @JustPrint end end meth set_optlevel(O) OptLevel<-O end meth get_optlevel($) if @Superman\=unit then {@Superman get_optlevel($)} else @OptLevel end end meth set_grade(G) Grade<-G if G==freshen then {self set_must_extract(false)} end end meth get_grade($) if @Superman\=unit then {@Superman get_grade($)} else @Grade end end meth set_replacefiles(B) ReplaceFiles<-B end meth get_replacefiles($) if @Superman\=unit then {@Superman get_replacefiles($)} else @ReplaceFiles end end meth set_keepzombies(B) KeepZombies<-B end meth get_keepzombies($) if @Superman\=unit then {@Superman get_keepzombies($)} else @KeepZombies end end meth set_savedb(B) SaveDB<-B end meth get_savedb($) if @Superman\=unit then {@Superman get_savedb($)} else @SaveDB end end meth set_includedocs(B) IncludeDocs<-B end meth get_includedocs($) if @Superman\=unit then {@Superman get_includedocs($)} else @IncludeDocs end end meth set_includelibs(B) IncludeLibs<-B end meth get_includelibs($) if @Superman\=unit then {@Superman get_includelibs($)} else @IncludeLibs end end meth set_includebins(B) IncludeBins<-B end meth get_includebins($) if @Superman\=unit then {@Superman get_includebins($)} else @IncludeBins end end meth set_extendpackage(B) ExtendPkg<-B end meth get_extendpackage($) if @Superman\=unit then {@Superman get_extendpackage($)} else @ExtendPkg end end meth set_gnu(B) GNU<-B end meth get_gnu($) if @GNU==unit then if @Superman\=unit then GNU<-{@Superman get_gnu($)} else GNU<-{self exec_check_for_gnu($)} end end @GNU end meth set_package(F) PackageGiven<-true Package<-{Path.expand F} end meth get_package($) if @Package==unit andthen @Superman\=unit then Package<-{@Superman get_package($)} end if @Package==unit then raise ozmake(get_package) end else @Package end end meth get_package_given($) if @Superman\=unit then {@Superman get_package_given($)} else @PackageGiven end end meth set_archive(U) Archive<-U end meth get_archive($) if @Superman\=unit then {@Superman get_archive($)} else @Archive end end meth set_linewidth(N) LineWidth<-N end meth get_linewidth($) if @Superman\=unit then {@Superman get_linewidth($)} else @LineWidth end end meth set_no_makefile(B) NoMakefile<-B end meth get_no_makefile($) if @Superman\=unit then {@Superman get_no_makefile($)} else @NoMakefile end end meth set_subdirs(L) Subdirs<-L end meth get_subdirs($) @Subdirs end meth set_assubdir(F) AsSubdir<-F end meth get_assubdir($) @AsSubdir end meth set_superman(M) Superman<-M end meth get_superman($) @Superman end meth get_submans($) if @Submans==unit then Submans<-{self subdirs_to_managers({self get_subdirs($)} $)} end @Submans end meth set_local(B) Local<-B end meth get_local($) if @Superman\=unit then {@Superman get_local($)} else @Local end end meth set_submakefiles(R) Submakefiles<-R end meth get_submakefiles($) @Submakefiles end meth has_submakefile(D $) {HasFeature @Submakefiles {Path.toAtom D}} end meth get_submakefile(D $) @Submakefiles.{Path.toAtom D} end meth set_includedirs(L) IncludeDirs<-L end meth get_includedirs($) @IncludeDirs end meth set_librarydirs(L) LibraryDirs<-L end meth get_librarydirs($) @LibraryDirs end %% `system' directories to pass to oztool meth set_sysincludedirsok(B) SysIncludeDirsOK<-(B==true) end meth set_syslibrarydirsok(B) SysLibraryDirsOK<-(B==true) end meth get_sysincludedirsok($) if @Superman\=unit then {@Superman get_sysincludedirsok($)} else @SysIncludeDirsOK end end meth get_syslibrarydirsok($) if @Superman\=unit then {@Superman get_syslibrarydirsok($)} else @SysLibraryDirsOK end end meth get_sysincludedirs($) if @SysIncludeDirs==unit then if {self get_sysincludedirsok($)} then if @Superman\=unit then SysIncludeDirs<-{@Superman get_sysincludedirs($)} else SysIncludeDirs<- [{Path.expand {Path.resolve {self get_prefix($)} 'platform/'#{Property.get 'platform.name'}#'/include'}} {Path.expand {Path.resolve {self get_prefix($)} 'include'}} {Path.expand {Path.resolve {Property.get 'oz.home'} 'platform/'#{Property.get 'platform.name'}#'/include'}} {Path.expand {Path.resolve {Property.get 'oz.home'} 'include'}}] end else SysIncludeDirs<-nil end end @SysIncludeDirs end meth get_syslibrarydirs($) if @SysLibraryDirs==unit then if {self get_syslibrarydirsok($)} then if @Superman\=unit then SysLibraryDirs<-{@Superman get_syslibrarydirs($)} else SysLibraryDirs<- [{Path.expand {Path.resolve {self get_prefix($)} 'platform/'#{Property.get 'platform.name'}#'/lib'}} {Path.expand {Path.resolve {Property.get 'oz.home'} 'platform/'#{Property.get 'platform.name'}#'/lib'}}] end else SysLibraryDirs<-nil end end @SysLibraryDirs end meth extend_resolver if @ResolverExtended then skip else ResolverExtended<-true if @Superman \= unit then {@Superman extend_resolver} else SRC={self get_srcdir($)} BLD={self get_builddir($)} SEP=[{Property.get 'path.separator'}] OZLOAD={Property.get 'oz.search.load'} in {OS.putEnv 'OZ_SEARCH_LOAD' OZLOAD #SEP# 'root='#SRC #SEP# 'root='#BLD} {Resolve.addHandler {Resolve.handler.root SRC}} {Resolve.addHandler {Resolve.handler.root BLD}} end end end meth subresolver_push(DST SRC) PATH = {OS.getEnv 'OZ_SEARCH_LOAD'} SEP = [{Property.get 'path.separator'}] DST_DIR = {Path.dirname DST} SRC_DIR = {Path.dirname SRC} DST_ENV = {OS.getEnv 'OZMAKE_BUILD_DIR'} SRC_ENV = {OS.getEnv 'OZMAKE_SOURCE_DIR'} in SubResolverStack <- (PATH#{Resolve.getHandlers}#DST_ENV#SRC_ENV)|@SubResolverStack {OS.putEnv 'OZ_SEARCH_LOAD' DST_DIR#SEP# SRC_DIR#SEP#PATH} {Resolve.addHandler {Resolve.handler.root DST_DIR}} {Resolve.addHandler {Resolve.handler.root SRC_DIR}} {OS.putEnv 'OZMAKE_BUILD_DIR' DST_DIR} {OS.putEnv 'OZMAKE_SOURCE_DIR' SRC_DIR} end meth subresolver_pop() case @SubResolverStack of (PATH#Handlers#DST_ENV#SRC_ENV)|L then SubResolverStack<-L {OS.putEnv 'OZ_SEARCH_LOAD' PATH} {Resolve.setHandlers Handlers} {OS.putEnv 'OZMAKE_BUILD_DIR' if DST_ENV==false then nil else DST_ENV end} {OS.putEnv 'OZMAKE_SOURCE_DIR' if SRC_ENV==false then nil else SRC_ENV end} end end meth set_fromPackage(B) FromPackage<-B end meth get_fromPackage($) if @Superman\=unit then {@Superman get_fromPackage($)} else @FromPackage end end meth set_moguldatabase(F) MogulDatabase<-{Path.expand F} MogulDatabaseGiven<-true end meth get_moguldatabase($) if @MogulDatabase==unit then if @Superman\=unit then MogulDatabase<-{@Superman get_moguldatabase($)} else MogulDatabase<-{Path.resolve Attribs,get_prefix($) DB_MOGUL} end end @MogulDatabase end meth get_moguldatabase_given($) @MogulDatabaseGiven end meth set_configfile(F) ConfigFile <- {Path.resolve Attribs,get_prefix($) F} end meth get_configfile($) if @ConfigFile==unit then {self set_configfile(DB_CONFIG)} end @ConfigFile end meth get_configfile_oldstyle($) {Path.resolve Attribs,get_prefix($) DB_CONFIG_OLDSTYLE} end meth set_mogulurl(U) MogulUrl <- {URL.toAtom {URL.toBase U}} end meth set_mogulpkgurl(U) MogulPkgURL <- {URL.toAtom {URL.toBase U}} end meth set_moguldocurl(U) MogulDocURL <- {URL.toAtom {URL.toBase U}} end meth set_moguldburl(U) MogulDBURL <- {URL.toAtom {URL.toBase U}} end meth get_mogulpkgurl($) if @MogulPkgURL==unit then if @MogulUrl==unit then raise ozmake(mogul:nopkgurl) end else MogulPkgURL <- {Path.resolveAtom @MogulUrl 'pkg'} end end @MogulPkgURL end meth get_moguldocurl($) if @MogulDocURL==unit then if @MogulUrl==unit then raise ozmake(mogul:nodocurl) end else MogulDocURL <- {Path.resolveAtom @MogulUrl 'doc'} end end @MogulDocURL end meth get_moguldburl($) if @MogulDBURL==unit then if @MogulUrl==unit then raise ozmake(mogul:nodburl) end else MogulDBURL <- {Path.resolveAtom @MogulUrl 'db'} end end @MogulDBURL end meth set_moguldir(D) MogulDir<-{Path.expand D} end meth set_mogulpkgdir(D) MogulPkgDir<-{Path.expand D} end meth set_moguldocdir(D) MogulDocDir<-{Path.expand D} end meth set_moguldbdir(D) MogulDBDir<-{Path.expand D} end meth get_mogulpkgdir($) if @MogulPkgDir==unit then if @MogulDir==unit then raise ozmake(mogul:nomogulpkgdir) end else MogulPkgDir<-{Path.expand {Path.resolve @MogulDir 'pkg'}} end end @MogulPkgDir end meth get_moguldocdir($) if @MogulDocDir==unit then if @MogulDir==unit then raise ozmake(mogul:nomoguldocdir) end else MogulDocDir<-{Path.expand {Path.resolve @MogulDir 'doc'}} end end @MogulDocDir end meth get_moguldbdir($) if @MogulDBDir==unit then if @MogulDir==unit then raise ozmake(mogul:nomoguldbdir) end else MogulDBDir<-{Path.expand {Path.resolve @MogulDir 'db'}} end end @MogulDBDir end meth set_categories(L) Categories<-L end meth get_categories($) @Categories end meth set_version(V) Version<-V end meth get_version($) @Version end meth set_exe(A) Exe<-A end meth get_exe($) @Exe end meth set_makepkgfile(F) if {Path.dirname F}\=nil then raise ozmake(makepkgfile({Path.toString F})) end else Makepkgfile<-F end end meth get_makepkgfile($) @Makepkgfile end meth set_must_extract(B) MustExtract<-B end meth get_must_extract($) @MustExtract end meth set_mogul_action(A) MogulAction<-{self mogul_validate_action(A $)} end meth get_mogul_action($) @MogulAction end meth set_mogulrootid(ID) if {Utils.isMogulID ID} then MogulRootID <- ID else raise ozmake(mogul:badrootid(ID)) end end end meth get_mogulrootid($) @MogulRootID end meth set_config_action(A) ConfigAction<-{self config_validate_action(A $)} end meth get_config_action($) @ConfigAction end meth set_database_ignore(B) DatabaseIgnore<-B end meth get_database_ignore($) @DatabaseIgnore end meth set_tar_targets(L) TarTargets<-L end meth get_tar_targets($) @TarTargets end meth set_provides_targets(L) ProvidesTargets<-L end meth get_provides_targets($) @ProvidesTargets end meth set_fast(B) Fast<-B end meth get_fast($) @Fast end meth set_want_version(S) if {Utils.isVersion S} then WantVersion<-S else raise ozmake(badwantversion(S)) end end end meth get_want_version($) @WantVersion end meth set_autodepend(B) AutoDepend<-B end meth get_autodepend($) @AutoDepend end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Builder.oz0000644000175000017500000000650010023672362022125 0ustar kevingkevingfunctor export 'class' : Builder import Path at 'Path.ozf' define class Builder attr AvoidCircularities:nil meth build(Targets) {self makefile_read} if Targets==nil then Builder,build_all else for T in Targets do Builder,build_target(T) end end end meth build_all {self install_requires} {self BuildAll} end meth BuildAll if {self get_includelibs($)} then for T in {self get_lib_targets($)} do Builder,build_target(T) Builder,build_runtime_dependencies(T) end end if {self get_includebins($)} then for T in {self get_bin_targets($)} do Builder,build_target(T) Builder,build_runtime_dependencies(T) end end {self recurse(BuildAll)} end meth build_runtime_dependencies(T) {self trace('Runtime dependencies of '#T)} try {self incr} for D in {self get_depends_install(T $)} do Builder,build_target(D) end finally {self decr} end end meth build_target(T) CIRC = @AvoidCircularities in {self extend_resolver} {self trace('target '#T)} if {Member T CIRC} then raise ozmake(build:circularity(T)) end end {self incr} try AvoidCircularities <- T|CIRC if {Not {self get_fullbuild($)}} andthen {self target_is_src(T $)} then {self make_src(T _)} else R={self get_rule(T $)} L={self get_depends_build(T $)} in for D in L do Builder,build_target(D) end if Builder,Outdated(T L $) then {self exec_rule(T R)} if Builder,Outdated(T L $) then raise ozmake(build:outdated(T)) end end else {self trace(T#' is up to date')} end end finally AvoidCircularities <- CIRC {self decr} end end meth Outdated(Target Deps $) SrcDir = {self get_srcdir($)} DstDir = {self get_builddir($)} T_full = {self maybeAddPlatform(Target $)} T_src = {Path.resolve SrcDir T_full} T_dst = {Path.resolve DstDir T_full} T_file = if {self exec_exists(T_dst $)} then T_dst elseif {self exec_exists(T_src $)} then T_src else unit end /* T_file = if {Path.exists T_dst} orelse ({self get_justprint($)} andthen {self simulated_exists(T_dst $)}) then T_dst elseif {Path.exists T_src} orelse ({self get_justprint($)} andthen {self simulated_exists(T_src $)}) then T_src else unit end */ in if T_file==unit then {self trace(Target#' is missing')} true else T_mtime = try {Path.stat T_file}.mtime catch _ then {self get_simulated_mtime(T_file $)} end in for D in Deps default:false return:Return do D_full = {self maybeAddPlatform(D $)} D_src = {Path.resolve SrcDir D_full} D_dst = {Path.resolve DstDir D_full} D_file = if {Path.exists D_dst} orelse ({self get_justprint($)} andthen {self simulated_exists(D_dst $)}) then D_dst elseif {Path.exists D_src} orelse ({self get_justprint($)} andthen {self simulated_exists(D_src $)}) then D_src else unit end in if D_file\=unit then D_mtime = try {Path.stat D_file}.mtime catch _ then {self get_simulated_mtime(D_file $)} end in if T_mtime HWant then true elseif HGot < HWant then false else {Loop TGot TWant} end else false end else true end end in fun {VersionIsAtLeast S} LGot = {Map {String.tokens {VirtualString.toString {Property.get 'oz.version'}} &.} StringToInt} LWant = {Map {String.tokens {VirtualString.toString S} &.} StringToInt} in {Loop LGot LWant} end end Table = {NewDictionary} fun {CondGet K D} {CondSelect Table K D} end Table.gumpdir := false%{VersionIsAtLeast '1.2.6'} if {VersionIsAtLeast '1.3.0'} then Table.'>=1.3.0' := true end end mozart-stdlib-20060615/mozart-stdlib/ozmake/HELP-man.xsl0000644000175000017500000002062110105644026022213 0ustar kevingkeving .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH OZMAKE 1 " , " .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME Ozmake \- Make for Oz .SH AUTHOR This man page has been automatically generated from the \fBozmake\fR help file. The \fBozmake\fR help file is maintained by Denys Duchier. .SH SEE ALSO Full documentation of the Mozart system and the Oz programming language is available through the the \fImozart-doc\fP package, or from the mozart web page \fIwww.mozart-oz.org\fP. See in particular the document \fIThe Oz Programming Interface\fP. .P .BR ozc (1), .BR ozd (1), .BR ozengine (1), .BR ozl (1), .BR oztool (1), .BR convertTextPickle (1). .SH DESCRIPTION .SS .B \fB\fR .br .P .P .IP .IP .TP .SM .br \fB\fR \fB\fR .RS .RE \fB\fP \fB\fP \fI<>\fP \fI<>\fP \fI<>\fR \fI<>\fR \fI\fP \fBdefault glob patterns:\fP .br \fB\fP \fB\fP \fI\fR .P mozart-stdlib-20060615/mozart-stdlib/ozmake/HELP.html0000644000175000017500000012420310250330401021567 0ustar kevingkeving ozmake

ozmake

Denys Duchier

provides
ozmake

see CHANGES for a list of changes between successive versions of ozmake.

USAGE

ozmake OPTIONS TARGETS

ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface.

SYNOPSIS

ozmake --help
ozmake [--build] [TARGETS...]
ozmake --install [TARGETS...]
ozmake --install [--package=PKG]
ozmake --uninstall [--package=PKG]
ozmake --clean
ozmake --veryclean
ozmake --create [--package=FILE]
ozmake --publish
ozmake --extract [--package=PKG]
ozmake --list [--package=MOGUL]
ozmake --config=(put|delete|list) ...
ozmake --mogul=(put|delete|list|export) ...

OPTIONS

In the following, we write meta variables between angle brackets, e.g. <PREFIX> or <URI as cache path>

General Options

-v, --verbose
print out more tracing information that the default. By supplying this option twice, you will sometimes get even more information.
-q, --quiet
suppress all tracing and feedback information
-n, --just-print
perform a dry run, i.e. just print what would happen without actually performing the actions
--local
do not recurse into subdirectories
--(no)autodepend
default: true
automatically determine build-time and install-time (run-time) dependencies. Currently, this is only supported for Oz sources by looking at import and require sections.
--(no)requires
default: true
automatically fetch and install other packages that the current one requires. This option is relevant both for building and for installing.

What you should remember here, is that -vn is your friend. Add -vn at the end of any ozmake invocation, and it will tell you in great detail what the command would do, without actually doing it.

Directories and URLs

--prefix=<PREFIX>
default: ~/.oz
root of private installation area
--dir=<DIR>
default: current directory
default directory for other options below
--builddir=<BUILDDIR>
default: <DIR>
directory in which to build
--srcdir=<SRCDIR>
default: <DIR>
directory where source files are located
--bindir=<BINDIR>
default: <PREFIX>/bin
directory where bin targets are placed
--libroot=<LIBROOT>
default: <PREFIX>/cache
root directory of cache into which lib targets are installed
--libdir=<LIBDIR>
default: <LIBROOT>/<URI as cache path>
directory into which lib targets are installed
--docroot=<DOCROOT>
default: <PREFIX>/doc
root directory into which doc targets are installed
--docdir=<DOCDIR>
default: <DOCROOT>/<MOGUL as filename>
directory into which doc targets are installed
--extractdir=<EXTRACTDIR>
default: <DIR>
directory into which to extract a package
--archive=<ARCHIVE>
default: http://www.mozart-oz.org/mogul/pkg
URL of mogul archive from which packages can be downloaded
--moguldir=<MOGULDIR>
directory in which are placed sub-directories for the user's contributions: a directory for packages, one for documentation, one for mogul database entries.
--mogulurl=<MOGULURL>
url corresponding to the <MOGULDIR> directory

Files

-m <FILE>, --makefile=<FILE>
default: <SRCDIR>/makefile.oz
location of makefile
-p <PKG>, --package=<PKG>
file or URL of package. when creating a package, it should be a local filename. when extracting or installing, it can also be a URL or a mogul id; in the latter case, the package is automatically downloaded from the mogul archive
-V <VERSION>, --packageversion=<VERSION>
this option is respected by --extract and --install. When --extract is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given <VERSION> of the package. --install will simply check that the package to be installed really has this <VERSION>.
--database=<DB>
default: <PREFIX>/DATABASE
base path of installed packages database. The database is saved in both pickled and textual format respectively in files <DB>.ozf and <DB>.txt

Help

ozmake --help
-h, --help
print this information message

Build

ozmake [--build]
build all targets
ozmake [--build] FILES...
build these target
-b, --build
this is the default. builds targets of the package
--optlevel=( none | debug | optimize )
default: optimize
select optimization level for compilation
-g, --debug, --optlevel=debug
compile with debugging
-O, --optimize, --optlevel=optimize
compile with full optimization. this is the default
--(no)gnu
is the C++ compiler the GNU compiler. this is determined automatically and allows a greater optimization level, namely passing -O3 rather than just -O to the compiler
--(no)fullbuild
default: false
also build the src targets
--includedir DIR, -I DIR
tell the C++ compiler to additionally search DIR for include files
--(no)sysincludedirs
default: true
tell the C++ compiler to additionally search (or not, if using --nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private ~/.oz area.
--librarydir DIR, -L DIR
tell the C++ linker to additionally search DIR for libraries
--(no)syslibrarydirs
default: true
tell the C++ linker to additionally search (or not, if using --nosyslibrarydirs) the Mozart-specific library directories located in the global installation directory and in the user's private ~/.oz area.

Install

ozmake --install
install using the makefile
ozmake --install FILES...
install these targets using the makefile
ozmake --install --package=PKG
install package PKG
-i, --install
install targets of the package and updates the package database
--grade=( none | same | up | down | any | freshen )
default: none
what to do if this package is already installed? ozmake will compare version and dates, where the version is more significant.
--grade=none
signals an error
--grade=same
requires versions and dates to be the same
--grade=up
requires a package with newer version or same version and newer release date than the one installed
--grade=down
requires a package with older version or same version and older release date than the one installed
--grade=any
no conditions
--grade=freshen
install if the package is newer else do nothing
-U, --upgrade
equivalent to --install --grade=up
--downgrade
equivalent to --install --grade=down
-A, --anygrade
equivalent to --install --grade=any
-F, --freshen
equivalent to --install --grade=freshen
--(no)replacefiles
default: false
allow installation to overwrite files from other packages
-R, --replace
equivalent to --install --grade=any --replacefiles
--(no)extendpackage
default: false
whether to replace or extend the current installation of this package if any
-X, --extend
equivalent to --install --grade=any --extendpackage
--(no)savedb
default: true
save the updated database after installation
--includedocs, --excludedocs
default: --includedocs
whether to install the doc targets
--includelibs, --excludelibs
default: --includelibs
whether to install the lib targets
--includebins, --excludebins
default: --includebins
whether to install the bin targets
--(no)keepzombies
default: false
whether to remove files left over from a previous installation of this package
--exe=( default | yes | no | both | multi )
default: default
the convention on Windows is that executables have a .exe, while on Unix they have no extension. The --exe option allows you to control the conventions used by ozmake when installing executables.
--exe=default
use the platform's convention
--exe=yes
use a .exe extension
--exe=no
use no extension
--exe=both
install all executables with .exe extension and without
--exe=multi
install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension

Uninstall

ozmake --uninstall
uninstall package described by makefile
ozmake --uninstall --package=PKG
uninstall package named by mogul id PKG
-e, --uninstall
uninstall a package

Clean

ozmake --clean
ozmake --veryclean
default glob patterns: *~ *.ozf *.o *.so-* *.exe
remove files as specified by the makefile's clean and veryclean features. --veryclean implies --clean.

Create

ozmake --create [--package=<FILE>]
create a package and save it in <FILE>. the files needed for the package are automatically computed from the makefile. If --package=<FILE> is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile.
--include(bins|libs|docs), --exclude(bins|libs|docs)
control which target types are included in the package

Publish

ozmake --publish
automatically takes care of all the steps necessary for creating/updating a package contributed by the user and making all necessary data available to the MOGUL librarian. See documentation for --mogul below.

Extract

ozmake --extract --package=<PKG>
extract the files from file or URL PKG. if <PKG> is a mogul id, then the package is automatically downloaded from the mogul archive

List

ozmake --list
list info for all packages in the installed package database
ozmake --list --package=<MOGUL>
list info for the installed package identified by mogul id <MOGUL>
--linewidth=N
default: 70
assume a line with of N characters

Config

ozmake --config=put <OPTIONS>
record the given <OPTIONS> in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overridden on the command line. For example: ozmake --config=put --prefix=/usr/local/oz saves /usr/local/oz as the default value for option --prefix
ozmake --config=delete <OPT1> ... <OPTn>
deletes some entries from the configuration database. For example: ozmake --config=delete prefix removes the default for --prefix from the configuration database
ozmake --config=list
lists the contents of ozmake's configuration database

the argument to --config can be abbreviated to any non-ambiguous prefix

Mogul

If you choose to contribute packages to the MOGUL archive, ozmake --mogul=<ACTION> simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simplest way is to use ozmake --publish which will take take care of all details for you.

ozmake --mogul=put
update the user's database of own mogul contributions with the data for this contribution (in local directory)
ozmake --mogul=put --package=<PKG>
same as above, but using the package <PKG> explicitly given
ozmake --mogul=delete <MOG1> ... <MOGn>
remove the entries with mogul ids <MOG1> through <MOGn> from the user's database of own contribution
ozmake --mogul=delete
remove entry for current contribution
ozmake --mogul=list
show the recorded data for all entries in the user's database of own mogul contributions
ozmake --mogul=list <MOG1> ... <MOGn>
show the recorded data for entries <MOG1> through <MOGn> in the user's database of own mogul contributions
ozmake --mogul=export
write all necessary mogul entries for the user's own mogul contributions. These are the entries which will be read by the MOGUL librarian to automatically assemble the full MOGUL database.

The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, these directories must also be available through URLs on the WEB. Here are some options that allow you to control this correspondence, and for which you should set default using ozmake --config=put

--moguldir=<MOGULDIR>
--mogulurl=<MOGULURL>
<MOGULDIR> is a directory which is also available on the WEB through url <MOGULURL>. <MOGULDIR> is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found.

For those who really enjoy pain, ozmake has of course many options to shoot yourself in the foot. In the options below <ID> stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below:

--mogulpkgdir=<MOGULPKGDIR>
default: <MOGULDIR>/pkg/<ID>/
--mogulpkgurl=<MOGULPKGURL>
default: <MOGULURL>/pkg/<ID>/
--moguldocdir=<MOGULDOCDIR>
default: <MOGULDIR>/doc/<ID>/
--moguldocurl=<MOGULDOCURL>
default: <MOGULURL>/doc/<ID>/
--moguldbdir=<MOGULDBDIR>
default: <MOGULDIR>/db/<ID>/
--moguldburl=<MOGULDBURL>
default: <MOGULURL>/db/<ID>/

Your contributions should all have mogul ids which are below the mogul id which you where granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell ozmake about it using:

--mogulrootid=<ROOTID>

and to set it using ozmake --config=put --mogulrootid=<ROOTID>

MAKEFILE

The makefile contains a single Oz record which describes the project and should normally be placed in a file called makefile.oz. A makefile typically looks like this:

        makefile(
          lib : ['Foo.ozf']
          uri : 'x-ozlib://mylib'
          mogul : 'mogul:/denys/lib-foo')

stating explicitly that there is one library target, namely the functor Foo.ozf, and that it should installed at URI:

        x-ozlib://mylib/Foo.ozf

and implicitly that it should be compiled from the Oz source file Foo.oz. When you invoke ozmake --install, the mogul feature serves to uniquely identify this package and the files it contributes in the ozmake database of installed packages.

There are many more features which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as files, should be given as virtual string; atoms are recommended except for features blurb, info_text and info_html, where strings are recommended.

        makefile(
          bin      : [ FILES... ]
          lib      : [ FILES... ]
          doc      : [ FILES... ]
          src      : [ FILES... ]
          depends  :
             o( FILE : [ FILES... ]
                ...
              )
          rules    :
             o( FILE : TOOL(FILE)
                ...
              )
          clean     : [ GLOB... ]
          veryclean : [ GLOB... ]
          uri       : URI
          mogul     : MOGUL
          author    : [ AUTHORS... ]
          released  : DATE
          blurb     : TEXT
          info_text : TEXT
          info_html : TEXT
          subdirs   : [ DIRS... ]
          requires  : [ MOGUL... ]
          categories: [ CATEGORY... ]
          version   : VERSION
          provides  : [ FILES... ]
        )

Features bin, lib and doc list targets to be installed in <BINDIR>, <LIBDIR> and <DOCDIR> respectively. bin targets should be executable functors, i.e. they should end with extension .exe. lib targets are typically compiled functors i.e. ending with extension .ozf, but could also be native functors, i.e. ending with extension .so, or simply data files. doc targets are documentation files.

Extensions

ozmake knows how to build targets by looking at the target's extension:

Foo.exe
is an executable functor and is created from Foo.ozf
Foo.ozf
is a compiled functor and is created from Foo.oz
Foo.o
is a compiled C++ file and is created from Foo.cc
Foo.so
is a native functor and is created from Foo.o
Foo.cc
is a C++ source file
Foo.hh
is a C++ header file

Note that these are abstract targets. In particular, Foo.so really denotes the file Foo.so-<PLATFORM> where <PLATFORM> identifies the architecture and operating system where the package is built; for example: linux-i486. Also, when a bin target Foo.exe is installed, it is installed both as <BINDIR>/Foo.exe and <BINDIR>/Foo so that it can be invoked as Foo on both Windows and Unix platforms.

It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions.

Rules

ozmake has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature rule which contains a record mapping target to rule:

        TARGET_FILE : TOOL(SOURCE_FILE)

the rule may also have a list of options:

        TARGET_FILE : TOOL(SOURCE_FILE OPTIONS)

The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are:

        'Foo.exe' : ozl('Foo.ozf' [executable])
        'Foo.ozf' : ozc('Foo.oz')
        'Foo.o'   : cc('Foo.cc')
        'Foo.so'  : ld('Foo.o')

The tools support the following options:

ozc
executable
make the result executable
'define'(S)
define macro S. Same as -DS on the command line
ozl
executable
make the result executable
cc
include(DIR)
Similar to the usual C++ compiler option -IDIR. DIR is a virtual string
'define'(MAC)
Similar to the usual C++ compiler option -DMAC. MAC is a virtual string
ld
library(DIR)
Similar to the usual C++ linker option -lDIR. DIR is a virtual string

You might want to specify a rule to create a pre-linked library:

        'Utils.ozf' : ozl('Foo.ozf')

or to create a non-prelinked executable:

        'Foo.exe' : ozc('Foo.oz' [executable])

Dependencies

ozmake automatically determines whether targets needed to be rebuilt, e.g. because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient e.g. because you use tool ozl (dependencies on imports), or \insert in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature depends which is a record mapping targets to list of dependencies:

        TARGET : [ FILES... ]

For example:

        'Foo.o' : [ 'Foo.hh' 'Baz.hh' ]

or

        'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ]

Cleaning

During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by ozmake --clean and ozmake --veryclean; the latter also implies the former. Files to be removed are specified by glob patterns where ? matches any 1 character and * matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but you can override them with features clean and veryclean which should be lists of glob patterns. For example the default clean glob patterns are:

        clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ]

Package Related Features

uri

feature uri indicates the URI where to install lib targets. For example:

        uri : 'x-ozlib://mylib/XML'

states that all lib targets (e.g. Foo.ozf) will be installed under this URI so that they can also be imported from it, i.e.:

       import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf'

mogul

feature mogul is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documentation files.

author

feature author is a virtual string or list of virtual string resp. identifying the author or authors of the package. It is recommended to identify authors by their mogul id, however is is also possible to simply give their names. For example, the recommended way is:

        author : 'mogul:/duchier'

but the following is also possible:

        author : 'Denys Duchier'

released

feature released is a virtual string specifying the date and time of release in the following format:

        released : "YYYY-MM-DD-HH:MM:SS"

time is optional. An appropriate release date using the current date and time is automatically inserted when invoking ozmake --create or ozmake --publish.

blurb

feature blurb contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the mogul archive.

info_text

feature info_text contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package.

info_html

feature info_html is similar to info_text but contains HTML rather than plain text.

src

feature src indicates which targets should be considered source, i.e. in particular non-buildable. All targets mentioned in src should be mentioned in bin, lib, or doc too. The point of src is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing pre-built Oz libraries. For example:

        makefile(
          lib : [ 'Foo.ozf' ]
          src : [ 'Foo.ozf' ]
          uri : 'x-ozlib://mylib'
          mogul : 'mogul:/myname/foolib')

is a makefile for a package that distribute the pre-compiled Foo.ozf, but does not also distribute its source Foo.oz. Normally, when you build a package it simply checks that the src files are present but will not attempt to build them. If you have the sources, you can force building the src targets if necessary using --fullbuild.

subdirs

feature subdirs is a list of bare filenames representing subdirectories of the project. By default, when necessary, ozmake will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The mogul id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus sub-makefiles can be simpler since they don't need to be concerned with package-level features.

requires

feature requires is a list of module URIs or package MOGUL ids. These represent the external dependencies of the package. They are not yet used, but eventually ozmake will be able to use them to automate the recursive installation of other packages required by the one you are interested in.

categories

feature categories is a list of MOGUL categories to help categorize this package in the MOGUL archive.

version

feature version is used to provide a version string. This is a string that consist of integers separated by single dots, e.g. "2" or "3.1.7".

provides

feature provides is used to override the default information about what the package provides, normally automatically computed from the bin and lib targets: it should be a list which contains a subset of these targets. The provides feature of a makefile does not override or otherwise affect its sub-makefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add:

        provides : nil
You should use the provides feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package.

CONTACTS

Authors should really be referred to by mogul ids denoting mogul entries that describe them. In order to make this easier, a makefile.oz may also contain a contact feature which is either a record describing a person, or a list of such records.

You should not have a contact feature in every makefile. Rather, the contact feature is usually intended for makefiles that only have a contact feature, i.e. whose only purpose is to create mogul entries for the corresponding persons. Here is an example of such a makefile:

        makefile(
           contact :
              o(
                 mogul : 'mogul:/duchier/denys'
                 name  : 'Denys Duchier'
                 email : 'duchier@ps.uni-sb.de'
                 www   : 'http://www.ps.uni-sb.de/~duchier/'))

You can invoke ozmake --publish on such a makefile to contribute the corresponding mogul database entries


Denys Duchier
mozart-stdlib-20060615/mozart-stdlib/ozmake/HELP.txt0000644000175000017500000006661010250330401021451 0ustar kevingkeving ozmake [1]Denys Duchier provides ozmake _________________________________________________________________ see [2]CHANGES for a list of changes between successive versions of ozmake. USAGE ozmake OPTIONS TARGETS ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface. SYNOPSIS ozmake --help ozmake [--build] [TARGETS...] ozmake --install [TARGETS...] ozmake --install [--package=PKG] ozmake --uninstall [--package=PKG] ozmake --clean ozmake --veryclean ozmake --create [--package=FILE] ozmake --publish ozmake --extract [--package=PKG] ozmake --list [--package=MOGUL] ozmake --config=(put|delete|list) ... ozmake --mogul=(put|delete|list|export) ... OPTIONS In the following, we write meta variables between angle brackets, e.g. or General Options -v, --verbose print out more tracing information that the default. By supplying this option twice, you will sometimes get even more information. -q, --quiet suppress all tracing and feedback information -n, --just-print perform a dry run, i.e. just print what would happen without actually performing the actions --local do not recurse into subdirectories --(no)autodepend default: true automatically determine build-time and install-time (run-time) dependencies. Currently, this is only supported for Oz sources by looking at import and require sections. --(no)requires default: true automatically fetch and install other packages that the current one requires. This option is relevant both for building and for installing. What you should remember here, is that -vn is your friend. Add -vn at the end of any ozmake invocation, and it will tell you in great detail what the command would do, without actually doing it. Directories and URLs --prefix= default: ~/.oz root of private installation area --dir= default: current directory default directory for other options below --builddir= default: directory in which to build --srcdir= default: directory where source files are located --bindir= default: /bin directory where bin targets are placed --libroot= default: /cache root directory of cache into which lib targets are installed --libdir= default: / directory into which lib targets are installed --docroot= default: /doc root directory into which doc targets are installed --docdir= default: / directory into which doc targets are installed --extractdir= default: directory into which to extract a package --archive= default: http://www.mozart-oz.org/mogul/pkg URL of mogul archive from which packages can be downloaded --moguldir= directory in which are placed sub-directories for the user's contributions: a directory for packages, one for documentation, one for mogul database entries. --mogulurl= url corresponding to the directory Files -m , --makefile= default: /makefile.oz location of makefile -p , --package= file or URL of package. when creating a package, it should be a local filename. when extracting or installing, it can also be a URL or a mogul id; in the latter case, the package is automatically downloaded from the mogul archive -V , --packageversion= this option is respected by --extract and --install. When --extract is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given of the package. --install will simply check that the package to be installed really has this . --database= default: /DATABASE base path of installed packages database. The database is saved in both pickled and textual format respectively in files .ozf and .txt Help ozmake --help -h, --help print this information message Build ozmake [--build] build all targets ozmake [--build] FILES... build these target -b, --build this is the default. builds targets of the package --optlevel=( none | debug | optimize ) default: optimize select optimization level for compilation -g, --debug, --optlevel=debug compile with debugging -O, --optimize, --optlevel=optimize compile with full optimization. this is the default --(no)gnu is the C++ compiler the GNU compiler. this is determined automatically and allows a greater optimization level, namely passing -O3 rather than just -O to the compiler --(no)fullbuild default: false also build the src targets --includedir DIR, -I DIR tell the C++ compiler to additionally search DIR for include files --(no)sysincludedirs default: true tell the C++ compiler to additionally search (or not, if using --nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private ~/.oz area. --librarydir DIR, -L DIR tell the C++ linker to additionally search DIR for libraries --(no)syslibrarydirs default: true tell the C++ linker to additionally search (or not, if using --nosyslibrarydirs) the Mozart-specific library directories located in the global installation directory and in the user's private ~/.oz area. Install ozmake --install install using the makefile ozmake --install FILES... install these targets using the makefile ozmake --install --package=PKG install package PKG -i, --install install targets of the package and updates the package database --grade=( none | same | up | down | any | freshen ) default: none what to do if this package is already installed? ozmake will compare version and dates, where the version is more significant. --grade=none signals an error --grade=same requires versions and dates to be the same --grade=up requires a package with newer version or same version and newer release date than the one installed --grade=down requires a package with older version or same version and older release date than the one installed --grade=any no conditions --grade=freshen install if the package is newer else do nothing -U, --upgrade equivalent to --install --grade=up --downgrade equivalent to --install --grade=down -A, --anygrade equivalent to --install --grade=any -F, --freshen equivalent to --install --grade=freshen --(no)replacefiles default: false allow installation to overwrite files from other packages -R, --replace equivalent to --install --grade=any --replacefiles --(no)extendpackage default: false whether to replace or extend the current installation of this package if any -X, --extend equivalent to --install --grade=any --extendpackage --(no)savedb default: true save the updated database after installation --includedocs, --excludedocs default: --includedocs whether to install the doc targets --includelibs, --excludelibs default: --includelibs whether to install the lib targets --includebins, --excludebins default: --includebins whether to install the bin targets --(no)keepzombies default: false whether to remove files left over from a previous installation of this package --exe=( default | yes | no | both | multi ) default: default the convention on Windows is that executables have a .exe, while on Unix they have no extension. The --exe option allows you to control the conventions used by ozmake when installing executables. --exe=default use the platform's convention --exe=yes use a .exe extension --exe=no use no extension --exe=both install all executables with .exe extension and without --exe=multi install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension Uninstall ozmake --uninstall uninstall package described by makefile ozmake --uninstall --package=PKG uninstall package named by mogul id PKG -e, --uninstall uninstall a package Clean ozmake --clean ozmake --veryclean default glob patterns: *~ *.ozf *.o *.so-* *.exe remove files as specified by the makefile's clean and veryclean features. --veryclean implies --clean. Create ozmake --create [--package=] create a package and save it in . the files needed for the package are automatically computed from the makefile. If --package= is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile. --include(bins|libs|docs), --exclude(bins|libs|docs) control which target types are included in the package Publish ozmake --publish automatically takes care of all the steps necessary for creating/updating a package contributed by the user and making all necessary data available to the MOGUL librarian. See documentation for --mogul below. Extract ozmake --extract --package= extract the files from file or URL PKG. if is a mogul id, then the package is automatically downloaded from the mogul archive List ozmake --list list info for all packages in the installed package database ozmake --list --package= list info for the installed package identified by mogul id --linewidth=N default: 70 assume a line with of N characters Config ozmake --config=put record the given in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overridden on the command line. For example: ozmake --config=put --prefix=/usr/local/oz saves /usr/local/oz as the default value for option --prefix ozmake --config=delete ... deletes some entries from the configuration database. For example: ozmake --config=delete prefix removes the default for --prefix from the configuration database ozmake --config=list lists the contents of ozmake's configuration database the argument to --config can be abbreviated to any non-ambiguous prefix Mogul If you choose to contribute packages to the MOGUL archive, ozmake --mogul= simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simplest way is to use ozmake --publish which will take take care of all details for you. ozmake --mogul=put update the user's database of own mogul contributions with the data for this contribution (in local directory) ozmake --mogul=put --package= same as above, but using the package explicitly given ozmake --mogul=delete ... remove the entries with mogul ids through from the user's database of own contribution ozmake --mogul=delete remove entry for current contribution ozmake --mogul=list show the recorded data for all entries in the user's database of own mogul contributions ozmake --mogul=list ... show the recorded data for entries through in the user's database of own mogul contributions ozmake --mogul=export write all necessary mogul entries for the user's own mogul contributions. These are the entries which will be read by the MOGUL librarian to automatically assemble the full MOGUL database. The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, these directories must also be available through URLs on the WEB. Here are some options that allow you to control this correspondence, and for which you should set default using ozmake --config=put --moguldir= --mogulurl= is a directory which is also available on the WEB through url . is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found. For those who really enjoy pain, ozmake has of course many options to shoot yourself in the foot. In the options below stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below: --mogulpkgdir= default: /pkg// --mogulpkgurl= default: /pkg// --moguldocdir= default: /doc// --moguldocurl= default: /doc// --moguldbdir= default: /db// --moguldburl= default: /db// Your contributions should all have mogul ids which are below the mogul id which you where granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell ozmake about it using: --mogulrootid= and to set it using ozmake --config=put --mogulrootid= MAKEFILE The makefile contains a single Oz record which describes the project and should normally be placed in a file called makefile.oz. A makefile typically looks like this: makefile( lib : ['Foo.ozf'] uri : 'x-ozlib://mylib' mogul : 'mogul:/denys/lib-foo') stating explicitly that there is one library target, namely the functor Foo.ozf, and that it should installed at URI: x-ozlib://mylib/Foo.ozf and implicitly that it should be compiled from the Oz source file Foo.oz. When you invoke ozmake --install, the mogul feature serves to uniquely identify this package and the files it contributes in the ozmake database of installed packages. There are many more features which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as files, should be given as virtual string; atoms are recommended except for features blurb, info_text and info_html, where strings are recommended. makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( FILE : [ FILES... ] ... ) rules : o( FILE : TOOL(FILE) ... ) clean : [ GLOB... ] veryclean : [ GLOB... ] uri : URI mogul : MOGUL author : [ AUTHORS... ] released : DATE blurb : TEXT info_text : TEXT info_html : TEXT subdirs : [ DIRS... ] requires : [ MOGUL... ] categories: [ CATEGORY... ] version : VERSION provides : [ FILES... ] ) Features bin, lib and doc list targets to be installed in , and respectively. bin targets should be executable functors, i.e. they should end with extension .exe. lib targets are typically compiled functors i.e. ending with extension .ozf, but could also be native functors, i.e. ending with extension .so, or simply data files. doc targets are documentation files. Extensions ozmake knows how to build targets by looking at the target's extension: Foo.exe is an executable functor and is created from Foo.ozf Foo.ozf is a compiled functor and is created from Foo.oz Foo.o is a compiled C++ file and is created from Foo.cc Foo.so is a native functor and is created from Foo.o Foo.cc is a C++ source file Foo.hh is a C++ header file Note that these are abstract targets. In particular, Foo.so really denotes the file Foo.so- where identifies the architecture and operating system where the package is built; for example: linux-i486. Also, when a bin target Foo.exe is installed, it is installed both as /Foo.exe and /Foo so that it can be invoked as Foo on both Windows and Unix platforms. It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions. Rules ozmake has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature rule which contains a record mapping target to rule: TARGET_FILE : TOOL(SOURCE_FILE) the rule may also have a list of options: TARGET_FILE : TOOL(SOURCE_FILE OPTIONS) The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are: 'Foo.exe' : ozl('Foo.ozf' [executable]) 'Foo.ozf' : ozc('Foo.oz') 'Foo.o' : cc('Foo.cc') 'Foo.so' : ld('Foo.o') The tools support the following options: ozc executable make the result executable 'define'(S) define macro S. Same as -DS on the command line ozl executable make the result executable cc include(DIR) Similar to the usual C++ compiler option -IDIR. DIR is a virtual string 'define'(MAC) Similar to the usual C++ compiler option -DMAC. MAC is a virtual string ld library(DIR) Similar to the usual C++ linker option -lDIR. DIR is a virtual string You might want to specify a rule to create a pre-linked library: 'Utils.ozf' : ozl('Foo.ozf') or to create a non-prelinked executable: 'Foo.exe' : ozc('Foo.oz' [executable]) Dependencies ozmake automatically determines whether targets needed to be rebuilt, e.g. because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient e.g. because you use tool ozl (dependencies on imports), or \insert in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature depends which is a record mapping targets to list of dependencies: TARGET : [ FILES... ] For example: 'Foo.o' : [ 'Foo.hh' 'Baz.hh' ] or 'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ] Cleaning During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by ozmake --clean and ozmake --veryclean; the latter also implies the former. Files to be removed are specified by glob patterns where ? matches any 1 character and * matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but you can override them with features clean and veryclean which should be lists of glob patterns. For example the default clean glob patterns are: clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ] Package Related Features uri feature uri indicates the URI where to install lib targets. For example: uri : 'x-ozlib://mylib/XML' states that all lib targets (e.g. Foo.ozf) will be installed under this URI so that they can also be imported from it, i.e.: import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf' mogul feature mogul is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documentation files. author feature author is a virtual string or list of virtual string resp. identifying the author or authors of the package. It is recommended to identify authors by their mogul id, however is is also possible to simply give their names. For example, the recommended way is: author : 'mogul:/duchier' but the following is also possible: author : 'Denys Duchier' released feature released is a virtual string specifying the date and time of release in the following format: released : "YYYY-MM-DD-HH:MM:SS" time is optional. An appropriate release date using the current date and time is automatically inserted when invoking ozmake --create or ozmake --publish. blurb feature blurb contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the mogul archive. info_text feature info_text contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package. info_html feature info_html is similar to info_text but contains HTML rather than plain text. src feature src indicates which targets should be considered source, i.e. in particular non-buildable. All targets mentioned in src should be mentioned in bin, lib, or doc too. The point of src is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing pre-built Oz libraries. For example: makefile( lib : [ 'Foo.ozf' ] src : [ 'Foo.ozf' ] uri : 'x-ozlib://mylib' mogul : 'mogul:/myname/foolib') is a makefile for a package that distribute the pre-compiled Foo.ozf, but does not also distribute its source Foo.oz. Normally, when you build a package it simply checks that the src files are present but will not attempt to build them. If you have the sources, you can force building the src targets if necessary using --fullbuild. subdirs feature subdirs is a list of bare filenames representing subdirectories of the project. By default, when necessary, ozmake will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The mogul id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus sub-makefiles can be simpler since they don't need to be concerned with package-level features. requires feature requires is a list of module URIs or package MOGUL ids. These represent the external dependencies of the package. They are not yet used, but eventually ozmake will be able to use them to automate the recursive installation of other packages required by the one you are interested in. categories feature categories is a list of MOGUL categories to help categorize this package in the MOGUL archive. version feature version is used to provide a version string. This is a string that consist of integers separated by single dots, e.g. "2" or "3.1.7". provides feature provides is used to override the default information about what the package provides, normally automatically computed from the bin and lib targets: it should be a list which contains a subset of these targets. The provides feature of a makefile does not override or otherwise affect its sub-makefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add: provides : nil You should use the provides feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package. CONTACTS Authors should really be referred to by mogul ids denoting mogul entries that describe them. In order to make this easier, a makefile.oz may also contain a contact feature which is either a record describing a person, or a list of such records. You should not have a contact feature in every makefile. Rather, the contact feature is usually intended for makefiles that only have a contact feature, i.e. whose only purpose is to create mogul entries for the corresponding persons. Here is an example of such a makefile: makefile( contact : o( mogul : 'mogul:/duchier/denys' name : 'Denys Duchier' email : 'duchier@ps.uni-sb.de' www : 'http://www.ps.uni-sb.de/~duchier/')) You can invoke ozmake --publish on such a makefile to contribute the corresponding mogul database entries _________________________________________________________________ [3]Denys Duchier References 1. http://www.lifl.fr/~duchier/ 2. file://localhost/usr/local/Mozart/Published/Mozart/ozmake/CHANGES 3. http://www.lifl.fr/~duchier/ mozart-stdlib-20060615/mozart-stdlib/ozmake/HELP.xml0000644000175000017500000012036510102376023021436 0ustar kevingkeving
USAGE ozmake OPTIONS TARGETS

ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface.

SYNOPSIS ozmake --help ozmake [--build] [TARGETS...] ozmake --install [TARGETS...] ozmake --install [--package=PKG] ozmake --uninstall [--package=PKG] ozmake --clean ozmake --veryclean ozmake --create [--package=FILE] ozmake --publish ozmake --extract [--package=PKG] ozmake --list [--package=MOGUL] ozmake --config=(put|delete|list) ... ozmake --mogul=(put|delete|list|export) ...
OPTIONS

In the following, we write meta variables between angle brackets, e.g. PREFIX or URI as cache path

General Options print out more tracing information that the default. By supplying this option twice, you will sometimes get even more information. suppress all tracing and feedback information perform a dry run, i.e. just print what would happen without actually performing the actions do not recurse into subdirectories true automatically determine build-time and install-time (run-time) dependencies. Currently, this is only supported for Oz sources by looking at import and require sections. true automatically fetch and install other packages that the current one requires. This option is relevant both for building and for installing.

What you should remember here, is that -vn is your friend. Add -vn at the end of any ozmake invocation, and it will tell you in great detail what the command would do, without actually doing it.

Directories and URLs ~/.oz root of private installation area current directory default directory for other options below DIR directory in which to build DIR directory where source files are located PREFIX/bin directory where bin targets are placed PREFIX/cache root directory of cache into which lib targets are installed LIBROOT/URI as cache path directory into which lib targets are installed URI x-ozlib://foo/bar/baz URI as cache path x-ozlib/foo/bar/baz LIBDIR LIBROOT/x-ozlib/foo/bar/baz PREFIX/doc root directory into which doc targets are installed DOCROOT/MOGUL as filename directory into which doc targets are installed MOGUL mogul:/aaa/bbb/ccc MOGUL as filename aaa-bbb-ccc DOCDIR DOCROOT/aaa-bbb-ccc DIR directory into which to extract a package http://www.mozart-oz.org/mogul/pkg URL of mogul archive from which packages can be downloaded MOGUL mogul:/aaa/bbb/ccc is downloaded from ARCHIVE/aaa-bbb-ccc.pkg directory in which are placed sub-directories for the user's contributions: a directory for packages, one for documentation, one for mogul database entries. url corresponding to the MOGULDIR directory Files SRCDIR/makefile.oz location of makefile file or URL of package. when creating a package, it should be a local filename. when extracting or installing, it can also be a URL or a mogul id; in the latter case, the package is automatically downloaded from the mogul archive this option is respected by --extract and --install. When --extract is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given VERSION of the package. --install will simply check that the package to be installed really has this VERSION. PREFIX/DATABASE base path of installed packages database. The database is saved in both pickled and textual format respectively in files DB.ozf and DB.txt Help ozmake --help print this information message Build ozmake [--build] build all targets ozmake [--build] FILES... build these target this is the default. builds targets of the package optimize select optimization level for compilation compile with debugging compile with full optimization. this is the default is the C++ compiler the GNU compiler. this is determined automatically and allows a greater optimization level, namely passing -O3 rather than just -O to the compiler false also build the src targets tell the C++ compiler to additionally search DIR for include files true tell the C++ compiler to additionally search (or not, if using --nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private ~/.oz area. tell the C++ linker to additionally search DIR for libraries true tell the C++ linker to additionally search (or not, if using --nosyslibrarydirs) the Mozart-specific library directories located in the global installation directory and in the user's private ~/.oz area. Install ozmake --install install using the makefile ozmake --install FILES... install these targets using the makefile ozmake --install --package=PKG install package PKG install targets of the package and updates the package database none what to do if this package is already installed? ozmake will compare version and dates, where the version is more significant. signals an error requires versions and dates to be the same requires a package with newer version or same version and newer release date than the one installed requires a package with older version or same version and older release date than the one installed no conditions install if the package is newer else do nothing equivalent to --install --grade=up equivalent to --install --grade=down equivalent to --install --grade=any equivalent to --install --grade=freshen false allow installation to overwrite files from other packages equivalent to --install --grade=any --replacefiles false whether to replace or extend the current installation of this package if any equivalent to --install --grade=any --extendpackage true save the updated database after installation --includedocs whether to install the doc targets --includelibs whether to install the lib targets --includebins whether to install the bin targets false whether to remove files left over from a previous installation of this package default the convention on Windows is that executables have a .exe, while on Unix they have no extension. The --exe option allows you to control the conventions used by ozmake when installing executables. use the platform's convention use a .exe extension use no extension install all executables with .exe extension and without install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension Uninstall ozmake --uninstall uninstall package described by makefile ozmake --uninstall --package=PKG uninstall package named by mogul id PKG uninstall a package Clean ozmake --clean ozmake --veryclean *~ *.ozf *.o *.so-* *.exe remove files as specified by the makefile's clean and veryclean features. --veryclean implies --clean. Create ozmake --create [--package=FILE] create a package and save it in FILE. the files needed for the package are automatically computed from the makefile. If --package=FILE is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile. control which target types are included in the package Publish ozmake --publish automatically takes care of all the steps necessary for creating/updating a package contributed by the user and making all necessary data available to the MOGUL librarian. See documentation for --mogul below. Extract ozmake --extract --package=PKG extract the files from file or URL PKG. if PKG is a mogul id, then the package is automatically downloaded from the mogul archive List ozmake --list list info for all packages in the installed package database ozmake --list --package=MOGUL list info for the installed package identified by mogul id MOGUL 70 assume a line with of N characters Config ozmake --config=put OPTIONS record the given OPTIONS in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overridden on the command line. For example: ozmake --config=put --prefix=/usr/local/oz saves /usr/local/oz as the default value for option --prefix ozmake --config=delete OPT1 ... OPTn deletes some entries from the configuration database. For example: ozmake --config=delete prefix removes the default for --prefix from the configuration database ozmake --config=list lists the contents of ozmake's configuration database

the argument to --config can be abbreviated to any non-ambiguous prefix

Mogul

If you choose to contribute packages to the MOGUL archive, ozmake --mogul=ACTION simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simplest way is to use ozmake --publish which will take take care of all details for you.

ozmake --mogul=put update the user's database of own mogul contributions with the data for this contribution (in local directory) ozmake --mogul=put --package=PKG same as above, but using the package PKG explicitly given ozmake --mogul=delete MOG1 ... MOGn remove the entries with mogul ids MOG1 through MOGn from the user's database of own contribution ozmake --mogul=delete remove entry for current contribution ozmake --mogul=list show the recorded data for all entries in the user's database of own mogul contributions ozmake --mogul=list MOG1 ... MOGn show the recorded data for entries MOG1 through MOGn in the user's database of own mogul contributions ozmake --mogul=export write all necessary mogul entries for the user's own mogul contributions. These are the entries which will be read by the MOGUL librarian to automatically assemble the full MOGUL database.

The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, these directories must also be available through URLs on the WEB. Here are some options that allow you to control this correspondence, and for which you should set default using ozmake --config=put

MOGULDIR is a directory which is also available on the WEB through url MOGULURL. MOGULDIR is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found.

For those who really enjoy pain, ozmake has of course many options to shoot yourself in the foot. In the options below ID stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below:

MOGULDIR/pkg/ID/ MOGULURL/pkg/ID/ MOGULDIR/doc/ID/ MOGULURL/doc/ID/ MOGULDIR/db/ID/ MOGULURL/db/ID/

Your contributions should all have mogul ids which are below the mogul id which you where granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell ozmake about it using:

and to set it using ozmake --config=put --mogulrootid=ROOTID

MAKEFILE

The makefile contains a single Oz record which describes the project and should normally be placed in a file called makefile.oz. A makefile typically looks like this:

makefile( lib : ['Foo.ozf'] uri : 'x-ozlib://mylib' mogul : 'mogul:/denys/lib-foo')

stating explicitly that there is one library target, namely the functor Foo.ozf, and that it should installed at URI:

x-ozlib://mylib/Foo.ozf

and implicitly that it should be compiled from the Oz source file Foo.oz. When you invoke ozmake --install, the mogul feature serves to uniquely identify this package and the files it contributes in the ozmake database of installed packages.

There are many more features which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as files, should be given as virtual string; atoms are recommended except for features blurb, info_text and info_html, where strings are recommended.

makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( FILE : [ FILES... ] ... ) rules : o( FILE : TOOL(FILE) ... ) clean : [ GLOB... ] veryclean : [ GLOB... ] uri : URI mogul : MOGUL author : [ AUTHORS... ] released : DATE blurb : TEXT info_text : TEXT info_html : TEXT subdirs : [ DIRS... ] requires : [ MOGUL... ] categories: [ CATEGORY... ] version : VERSION provides : [ FILES... ] )

Features bin, lib and doc list targets to be installed in BINDIR, LIBDIR and DOCDIR respectively. bin targets should be executable functors, i.e. they should end with extension .exe. lib targets are typically compiled functors i.e. ending with extension .ozf, but could also be native functors, i.e. ending with extension .so, or simply data files. doc targets are documentation files.

Extensions

ozmake knows how to build targets by looking at the target's extension:

Foo.exe is an executable functor and is created from Foo.ozf Foo.ozf is a compiled functor and is created from Foo.oz Foo.o is a compiled C++ file and is created from Foo.cc Foo.so is a native functor and is created from Foo.o Foo.cc is a C++ source file Foo.hh is a C++ header file

Note that these are abstract targets. In particular, Foo.so really denotes the file Foo.so-PLATFORM where PLATFORM identifies the architecture and operating system where the package is built; for example: linux-i486. Also, when a bin target Foo.exe is installed, it is installed both as BINDIR/Foo.exe and BINDIR/Foo so that it can be invoked as Foo on both Windows and Unix platforms.

It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions.

Rules

ozmake has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature rule which contains a record mapping target to rule:

TARGET_FILE : TOOL(SOURCE_FILE)

the rule may also have a list of options:

TARGET_FILE : TOOL(SOURCE_FILE OPTIONS)

The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are:

'Foo.exe' : ozl('Foo.ozf' [executable]) 'Foo.ozf' : ozc('Foo.oz') 'Foo.o' : cc('Foo.cc') 'Foo.so' : ld('Foo.o')

The tools support the following options:

ozc executable make the result executable 'define'(S) define macro S. Same as -DS on the command line ozl executable make the result executable cc include(DIR) Similar to the usual C++ compiler option -IDIR. DIR is a virtual string 'define'(MAC) Similar to the usual C++ compiler option -DMAC. MAC is a virtual string ld library(DIR) Similar to the usual C++ linker option -lDIR. DIR is a virtual string

You might want to specify a rule to create a pre-linked library:

'Utils.ozf' : ozl('Foo.ozf')

or to create a non-prelinked executable:

'Foo.exe' : ozc('Foo.oz' [executable])
Dependencies

ozmake automatically determines whether targets needed to be rebuilt, e.g. because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient e.g. because you use tool ozl (dependencies on imports), or \insert in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature depends which is a record mapping targets to list of dependencies:

TARGET : [ FILES... ]

For example:

'Foo.o' : [ 'Foo.hh' 'Baz.hh' ]

or

'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ]
Cleaning

During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by ozmake --clean and ozmake --veryclean; the latter also implies the former. Files to be removed are specified by glob patterns where ? matches any 1 character and * matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but you can override them with features clean and veryclean which should be lists of glob patterns. For example the default clean glob patterns are:

clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ]
Package Related Features uri

feature uri indicates the URI where to install lib targets. For example:

uri : 'x-ozlib://mylib/XML'

states that all lib targets (e.g. Foo.ozf) will be installed under this URI so that they can also be imported from it, i.e.:

import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf'
mogul

feature mogul is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documentation files.

author

feature author is a virtual string or list of virtual string resp. identifying the author or authors of the package. It is recommended to identify authors by their mogul id, however is is also possible to simply give their names. For example, the recommended way is:

author : 'mogul:/duchier'

but the following is also possible:

author : 'Denys Duchier'
released

feature released is a virtual string specifying the date and time of release in the following format:

released : "YYYY-MM-DD-HH:MM:SS"

time is optional. An appropriate release date using the current date and time is automatically inserted when invoking ozmake --create or ozmake --publish.

blurb

feature blurb contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the mogul archive.

info_text

feature info_text contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package.

info_html

feature info_html is similar to info_text but contains HTML rather than plain text.

src

feature src indicates which targets should be considered source, i.e. in particular non-buildable. All targets mentioned in src should be mentioned in bin, lib, or doc too. The point of src is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing pre-built Oz libraries. For example:

makefile( lib : [ 'Foo.ozf' ] src : [ 'Foo.ozf' ] uri : 'x-ozlib://mylib' mogul : 'mogul:/myname/foolib')

is a makefile for a package that distribute the pre-compiled Foo.ozf, but does not also distribute its source Foo.oz. Normally, when you build a package it simply checks that the src files are present but will not attempt to build them. If you have the sources, you can force building the src targets if necessary using --fullbuild.

subdirs

feature subdirs is a list of bare filenames representing subdirectories of the project. By default, when necessary, ozmake will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The mogul id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus sub-makefiles can be simpler since they don't need to be concerned with package-level features.

requires

feature requires is a list of module URIs or package MOGUL ids. These represent the external dependencies of the package. They are not yet used, but eventually ozmake will be able to use them to automate the recursive installation of other packages required by the one you are interested in.

categories

feature categories is a list of MOGUL categories to help categorize this package in the MOGUL archive.

version

feature version is used to provide a version string. This is a string that consist of integers separated by single dots, e.g. "2" or "3.1.7".

provides

feature provides is used to override the default information about what the package provides, normally automatically computed from the bin and lib targets: it should be a list which contains a subset of these targets. The provides feature of a makefile does not override or otherwise affect its sub-makefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add: provides : nil You should use the provides feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package.

CONTACTS

Authors should really be referred to by mogul ids denoting mogul entries that describe them. In order to make this easier, a makefile.oz may also contain a contact feature which is either a record describing a person, or a list of such records.

You should not have a contact feature in every makefile. Rather, the contact feature is usually intended for makefiles that only have a contact feature, i.e. whose only purpose is to create mogul entries for the corresponding persons. Here is an example of such a makefile:

makefile( contact : o( mogul : 'mogul:/duchier/denys' name : 'Denys Duchier' email : 'duchier@ps.uni-sb.de' www : 'http://www.ps.uni-sb.de/~duchier/'))

You can invoke ozmake --publish on such a makefile to contribute the corresponding mogul database entries

mozart-stdlib-20060615/mozart-stdlib/ozmake/HELP.xsl0000644000175000017500000001602110250330401021427 0ustar kevingkeving -
Current version Version
ozmake for Unix
ozmake.exe for Windows
non executable functor ozmake.ozf for either
ozmake

ozmake

Denys Duchier

provides
ozmake

see CHANGES for a list of changes between successive versions of ozmake.


Denys Duchier

<>
,
default glob patterns:
default:
default glob patterns:
default:

example:

=
mozart-stdlib-20060615/mozart-stdlib/ozmake/Help.oz0000644000175000017500000000026307273531275021441 0ustar kevingkevingfunctor export Help require Utils at 'Utils.ozf' prepare HELP = {Utils.slurpFile 'HELP.txt'} import System(showError:Print) define proc {Help} {Print HELP} end end mozart-stdlib-20060615/mozart-stdlib/ozmake/IncludeUtils.oz0000644000175000017500000000171707276532007023157 0ustar kevingkevingfunctor define class IncludeGetter attr Files Stack meth init Files <- {NewDictionary} Stack <- nil end meth processFile(F) end end fun {SkipSpaces L} case L of & |L then {SkipSpaces L} [] &\t|L then {SkipSpaces L} else L end end fun {DropToEOL L} case L of &\n|L then L [] _|L then {DropToEOL L} [] nil then nil end end fun {SkipCComment L} case L of &*|&/|L then L [] _|L then {SkipCComment L} [] nil then nil end end fun {IgnoreCLine L} case L of &/|&/|L then {DropToEOL L} [] &/|&*|L then {IgnoreCLine {SkipCComment L}} [] &\n|L then L [] _|L then {IgnoreCLine L} [] nil then nil end end class CIncludeGetter from IncludeGetter meth processLine(L) case L of &#|L then L2={SkipSpaces L} in case L2 of &i|&n|&c|&l|&u|&d|&e|L then else { end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Installer.oz0000644000175000017500000002312710023672362022500 0ustar kevingkevingfunctor export 'class' : Installer import Path at 'Path.ozf' Utils at 'Utils.ozf' Windows at 'Windows.ozf' prepare DictItems = Dictionary.items fun {Cmp1 X Y} X.1 < Y.1 end define class Installer meth install_from_package DIR = {self get_tmpnam($)} in try {self set_srcdir(DIR)} {self set_builddir(DIR)} {self set_extractdir(DIR)} if {self extract(writeMakefile:false extracted:$)} then {self exec_mkdir(DIR)} {self install_all} end finally if {Path.exists DIR} then {self exec_rmdir(DIR)} end end end meth check_wanted_version() V1={self get_want_version($)} V2={self get_version($)} in if V1\=unit andthen V1\=V2 then raise ozmake(install:wantversion(V1 V2)) end end end %% return all install targets according to both makefile %% and command line options meth get_install_targets($) Accu = {Utils.newStack} Stack = {Utils.newStack} Done = {NewDictionary} in if {self get_includedocs($)} then for T in {self get_doc_targets($)} do {Stack.push T} end end if {self get_includelibs($)} then for T in {self get_lib_targets($)} do {Stack.push T} end end if {self get_includebins($)} then for T in {self get_bin_targets($)} do {Stack.push T} end end for while:{Not {Stack.isEmpty}} do T={Stack.pop} in if {HasFeature Done T} then skip else Done.T := unit {Accu.push T} %% fetch runtime dependencies for X in {self get_autodepend_install(T $)} do {Stack.push X} end end end {Accu.toList} end meth target_to_installed_file(T $) %% we add the platform suffix if necessary %% so that we can check directly presence or absence %% in the database. This is also why we return atoms. TT = {self maybeAddPlatform(T $)} in case {self target_to_section(T $)} of bin then {Path.resolveAtom {self get_bindir($)} TT} [] doc then {Path.resolveAtom {self get_docdir($)} TT} else % lib or defaulting to lib {Path.resolveAtom {self get_libdir($)} TT} end end meth targets_to_installation_pairs(L $) {Map L fun {$ T} %% at this point the file to be installed should %% have been built {self make_src(T $)} %% and we pair it with its destination #Installer,target_to_installed_file(T $) end} end meth targets_to_installation_triples(L $) {self ToTriples( {self targets_to_installation_pairs(L $)} $)} end meth install(Targets) if {self get_package_given($)} then Installer,install_from_package elseif Targets==nil then Installer,install_all else {self build(Targets)} ITriples = Installer,targets_to_installation_triples(Targets $) in Installer,install_itriples(ITriples) end end meth get_installation_pairs($) ITargets = Installer,get_install_targets($) IPairs = Installer,targets_to_installation_pairs(ITargets $) DPairs = {NewDictionary} proc {Enter IPair} Key = IPair.2 % dst file Old = {CondSelect DPairs Key unit} in if Old==unit then DPairs.Key := IPair elseif Old==IPair then skip else raise ozmake(install:clash(Old.1 IPair.1 Key)) end end end in {ForAll IPairs Enter} if {self get_local($)} then skip else for M in {self get_submans($)} do {ForAll {M get_installation_pairs($)} Enter} end end {Sort {DictItems DPairs} Cmp1} end meth get_installation_triples($) {self ToTriples({self get_installation_pairs($)} $)} end meth ToTriples(L $) %% bin targets are always named with a .exe extension %% however, when we install them we may want to install %% with or without the extension or both, or also both %% but the version with .exe for windows and the version %% without for unix. %% %% Thus, this conversion from pairs to triples may add new %% entries for bin targets. Each triple is of the form %% From # To # Action %% Action is one of file, exec, execUnix, execWindows %% file: install a regular file %% exec: install an executable file %% execUnix: relink for Unix before doing like exec %% execWindows: relink for Windows before doing like exec IsWin = Windows.isWin Actions = case {self get_exe($)} of default then if IsWin then [exe] else [plain] end [] yes then [exe] [] no then [plain] [] both then [exe plain] [] multi then if IsWin then [exe unix] else [plain windows] end end in for From#To in L collect:Collect do case {Path.extensionAtom From} of 'exe' then for A in Actions do case A of exe then {Collect From#To#exec} [] plain then {Collect From#{Path.dropExtensionAtom To}#exec} [] unix then {Collect From#{Path.dropExtensionAtom To}#execUnix} [] windows then {Collect From#To#execWindows} end end else {Collect From#To#file} end end end meth install_all %% need to read the makefile before computing install targets {self makefile_read} if {self database_check_grade($)} then {self xtrace('No need to freshen: skipping installation')} else {self build_all} ITriples = {self get_installation_triples($)} %%!!! Targets = {self get_install_targets($)} in Installer,install_itriples(ITriples) end end meth checkneeded($) {self extract(writeFiles:false)} {self makefile_read} {self database_read} if {self database_check_grade($)} then {self trace('install needed: yes')} 0 else {self trace('install needed: no')} 1 end end meth install_itriples(ITriples) %installation triples %% need to read the makefile before building targets {self makefile_read} %% --grade=GRADE {self database_read} if {self database_check_grade($)} then {self trace('No need to freshen: skipping installation')} else %%!!! %% make sure all targets have been built %%!!! for T in Targets do {self build_target(T)} end %% compute the files that will be written %%!!! IPairs = Installer,targets_to_installation_pairs(Targets $) MOG = {self get_mogul($)} PKG = {self database_mutable_entry(MOG $)} LostStack = {Utils.newStack} LostFiles IFiles = {Map ITriples fun {$ _#F#_} F end} in %% compute the files that will be overwritten and %% belong to other packages for _#F#_ in ITriples do FMog = {self file_to_package(F $)} in if FMog\=unit andthen FMog\=MOG then {LostStack.push F} end end LostFiles={LostStack.toList} %% complain about overwriting unless --replacefiles if LostFiles\=nil andthen {Not {self get_replacefiles($)}} then raise ozmake(install:overwriting(LostFiles)) end end %% actually install the targets {self trace('installing targets')} {self incr} try for From#To#Action in ITriples do case Action of file then {self exec_install_file(From To)} [] exec then {self exec_install_exec(From To)} [] execUnix then {self exec_install_execUnix(From To)} [] execWindows then {self exec_install_execWindows(From To)} end end finally {self decr} end %% update database %% move each lost file to its package lost list for F in LostFiles do Mog = {self file_to_package(F $)} Pkg = {self database_mutable_entry(Mog $)} in Pkg.files := {Utils.diff {CondSelect Pkg files nil} [F]} Pkg.lost := {Utils.union {CondSelect Pkg lost nil} [F]} end %% take care of the previous installation if {self get_extendpackage($)} then %% if we are extending the package %% add the files that were installed PKG.files := {Utils.union {CondSelect PKG files nil} IFiles} PKG.zombies := {Utils.diff {CondSelect PKG zombies nil} IFiles} else %% else compute the left overs from the previous installation %% i.e. every file in this package which is not being overwritten LeftFiles = {Utils.diff {CondSelect PKG files nil} IFiles} in if {self get_keepzombies($)} then %% move them to the zombie list PKG.zombies := {Utils.union LeftFiles {CondSelect PKG zombies nil}} PKG.lost := {Utils.diff {CondSelect PKG lost nil} IFiles} PKG.files := IFiles else PKG.files := IFiles %% forget that anything was ever lost PKG.lost := nil %% remove all zombies and left overs {self trace('removing zombies')} {self incr} try for F in {CondSelect PKG zombies nil} do {self exec_rm(F)} end PKG.zombies := nil for F in LeftFiles do {self exec_rm(F)} end finally {self decr} end end end %% now update all the other features of the package PKG.uri := {self get_uri($)} local L={self get_author($)} in if L\=unit then PKG.author := L end end local D={self get_released($)} in if D\=unit then PKG.released := D end end PKG.installed := {Utils.dateCurrent} local B={self get_blurb($)} in if B\=unit then PKG.blurb := B end end local I={self get_info_text($)} in if I\=unit then PKG.info_text := I end end local I={self get_info_html($)} in if I\=unit then PKG.info_html := I end end local V={self get_version($)} in if V\=unit then PKG.version := V end end local L={self get_requires($)} in if L\=unit andthen L\=nil then PKG.requires := L end end %% finally update the database {self database_save} end end end endmozart-stdlib-20060615/mozart-stdlib/ozmake/Lister.oz0000644000175000017500000000604307446634057022021 0ustar kevingkevingfunctor export 'class' : Lister prepare %% mogul uri author released installed blurb info_html info_text files lost zombies FEATURES = o( mogul : ' mogul: ' uri : ' uri: ' author : ' author: ' version : ' version: ' released : ' released: ' installed : ' installed: ' ) import Utils at 'Utils.ozf' define class Lister meth list if {self get_package_given($)} then Lister,list_package({self get_package($)}) else Lister,list_all end end meth list_all {self database_read} for E in {self database_get_packages($)} First in true;false do if First then skip else {self print(nil)} end Lister,LIST(E) end end meth list_package(MOG) {self database_read} PKG = {self database_get_package({VirtualString.toAtom MOG} $)} in if PKG==unit then {self xtrace('package '#MOG#' not found')} else Lister,LIST(PKG) end end meth LIST(PKG) Lister,PrintTitle(' package ' &=) %% mogul uri author released installed blurb info_html info_text files lost zombies if {CondSelect PKG mogul unit}\=unit then {self print(FEATURES.mogul#PKG.mogul)} end if {CondSelect PKG uri unit}\=unit then {self print(FEATURES.uri#PKG.uri)} end if {CondSelect PKG author unit}\=unit then for A in PKG.author do {self print(FEATURES.author#A)} end end if {CondSelect PKG version unit}\=unit then {self print(FEATURES.version#PKG.version)} end if {CondSelect PKG released unit}\=unit then {self print(FEATURES.released#{Utils.dateToUserVS PKG.released})} end if {CondSelect PKG installed unit}\=unit then {self print(FEATURES.installed#{Utils.dateToUserVS PKG.installed})} end if {CondSelect PKG requires unit}\=unit then Lister,PrintFiles(' requires ' PKG.requires) end if {CondSelect PKG blurb unit}\=unit then Lister,PrintTitle(' blurb ' &-) {self print(PKG.blurb)} end if {CondSelect PKG info_text unit}\=unit then Lister,PrintTitle(' info_text ' &-) {self print(PKG.info_text)} elseif {CondSelect PKG info_html unit}\=unit then Lister,PrintTitle(' info_html ' &-) {self print(PKG.info_html)} end case {CondSelect PKG files unit} of unit then skip [] nil then skip [] L then Lister,PrintFiles(' files ' L) end case {CondSelect PKG lost unit} of unit then skip [] nil then skip [] L then Lister,PrintFiles(' lost ' L) end case {CondSelect PKG zombies unit} of unit then skip [] nil then skip [] L then Lister,PrintFiles(' zombies ' L) end Lister,PrintTitle('' &=) end meth PrintTitle(Text Char) N = {VirtualString.length Text} M = {self get_linewidth($)} - N Line = {List.make M div 2} for X in Line do X=Char end More = {List.make M mod 2} for X in More do X=Char end in {self print(Line#Text#Line#More)} end meth PrintFiles(Title Files) Lister,PrintTitle(Title &-) for F in Files do {self print(' '#F)} end end end endmozart-stdlib-20060615/mozart-stdlib/ozmake/Main.oz0000644000175000017500000002223210023375300021413 0ustar kevingkevingfunctor import Application Error Manager at 'Manager.ozf' Help at 'Help.ozf' Errors at 'Errors.ozf' prepare OPTIONS = record( verbose(multiple char:&v type:bool) quiet( single char:&q type:bool) 'just-print'(single char:&n type:bool) optlevel( single type:atom(none debug optimize)) debug( char:&g alias:optlevel#debug) optimize( char:&O alias:optlevel#optimize) gnu( single type:bool) linewidth( single type:int) 'local'( single type:bool) prefix( single type:string) dir( single type:string) builddir( single type:string) srcdir( single type:string) bindir( single type:string) libdir( single type:string) docdir( single type:string) libroot( single type:string) docroot( single type:string) extractdir(single type:string) archive( single type:string) tmpdir( single type:string) makefile(single char:&m type:string) contactfile(single type:string) usemakepkg( single type:bool) package( single char:&p type:string) database(single type:string) moguldatabase(single type:string) configdatabase(single type:string) packageversion(single char:&V type:string) action(single type:atom(build install clean veryclean create publish extract list help uninstall edit checkneeded %%mogul )) build( char:&b alias:action#build) install( char:&i alias:action#install) fullbuild(single type:bool) clean( alias:action#clean) veryclean( alias:action#veryclean) create( char:&c alias:action#create) publish( alias:action#publish) extract( char:&x alias:action#extract) list( char:&l alias:action#list) help( char:&h alias:action#help) uninstall(char:&e alias:action#uninstall) edit( alias:action#edit) checkneeded( alias:[action#checkneeded grade#freshen]) %% again( alias:action#again) config(single type:string validate:alt(when(action false) when(true optional))) grade(single type:atom(none up down same any freshen)) upgrade( char:&U alias:[action#install grade#up]) downgrade( alias:[action#install grade#down]) anygrade( char:&A alias:[action#install grade#any]) freshen( char:&F alias:[action#install grade#freshen]) replacefiles(single type:bool) replace( char:&R alias:[action#install grade#any replacefiles#true]) extend( char:&X alias:[action#install grade#any extendpackage#true]) extendpackage(single type:bool) keepzombies(single type:bool) savedb(single type:bool) requires(single type:bool) '_installdocs'(single type:bool) includedocs(alias:'_installdocs'#true) excludedocs(alias:'_installdocs'#false) '_installlibs'(single type:bool) includelibs(alias:'_installlibs'#true) excludelibs(alias:'_installlibs'#false) '_installbins'(single type:bool) includebins(alias:'_installbins'#true) excludebins(alias:'_installbins'#false) includedir(multiple char:&I type:string) librarydir(multiple char:&L type:string) sysincludedirs(single type:bool) syslibrarydirs(single type:bool) mogul( single type:string) mogulpkgurl(single type:string) moguldocurl(single type:string) moguldburl( single type:string) mogulpkgdir(single type:string) moguldocdir(single type:string) moguldbdir( single type:string) mogulrootid(single type:string) moguldir( single type:string) mogulurl( single type:string) exe(single type:atom(default no yes both multi)) makepkgfile(single type:string) '_speed'(single type:bool) fast(alias:['_speed'#true]) slow(alias:['_speed'#false]) binary(single bool) autodepend(single type:bool) ) OPTLIST = [ %% OPTION # SET METHOD # CONFIGURABLE? # ON-FORK? verbose # set_verbose # false # true quiet # set_quiet # false # true 'just-print' # set_justprint # false # true optlevel # set_optlevel # true # false gnu # set_gnu # true # true prefix # set_prefix # true # true dir # set_dir # false # false builddir # set_builddir # false # false srcdir # set_srcdir # false # false bindir # set_bindir # false # true libdir # set_libdir # false # false docdir # set_docdir # false # false libroot # set_libroot # true # true docroot # set_docroot # true # true extractdir # set_extractdir # false # false mogulpkgurl # set_mogulpkgurl # true # false moguldocurl # set_moguldocurl # true # false moguldburl # set_moguldburl # true # false archive # set_archive # true # true tmpdir # set_tmpdir # true # true makefile # set_makefile # false # false contactfile # set_contactfile # false # false usemakepkg # set_use_makepkg # false # false package # set_package # false # false moguldatabase # set_moguldatabase # true # true database # set_database # true # true configfile # set_configfile # true # true grade # set_grade # false # false replacefiles # set_replacefiles # false # true keepzombies # set_keepzombies # false # true savedb # set_savedb # false # true '_installdocs' # set_includedocs # false # false '_installlibs' # set_includelibs # false # false '_installbins' # set_includebins # false # false extendpackage # set_extendpackage # false # false fullbuild # set_fullbuild # false # false linewidth # set_linewidth # true # true 'local' # set_local # false # false includedir # set_includedirs # true # false librarydir # set_librarydirs # true # false sysincludedirs # set_sysincludedirsok # true # false syslibrarydirs # set_syslibrarydirsok # true # false mogulpkgdir # set_mogulpkgdir # true # true moguldocdir # set_moguldocdir # true # true moguldbdir # set_moguldbdir # true # true exe # set_exe # true # true makepkgfile # set_makepkgfile # true # false mogul # set_mogul_action # false # false mogulrootid # set_mogulrootid # true # true moguldir # set_moguldir # true # true mogulurl # set_mogulurl # true # true config # set_config_action # false # false '_speed' # set_fast # true # true packageversion # set_want_version # false # false autodepend # set_autodepend # true # true requires # set_dorequires # false # true binary # set_binary # false # false ] define try local Args_ = {Application.getArgs OPTIONS} in Args = if {HasFeature Args_ action} then Args_ elseif {HasFeature Args_ config} then {AdjoinAt Args_ action config} elseif {HasFeature Args_ mogul} then {AdjoinAt Args_ action mogul} else {AdjoinAt Args_ action build} end end Man = {New Manager.'class' init} Targets = {Map Args.1 StringToAtom} in %% we may need this info for processing "requires" {Man set_args(Args)} {Man set_optlist(OPTLIST)} %% process the options supplied by the user for Key#Set#_#_ in OPTLIST do if {HasFeature Args Key} then {Man Set(Args.Key)} end end %% read some default configuration parameters {Man config_install(Args OPTLIST)} %% only use MAKEPKG.oz if installing from a package and not %% explicitly disabled by the user {Man set_default_use_makepkg(Args.action==install andthen {Man get_package_given($)})} case Args.action of build then {Man build(Targets)} [] install then {Man install(Targets)} [] clean then {Man clean} [] veryclean then {Man veryclean} [] create then {Man create} [] publish then {Man publish} [] extract then {Man extract} [] list then {Man list} [] help then {Help.help} [] uninstall then {Man uninstall} [] edit then {Man makefileEdit} [] config then {Man config(Args OPTLIST)} [] mogul then {Man mogul(Targets)} [] checkneeded then {Application.exit {Man checkneeded($)}} %% [] again then {Man again} end {Application.exit 0} catch E then {Wait Errors} {Error.printException E} {Application.exit 1} end end mozart-stdlib-20060615/mozart-stdlib/ozmake/MakeGUI.oz0000644000175000017500000000064507365422007021771 0ustar kevingkevingfunctor export 'class' : MakeGUI import QTK at 'x-oz://system/QTk.ozf' define class MakeGUI meth makefileEdit() {self makefile_read} {{QTK.build lr( label(text:"Project File Editor" glue:w) continue newline label(text:"Lib" glue:w) {List.toTuple td {Map {self get_lib_targets($)} fun {$ T} label(text:T glue:w) end}} )} show} {Wait _} end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Makefile.in0000644000175000017500000003170410032537447022242 0ustar kevingkeving#===================================================================== # DO NOT EDIT THIS FILE! # instead you should edit Makefile.vars and Makefile.rules # read the ozskel documentation if you forgot the details #===================================================================== #===================================================================== # DIRECTORIES #===================================================================== VPATH = @srcdir@ SRCDIR = @srcdir@ CYGSRCDIR = $(shell $(CYGPATH) $(SRCDIR)) CYGPATH = $(SRCDIR)/cygpath.sh SRCTOP = @top_srcdir@ BUILDDIR = $(shell pwd) CYGBUILDDIR = $(shell $(CYGPATH) $(BUILDDIR)) BUILDTOP = $(BUILDDIR) PREFIX = $(shell $(CYGPATH) @prefix@) OZHOME = $(shell $(CYGPATH) @OZHOME@) CACHE = $(PREFIX)/cache DOCDIR = $(PREFIX)/doc BINDIR = $(PREFIX)/bin PKGDIR = $(PREFIX)/pkg INCDIR = $(PREFIX)/include export OZHOME # moved up because needed early for windows OZTOOL = @VAR_OZTOOL@ PLATFORM = $(shell $(OZTOOL) platform) ifeq ($(PLATFORM),win32-i486) OZLOADSEP=; else OZLOADSEP=: endif # these additional 2 lines makes it possible to build in a directory # different from the source directory OZLOAD = prefix=$(CYGSRCDIR)=$(CYGBUILDDIR)$(OZLOADSEP)root=$(CYGBUILDDIR)$(OZLOADSEP)root=$(CYGSRCDIR)$(OZLOADSEP)cache=~/.oz/cache$(OZLOADSEP)cache=$(OZHOME)/cache export OZLOAD XSLTPROC = @VAR_XSLTPROC@ LYNX = @VAR_LYNX@ ELINKS = @VAR_ELINKS@ HTML_TO_TEXT = @VAR_HTML_TO_TEXT@ #===================================================================== # FILL IN THE BLANKS! # if possible do not change this file directly, instead: # (1) create a file Makefile.vars where you override the default # values of the variables below # (2) create a file Makefile.rules where you add new rules and # dependencies specific to your package # this makes it easier to upgrade your package to a new ozskel # version # # PKG_NAME # the name of your package. This is used as the base name for # creating distribution files (e.g. `tgz' and `zip' files). # Make sure you pick a name such that adding a `tgz' or `zip' # extension results in a filename that does not conflict with # any file or directory existing or created by your package. # PKG_MOGUL_URI # is the URI that uniquely identifies your package in the MOGUL # database. # PKG_URI # is the base URI for the modules in your package. This is # what's going to be used in `import' specifications. # PKG_URI_AUX # this is a sub URI for auxiliary modules and files that you # don't want to expose at the same level as the base URI, but # prefer to isolate in their own directory. # PKG_SOURCES # All the source files for your application. This is used for # creating source distributions. # PKG_INSTALLS # These are the filenames of the main modules of your # applications, e.g. Foo.ozf (i.e. the name of the compiled # functor Foo). They are used to determine what needs to be # installed, and, therefore, what needs to be built. # PKG_INSTALLS_AUX # Auxilliary modules to be installed at the auxiliary URI. # Note that these could also include data files, such as GIF # files etc... # PKG_INSTALLS_DOC # Documentation files to be installed (and therefore to be # built if necessary). # PKG_INSTALLS_BIN # Executable functors and scripts to be installed in $(BINDIR) # i.e. typically ~/.oz/bin # PKG_INSTALLS_INC # include files to be installed in $(INCDIR) i.e. typically # under ~/.oz/include/... using PKG_MOGUL_URI to derive the # proper subdir. # PKG_SUBDIRS # are the immediate subdirectories in which MAKE should recurse # PKG_API # a list of source functor files to hand to ozh for creating the # API documentation # PKG_METHOD # can be set to `find' for forcing the use of find to automati- # cally compute the list of source files to include in your # source archive. or it can be set to `make' to let the makefile # and sub-makefiles decide what to put in the archive. If not # set, its default value is find if PKG_SOURCES is empty and # make otherwise. # PKG_UPDATE # a list of abstract update targets in the set `tgz', `tar', and # `zip'. By default, just `tgz'. #===================================================================== ifndef PKG_NAME PKG_NAME = lewinsky-disaster PKG_MOGUL_URI = mogul:/clinton/lewinsky PKG_URI = x-ozlib://clinton/monica PKG_URI_AUX = $(PKG_URI)/sex-toys endif PKG_SOURCES = PKG_INSTALLS = PKG_INSTALLS_AUX= PKG_INSTALLS_DOC= PKG_INSTALLS_INC= PKG_INSTALLS_BIN= PKG_SUBDIRS = PKG_API = PKG_UPDATE = tgz PKG_CPPFLAGS = PKG_CFLAGS = PKG_LDFLAGS = PKG_OZCFLAGS = -z 9 PKG_OZLFLAGS = -z 9 PKG_OZHFLAGS = -include $(SRCDIR)/Makefile.vars ifndef PKG_METHOD PKG_METHOD = endif export PKG_NAME export PKG_MOGUL_URI export PKG_URI export PKG_URI_AUX export PKG_METHOD #===================================================================== # TOOLS #===================================================================== OZE = @VAR_OZE@ ifeq ($(PLATFORM),win32-i486) WITH_OZE= else WITH_OZE=$(OZE) endif OZC = $(WITH_OZE) @VAR_OZC@ OZL = $(WITH_OZE) @VAR_OZL@ OZH = $(WITH_OZE) @VAR_OZH@ INSTALL = @VAR_OZINSTALL@ INSTALL_BIN = $(INSTALL) -x INSTALL_FILE = $(INSTALL) -f INSTALL_DIR = $(INSTALL) -d CFLAGS = @CFLAGS@ OZCFLAGS = $(PKG_OZCFLAGS) OZLFLAGS = $(PKG_OZLFLAGS) OZHFLAGS = $(PKG_OZHFLAGS) #===================================================================== # RECURSIVE PROCESSING AND CLEANING UP # note that, when doing `make distclean', it is very important # to first recurse into subdirectories before removing the local # Makefile, otherwise there is no Makefile left to perform the # recursion! #===================================================================== @SET_MAKE@ all:: veryclean:: clean distclean:: veryclean ifdef PKG_SUBDIRS all clean distclean install install.top install.sub install.bin install.doc install.inc echo.api:: @dirs="$(PKG_SUBDIRS)"; \ for i in $$dirs; do \ if (cd $$i && $(MAKE) $@); \ then true; \ else exit 1; \ fi; \ done endif clean:: -rm -f *~ *.o *.so-* *.ozf confdefs.h distclean:: -rm -f config.cache config.log config.status Makefile #===================================================================== # RULES #===================================================================== .PHONY: all all.top all.aux all.bin all.doc \ clean veryclean distclean \ install install.top install.aux install.bin \ install.doc install.api install.src \ tgz update zip tar api update-tgz update-tar \ update-zip install.inc all :: Makefile all.top all.aux all.bin all.top :: $(PKG_INSTALLS) all.aux :: $(PKG_INSTALLS_AUX) all.bin :: $(PKG_INSTALLS_BIN) %.so-$(PLATFORM): %.o $(OZTOOL) ld $< -o $@ $(PKG_LDFLAGS) %.o: %.cc $(OZTOOL) c++ $(CFLAGS) $(PKG_CPPFLAGS) $(PKG_CFLAGS) -c $< -o $@ %.ozf: %.oz $(OZC) $(OZCFLAGS) -c $(shell $(CYGPATH) $<) -o $@ %.exe: %.ozf $(OZL) $(OZLFLAGS) -x $(shell $(CYGPATH) $<) -o $@ #===================================================================== # INSTALLATION #===================================================================== LIBPKG_DIR = $(subst //,/,$(subst :/,/,$(PKG_URI))) LIBPKG_DIR_AUX = $(subst //,/,$(subst :/,/,$(PKG_URI_AUX))) LIBPKG_MOGUL_DIR1 = $(subst mogul:,,$(PKG_MOGUL_URI)) LIBPKG_MOGUL_DIR2 = $(subst :/,/,$(LIBPKG_MOGUL_DIR1)) LIBPKG_MOGUL_DIR3 = O_Z_S_K_E_L_$(subst //,/,$(LIBPKG_MOGUL_DIR2)) LIBPKG_MOGUL_DIR4 = $(subst O_Z_S_K_E_L_/,,$(LIBPKG_MOGUL_DIR3)) LIBPKG_MOGUL_DIR = $(subst O_Z_S_K_E_L_,,$(LIBPKG_MOGUL_DIR4)) LIBDIR_TOP = $(CACHE)/$(LIBPKG_DIR) LIBDIR_AUX = $(CACHE)/$(LIBPKG_DIR_AUX) LIBDIR_DOC = $(DOCDIR)/$(LIBPKG_MOGUL_DIR) LIBDIR_INC = $(INCDIR)/$(LIBPKG_MOGUL_DIR) LIBDIR_BIN = $(BINDIR) LIBFILES_TOP = $(addprefix $(LIBDIR_TOP)/,$(PKG_INSTALLS)) LIBFILES_AUX = $(addprefix $(LIBDIR_AUX)/,$(PKG_INSTALLS_AUX)) LIBFILES_BIN = $(addprefix $(LIBDIR_BIN)/,$(PKG_INSTALLS_BIN)) LIBFILES_DOC = $(addprefix $(LIBDIR_DOC)/,$(PKG_INSTALLS_DOC)) LIBFILES_INC = $(addprefix $(LIBDIR_INC)/,$(PKG_INSTALLS_INC)) install :: install.top install.aux install.bin install.doc install.api install.inc install.top :: $(LIBFILES_TOP) install.aux :: $(LIBFILES_AUX) install.bin :: $(LIBFILES_BIN) install.doc :: $(LIBFILES_DOC) install.inc :: $(LIBFILES_INC) $(LIBFILES_TOP): $(LIBDIR_TOP)/% : % $(INSTALL_FILE) $< $@ $(LIBFILES_AUX): $(LIBDIR_AUX)/% : % $(INSTALL_FILE) $< $@ $(LIBFILES_BIN): $(LIBDIR_BIN)/% : % $(INSTALL_BIN) $< $@ $(LIBFILES_DOC): $(LIBDIR_DOC)/% : % $(INSTALL_FILE) $< $@ $(LIBFILES_INC): $(LIBDIR_INC)/% : % $(INSTALL_FILE) $< $@ #===================================================================== # AUTOMATICALLY REMAKE MAKEFILE WHEN NECESSARY # ===================================================================== Makefile: Makefile.in cd $(BUILDTOP) && ./config.status #===================================================================== # SOURCE TAR BALL #===================================================================== TMP_DIR = $(BUILDTOP)/ozskel_tmpdir TAR_DIR = $(TMP_DIR)/$(PKG_NAME) TGZ_FILE = $(BUILDTOP)/$(PKG_NAME).tgz ZIP_FILE = $(BUILDTOP)/$(PKG_NAME).zip TAR_FILE = $(BUILDTOP)/$(PKG_NAME).tar PKG_FILE = $(BUILDTOP)/$(PKG_NAME).pkg ifndef PKG_METHOD ifdef PKG_SOURCES PKG_METHOD = make else PKG_METHOD = find endif endif ifeq ($(PKG_METHOD),make) install.src:: @dirs="$(PKG_SUBDIRS)"; \ for i in $$dirs; do \ if (cd $$i && $(MAKE) $@); \ then true; \ else exit 1; \ fi; \ done endif ADMIN_SOURCES = Makefile.in Makefile.vars Makefile.rules \ ozinstall install-sh configure config.sub config.guess ifeq ($(PKG_METHOD),make) ADMIN_SOURCES1 = $(addprefix $(SRCDIR)/,$(ADMIN_SOURCES)) ADMIN_SOURCES2 = $(wildcard $(ADMIN_SOURCES1)) ADMIN_SOURCES3 = $(subst $(SRCDIR)/,,$(ADMIN_SOURCES2)) PKG_SOURCES1 = $(addprefix $(SRCDIR)/,$(PKG_SOURCES)) PKG_SOURCES2 = $(subst $(SRCTOP)/,,$(PKG_SOURCES1)) ALL_PKG_SOURCES = $(ADMIN_SOURCES3) $(PKG_SOURCES2) else FIND_DIRS = $(SRCDIR) FIND_SKIP_DIRS = API CVS SCCS RCS CVS.adm RCSLOG ozskel_tmpdir FIND_SKIP_FILES = aclocal.m4 configure.in config.status config.cache \ config.log Makefile .cvsignore \ *.ozf *.exe *.o *.so-* *~ tags TAGS .make.state .nse_depinfo \ \#* .\#* ,* _$$* *$$ *.old *.bak *.BAK *.orig *.rej .del-* \ *.a *.old *.obj *.so *.Z *.elc *.ln cvslog.* core CVS.adm RCSLOG\ $(PKG_NAME).* FIND_OPTIONS = \ $(patsubst %,\( ! -name '%' -o -prune \),$(FIND_SKIP_DIRS)) \ $(patsubst %,! -name '%',$(FIND_SKIP_FILES)) \ ! -type d FIND_SOURCES = $(shell find $(FIND_DIRS) $(FIND_OPTIONS) -print) ALL_PKG_SOURCES = $(subst $(SRCDIR)/,,$(FIND_SOURCES)) endif TAR_PKG_SOURCES = $(addprefix $(TAR_DIR)/,$(ALL_PKG_SOURCES)) $(TGZ_FILE): tgz tgz:: -rm -rf $(TMP_DIR) $(MAKE) install.src cd $(TMP_DIR) && tar zcf $(TGZ_FILE) $(PKG_NAME) $(TAR_FILE): tar tar:: -rm -rf $(TMP_DIR) $(MAKE) install.src cd $(TMP_DIR) && tar cf $(TAR_FILE) $(PKG_NAME) tarz:: $(TAR_FILE).Z %.Z: % $(COMPRESS) -c $< > $@ install.src:: $(TAR_PKG_SOURCES) $(TAR_PKG_SOURCES): $(TAR_DIR)/% : $(SRCTOP)/% $(INSTALL) -M $< $@ update:: $(addprefix update-,$(PKG_UPDATE)) clean:: -rm -rf $(TGZ_FILE) $(TAR_FILE).Z $(TMP_DIR) TGZ_FILE_DST = $(subst $(BUILDTOP)/,$(PKGDIR)/,$(TGZ_FILE)) TAR_FILE_DST = $(subst $(BUILDTOP)/,$(PKGDIR)/,$(TAR_FILE).Z) ZIP_FILE_DST = $(subst $(BUILDTOP)/,$(PKGDIR)/,$(ZIP_FILE)) PKG_FILE_DST = $(subst $(BUILDTOP)/,$(PKGDIR)/,$(PKG_FILE)) INSTALL_FILES_DST = $(TGZ_FILE_DST) $(TAR_FILE_DST) $(ZIP_FILE_DST) $(PKG_FILE_DST) $(INSTALL_FILES_DST): $(PKGDIR)/% : $(BUILDTOP)/% $(INSTALL_FILE) $< $@ .PHONY: $(INSTALL_FILES_DST) update-tgz :: $(TGZ_FILE_DST) update-tarz:: $(TAR_FILE_DST) update-zip :: $(ZIP_FILE_DST) #===================================================================== # OZPM SUPPORT - THIS WAS EXPERIMENTAL AND DOES NOT WORK AT PRESENT!!! #===================================================================== OZPMINFO = $(TMP_DIR)/OZPMINFO ifndef PKG_INFO define PKG_INFO echo "id: $(PKG_MOGUL_URI)" >> $(OZPMINFO) echo "version: $(PKG_VERSION)" >> $(OZPMINFO) echo "uri: $(PKG_URI)" >> $(OZPMINFO) echo "title: $(PKG_TITLE)" >> $(OZPMINFO) echo "blurb: $(PKG_BLURB)" >> $(OZPMINFO) endef endif clean:: -rm -f $(PKG_FILE) #===================================================================== # DEBUGGING # in order to build the package with debugging flags on # execute `make debug-all'. In fact `make debug-FOO' invokes # `make FOO' with debugging flags added to the default settings. #===================================================================== debug-%: $(MAKE) $* CFLAGS="-g $(CFLAGS)" OZCFLAGS="-g $(OZCFLAGS)" #===================================================================== # CREATING TAGS FILES #===================================================================== ETAGS_PATTERNS = *.c *.h *.cc *.hh *.el ETAGS_OPTIONS = -false $(patsubst %, -o -name '%',$(ETAGS_PATTERNS)) tags: cd $(BUILDTOP) && \ etags -l none \ --regex='/[ ]*\(proc\|fun\)[ ]*{[ ]*\([a-zA-Z0-9_]+\)/\2/' \ --regex='/.*[ ]class[ ]\([a-zA-Z0-9_]+\)/\1/' \ `find . -name '*.oz' -print` && \ etags -a -l auto \ --regex='/OZ_BI_define([ ]*\([^ ,)]+\)/\1/' \ `find . \( $(ETAGS_OPTIONS) \) -print` -include $(SRCDIR)/Makefile.rules mozart-stdlib-20060615/mozart-stdlib/ozmake/Makefile.rules0000644000175000017500000000632710250330401022750 0ustar kevingkeving# -*-makefile-*- # this file was provided by ozskel - read the ozskel documentation # Here you may provide additional make rules for use in Makefile.in OZMAKE_FILES = \ Main.ozf Utils.ozf Path.ozf Shell.ozf Executor.ozf Attribs.ozf \ Builder.ozf Makefiler.ozf Manager.ozf Installer.ozf Database.ozf \ Cleaner.ozf Creator.ozf Extractor.ozf Lister.ozf Help.ozf \ Uninstaller.ozf Errors.ozf Windows.ozf MakeGUI.ozf Fixes.ozf \ DatabaseLib.ozf Config.ozf Mogul.ozf Pickler.ozf \ ExecutorFast.ozf Depends.ozf Requires.ozf ozmake: ozmake.ozf $(OZL) $(OZLFLAGS) -x $< -o $@ ozmake.win: ozmake.ozf $(OZL) $(OZLFLAGS) --target=windows -x $< -o $@ ozmake.ozf: $(OZMAKE_FILES) $(OZL) $(OZLFLAGS) Main.ozf -o $@ Help.ozf: Help.oz HELP.txt Utils.ozf Utils.ozf: Utils.oz Path.ozf Windows.ozf Shell.ozf Help.ozf: Utils.ozf HELP.txt clean:: -rm -f ozmake ozmake.exe doc: $(MAKE) doc.html $(MAKE) doc.text $(MAKE) doc.man ifeq ($(XSLTPROC),UNDEFINED) doc.html: echo >&2 "xsltproc not found, but necessary to build the (html) documentation" echo >&2 "(see http://xmlsoft.org/XSLT/xsltproc2.html)" exit -1 else doc.html: $(XSLTPROC) -o $(SRCDIR)/HELP.html \ --stringparam OZMAKEOUTPUT html \ --stringparam OZMAKEVERSION $(VERSION) \ $(SRCDIR)/HELP.xsl $(SRCDIR)/HELP.xml cp $(SRCDIR)/HELP.html $(SRCDIR)/index.html endif ifeq ($(HTML_TO_TEXT),lynx) doc.text: $(LYNX) -dump $(SRCDIR)/HELP.html > $(SRCDIR)/HELP.txt endif ifeq ($(HTML_TO_TEXT),elinks) doc.text: $(ELINKS) -dump $(SRCDIR)/HELP.html > $(SRCDIR)/HELP.txt endif ifeq ($(HTML_TO_TEXT),UNDEFINED) doc.text: echo >&2 "neither lynx nor elinks were found" echo >&2 "but one of them is necessary to build the (text) documentation" echo >&2 "(see http://lynx.browser.org/)" exit -1 endif doc.man: $(XSLTPROC) -o $(SRCDIR)/HELP.man \ --stringparam OZMAKEVERSION $(VERSION) \ $(SRCDIR)/HELP-man.xsl $(SRCDIR)/HELP.xml cp $(SRCDIR)/HELP.man $(SRCDIR)/ozmake.1 other.doc: have.xsltproc ozmake.xml ozmake.xsl $(XSLTPROC) -o ozmake.html \ ozmake.xsl ozmake.xml #publish: duchier-ozmake-$(VERSION).pkg #duchier-ozmake-$(VERSION).pkg: $(OZMAKE_SOURCES) ./ozmake # ./ozmake --publish -v -p duchier-ozmake-$(VERSION).pkg duchier-ozmake.pkg: ozmake $(OZE) ./ozmake -cvp $@ # install-prebuilt:: ozmake.ozf ozmake ozmake.exe duchier-ozmake.pkg # $(INSTALL_FILE) ozmake.ozf $(PKGDIR)/ozmake.ozf # $(INSTALL_FILE) ozmake $(PKGDIR)/ozmake # $(INSTALL_FILE) ozmake.exe $(PKGDIR)/ozmake.exe # $(INSTALL_FILE) ozmake.ozf $(PKGDIR)/ozmake-$(VERSION).ozf # $(INSTALL_FILE) ozmake $(PKGDIR)/ozmake-$(VERSION) # $(INSTALL_FILE) ozmake.exe $(PKGDIR)/ozmake-$(VERSION).exe # $(INSTALL_FILE) duchier-ozmake.pkg $(PKGDIR)/duchier-ozmake.pkg # $(INSTALL_FILE) duchier-ozmake.pkg $(PKGDIR)/duchier-ozmake-$(VERSION).pkg #PREBUILTDIR=/usr/local/web/duchier/mogul/pkg PREBUILTDIR=/usr/local/Mozart/Published/Duchier/Export/pkg install-prebuilt:: ozmake.ozf ozmake ozmake.win $(INSTALL_FILE) ozmake.ozf $(PREBUILTDIR)/ozmake.ozf $(INSTALL_FILE) ozmake $(PREBUILTDIR)/ozmake $(INSTALL_FILE) ozmake.win $(PREBUILTDIR)/ozmake.exe $(INSTALL_FILE) ozmake.ozf $(PREBUILTDIR)/ozmake-$(VERSION).ozf $(INSTALL_FILE) ozmake $(PREBUILTDIR)/ozmake-$(VERSION) $(INSTALL_FILE) ozmake.win $(PREBUILTDIR)/ozmake-$(VERSION).exe mozart-stdlib-20060615/mozart-stdlib/ozmake/Makefile.vars0000644000175000017500000000134710250330401022566 0ustar kevingkeving# -*-makefile-*- # this file was provided by ozskel - read the ozskel documentation # Here you set variables used by Makefile.in VERSION = 0.90 PKG_NAME = duchier-ozmake-$(VERSION) PKG_MOGUL_URI = mogul:/duchier/ozmake PKG_URI = x-ozlib://duchier/tool PKG_SOURCES = Main.oz Utils.oz Path.oz Shell.oz Executor.oz Attribs.oz \ Builder.oz Makefiler.oz Manager.oz Installer.oz Database.oz \ Cleaner.oz Creator.oz Extractor.oz Lister.oz Help.oz \ Uninstaller.oz HELP.txt Errors.oz index.html Windows.oz \ MakeGUI.oz Fixes.oz DatabaseLib.oz CHANGES Config.oz Mogul.oz \ Pickler.oz ExecutorFast.oz Depends.oz Requires.oz PKG_INSTALLS = ozmake.ozf PKG_INSTALLS_BIN= ozmake ozmake.win PKG_UPDATE = tgz tarz PKG_INSTALLS_DOC= index.html CHANGES mozart-stdlib-20060615/mozart-stdlib/ozmake/Makefiler.oz0000644000175000017500000005262610023672362022450 0ustar kevingkevingfunctor export 'class' : Makefile import Property Path at 'Path.ozf' Utils at 'Utils.ozf' prepare MakeByteString = ByteString.make %% a rule is represented by a record %% rule(tool:TOOL file:FILE options:[...]) RULE_EXISTS = rule(tool:unit file:unit options:nil) VALID_MAKEFILE_FEATURES = [bin lib doc src depends rules uri mogul author released clean veryclean blurb info_text info_html subdirs submakefiles requires categories version contact tar provides platform] define fun {MakeRuleDefault Target} case {Path.extensionAtom Target} of 'exe' then rule(tool:ozl file:{Path.replaceExtensionAtom Target 'ozf'} options:[executable]) [] 'ozf' then rule(tool:ozc file:{Path.replaceExtensionAtom Target 'oz' } options:nil) [] 'o' then rule(tool:cc file:{Path.replaceExtensionAtom Target 'cc' } options:nil) [] 'so' then rule(tool:ld file:{Path.replaceExtensionAtom Target 'o' } options:nil) else RULE_EXISTS end end class Makefile attr Target2Section : unit Target2Rule : unit Target2Depends : unit TargetIsSource : unit meth target_to_section(T $) {CondSelect @Target2Section {Path.toAtom T} unit} end meth makefile_from_record(R) Target2Section<-{NewDictionary} Target2Rule <-{NewDictionary} Target2Depends<-{NewDictionary} TargetIsSource<-{NewDictionary} %% R should be a record representing a valid makefile. %% we extract from it the information it contains and %% make very careful sanity checks of everything if {Not {IsRecord R}} then raise ozmake(makefile:notrecord(R)) end end %% check that all features are expected for F in {Arity R} do if {Not {Member F VALID_MAKEFILE_FEATURES}} then raise ozmake(makefile:illegalfeature(F VALID_MAKEFILE_FEATURES)) end end end %% process uri feature if {HasFeature R uri} then U = try {Path.toURL R.uri} catch _ then raise ozmake(makefile:baduri(R.uri)) end end in if {CondSelect U scheme unit}==unit then raise ozmake(makefile:urinoscheme(R.uri)) end else {self set_uri({Path.toAtom U})} end end %% process mogul feature if {HasFeature R mogul} then U = try {Path.toURL R.mogul} catch _ then raise ozmake(makefile:badmogul(R.mogul)) end end in if {CondSelect U scheme unit}\="mogul" then raise ozmake(makefile:mogulbadscheme(R.mogul)) end else %% normalize MOGUL ID, i.e. no trailing slash {self set_mogul({Utils.cleanMogulID U})} end end %% process released feature if {HasFeature R released} then try {self set_released({Utils.dateParse R.released})} catch _ then raise ozmake(makefile:badreleased(R.released)) end end end %% process clean feature if {HasFeature R clean} then if {Not {IsList R.clean}} orelse {Not {All R.clean IsVirtualString}} then raise ozmake(makefile:badclean(R.clean)) end else {self set_clean(R.clean)} end end %% process veryclean feature if {HasFeature R veryclean} then if {Not {IsList R.veryclean}} orelse {Not {All R.veryclean IsVirtualString}} then raise ozmake(makefile:badveryclean(R.veryclean)) end else {self set_veryclean(R.veryclean)} end end %% process version feature if {HasFeature R version} then if {Utils.isVersion R.version} then {self set_version(R.version)} else raise ozmake(makefile:badversion(R.version)) end end end %% process author feature local S={CondSelect R author nil} in if S==nil then skip elseif {IsVirtualString S} then if {Utils.authorOK S} then %% normalize MOGUL ID, i.e. no trailing slash S2 = if {Utils.isMogulID S} then {Utils.cleanMogulID S} else S end in {self set_author([{MakeByteString S2}])} else raise ozmake(makefile:authornotok(S)) end end elseif {Not {IsList S}} orelse {Not {All S IsVirtualString}} then raise ozmake(makefile:badauthor(S)) end else {self set_author( for X in S collect:COL do if {Utils.authorOK X} then {COL {MakeByteString %% normalize MOGUL ID, i.e. no trailing slash if {Utils.isMogulID X} then {Utils.cleanMogulID X} else X end}} else raise ozmake(makefile:authornotok(X)) end end end)} end end %% process blurb feature if {HasFeature R blurb} then if {Not {IsVirtualString R.blurb}} then raise ozmake(makefile:badblurb(R.blurb)) end else {self set_blurb({MakeByteString R.blurb})} end end %% process info_text feature if {HasFeature R info_text} then if {Not {IsVirtualString R.info_text}} then raise ozmake(makefile:badinfotext(R.info_text)) end else {self set_info_text({MakeByteString R.info_text})} end end %% process info_html feature if {HasFeature R info_html} then if {Not {IsVirtualString R.info_html}} then raise ozmake(makefile:badinfohtml(R.info_html)) end else {self set_info_html({MakeByteString R.info_html})} end end %% process requires feature case {CondSelect R requires nil} of nil then skip [] S then if {IsVirtualString S} then {self set_requires([S])} elseif {IsList S} andthen {All S IsVirtualString} then {self set_requires(S)} else raise ozmake(makefile:badrequires(S)) end end end %% process categories feature if {HasFeature R categories} then if {IsVirtualString R.categories} then {self set_categories([R.categories])} elseif {IsList R.categories} andthen {All R.categories IsVirtualString} then {self set_categories(R.categories)} else raise ozmake(makefile:badcategories(R.categories)) end end end %% process platform feature if {HasFeature R platform} then if {IsVirtualString R.platform} then {self set_platform(R.platform)} else raise ozmake(makefile:badplatform(R.platform)) end end end %% process contact feature if {HasFeature R contact} then L = case R.contact of _|_ then R.contact else [R.contact] end in for C in L do if {IsRecord C} then for F#V in {Record.toListInd C} do case F of mogul then if {IsVirtualString V} andthen {Utils.isMogulID V} then skip else raise ozmake(makefile:contactmogul(V)) end end [] name then if {Not {IsVirtualString V}} then raise ozmake(makefile:contactname(V)) end end [] name_for_index then if {Not {IsVirtualString V}} then raise ozmake(makefile:contactnameforindex(V)) end end [] email then if {Not {IsVirtualString V}} then raise ozmake(makefile:contactemail(V)) end end [] www then if {Not {IsVirtualString V}} then raise ozmake(makefile:contactwww(V)) end end else raise ozmake(makefile:illegalfeature(F V)) end end end if {Not {HasFeature C mogul}} then raise ozmake(makefile:contactmissingmogul(C)) end end if {Not {HasFeature C name}} then raise ozmake(makefile:contactmissingname(C)) end end else raise ozmake(makefile:badcontact(C)) end end end {self set_contact( %% make sure that MOGUL IDs have been normalized %% i.e. no trailing slahes {Map L fun {$ C} if {HasFeature C mogul} then {AdjoinAt C mogul {Utils.cleanMogulID C.mogul}} else C end end})} end %% process subdirs feature if {HasFeature R subdirs} then if {IsList R.subdirs} then for D in R.subdirs do if {Not {IsVirtualString D}} then raise ozmake(makefile:subdirnotvs(D)) end elseif {Not {Path.isBasename D}} then raise ozmake(makefile:subdirnotbasename(D)) end end end else raise ozmake(makefile:badsubdirs(R.subdirs)) end end {self set_subdirs({Map R.subdirs Path.toAtom})} end %% process submakefiles feature if {HasFeature R submakefiles} then if {Not {IsRecord R.submakefiles}} then raise ozmake(makefile:badsubmakefiles(R.submakefiles)) end elseif {Width R.submakefiles}\=0 andthen {Not {self get_fromPackage($)}} then raise ozmake(makefile:submakefilesnotallowed) end else {self set_submakefiles(R.submakefiles)} end end %% process bin feature local Stack={Utils.newStack} BIN={CondSelect R bin nil} in if {Not {IsList BIN}} then raise ozmake(makefile:badsectionvalue(bin BIN)) end end for F in BIN do U A in if {Not {IsVirtualString F}} then raise ozmake(makefile:badsectionentry(bin F)) end end %% a bin target must be just a filename without directory U={Path.toURL F} if {Path.isAbsolute U} orelse {CondSelect U path unit}==unit orelse {Length U.path}\=1 then raise ozmake(makefile:badsectiontarget(bin F)) end end %% a bin target needs a 'exe' extension case {Path.extensionAtom F} of 'exe' then skip else raise ozmake(makefile:badbinextension(F)) end end %% check that it is unique A = {Path.toAtom U} if {HasFeature @Target2Section A} then raise ozmake(makefile:duplicate(A)) end end @Target2Section.A := bin {Stack.push A} end {self set_bin_targets({Reverse {Stack.toList}})} end %% process lib feature local Stack={Utils.newStack} LIB={CondSelect R lib nil} in if {Not {IsList LIB}} then raise ozmake(makefile:badsectionvalue(lib LIB)) end end for F in LIB do U A in if {Not {IsVirtualString F}} then raise ozmake(makefile:badsectionentry(lib F)) end end %% must be a relative pathname U={Path.toURL F} if {Path.isAbsolute U} then raise ozmake(makefile:badsectiontarget(lib F)) end end %% check that it is unique A={Path.toAtom U} if {HasFeature @Target2Section A} then raise ozmake(makefile:duplicate(A)) end end @Target2Section.A := lib {Stack.push A} end {self set_lib_targets({Reverse {Stack.toList}})} end %% process provides feature if {HasFeature R provides} then local Stack={Utils.newStack} PRO={CondSelect R provides nil} in if {Not {IsList PRO}} then raise ozmake(makefile:badsectionvalue(provides PRO)) end end for F in PRO do U A in if {Not {IsVirtualString F}} then raise ozmake(makefile:badsectionentry(provides F)) end end %% must be a relative pathname U={Path.toURL F} if {Path.isAbsolute U} then raise ozmake(makefile:badsectiontarget(lib F)) end end %% check that it is actually a bin or lib target A={Path.toAtom U} case {CondSelect @Target2Section A unit} of unit then raise ozmake(makefile:unknownprovides(A)) end [] bin then {Stack.push A} [] lib then {Stack.push A} [] S then raise ozmake(makefile:badprovides(S A)) end end end {self set_provides_targets({Reverse {Stack.toList}})} end end %% process doc feature local Stack={Utils.newStack} DOC={CondSelect R doc nil} in if {Not {IsList DOC}} then raise ozmake(makefile:badsectionvalue(doc DOC)) end end for F in DOC do U A in if {Not {IsVirtualString F}} then raise ozmake(makefile:badsectionentry(doc F)) end end %% must be a relative pathname U={Path.toURL F} if {Path.isAbsolute U} then raise ozmake(makefile:badsectiontarget(doc F)) end end %% check that it is unique A={Path.toAtom U} if {HasFeature @Target2Section A} then raise ozmake(makefile:duplicate(A)) end end @Target2Section.A := doc {Stack.push A} end {self set_doc_targets({Reverse {Stack.toList}})} end %% process src feature local Stack={Utils.newStack} SRC={CondSelect R src nil} in if {Not {IsList SRC}} then raise ozmake(makefile:badsectionvalue(src SRC)) end end for F in SRC do U A in if {Not {IsVirtualString F}} then raise ozmake(makefile:badsectionentry(src F)) end end %% must be a relative pathname U={Path.toURL F} if {Path.isAbsolute U} then raise ozmake(makefile:badsectiontarget(src F)) end end %% a file may be listed here eventhough it is also listed %% in bin, lib, or doc: this means that the file is to be %% included in the distribution rather than those necessary %% to build it A={Path.toAtom U} @TargetIsSource.A := true {Stack.push A} end {self set_src_targets({Reverse {Stack.toList}})} end %% process tar feature local TAR0={CondSelect R tar unit} TAR =if TAR0==unit then nil elseif {IsVirtualString TAR0} then [TAR0] elseif {IsList TAR0} andthen {All TAR0 IsVirtualString} then TAR0 else raise ozmake(makefile:badtarvalue(TAR0)) end end in for X in TAR do if {Not {Member X ['tgz' 'tar.Z' 'tar.gz']}} then raise ozmake(makefile:badtarext(X)) end end end if TAR\=nil then {self set_tar_targets({Map TAR Path.toAtom})} end end %% process depends feature local DEP={CondSelect R depends o} in if {Not {IsRecord DEP}} then raise ozmake(makefile:baddepends(DEP)) end end for F#L in {Record.toListInd DEP} do Stack={Utils.newStack} LL = if {IsVirtualString L} then [L] elseif {IsList L} andthen {All L IsVirtualString} then L else raise ozmake(makefile:baddependslist(F L)) end end A in if {Path.isAbsolute F} then raise ozmake(makefile:baddependstarget(F)) end end A = {Path.toAtom F} %% check that all files are relative for D in LL do if {Not {IsVirtualString D}} then raise ozmake(makefile:baddependsvalue(A D)) end end if {Path.isAbsolute D} then raise ozmake(makefile:baddependsentry(A D)) end end {Stack.push {Path.toAtom D}} end @Target2Depends.A := {Reverse {Stack.toList}} end end %% process rule feature local RUL={CondSelect R rules nil} in if {Not {IsRecord RUL}} then raise ozmake(makefile:badrules(RUL)) end end for F#R in {Record.toListInd RUL} do A Rule in if {Path.isAbsolute F} then raise ozmake(makefile:badrulestarget(F)) end end A = {Path.toAtom F} case {Adjoin o(2:nil) R} of ozc(T Options) then Rule=rule(tool:ozc file:T options:Options) [] ozl(T Options) then Rule=rule(tool:ozl file:T options:Options) [] cc( T Options) then Rule=rule(tool:cc file:T options:Options) [] ld( T Options) then Rule=rule(tool:ld file:T options:Options) [] ozg(T Options) then Rule=rule(tool:ozg file:{Path.replaceExtensionAtom T 'ozf'} options:Options) else raise ozmake(makefile:badrule(F R)) end end if {Path.isAbsolute Rule.file} then raise ozmake(makefile:badrulefile(Rule.file)) end end %% check that the options make sense for the tool case Rule.tool of ozc then for O in Rule.options do case O of executable then skip [] 'define'(S) then if {Not {IsVirtualString S}} then raise ozmake(makefile:illegaltooloptionarg(ozc O)) end end else raise ozmake(makefile:illegaltooloption(ozc O)) end end end [] ozl then for O in Rule.options do case O of executable then skip %% we could allow more here e.g. include/exclude else raise ozmake(makefile:illegaltooloption(ozl O)) end end end [] cc then for O in Rule.options do case O of include(S) then if {Not {IsVirtualString S}} then raise ozmake(makefile:illegaltooloptionarg(cc O)) end end [] 'define'(S) then if {Not {IsVirtualString S}} then raise ozmake(makefile:illegaltooloptionarg(cc O)) end end else raise ozmake(makefile:illegaltooloption(cc O)) end end end [] ld then for O in Rule.options do case O of library(S) then if {Not {IsVirtualString S}} orelse {Path.isAbsolute S} then raise ozmake(makefile:badtooloption(cc O)) end end else raise ozmake(makefile:illegaltooloption(ld O)) end end end [] ozg then skip end %% record the rule @Target2Rule.A := Rule end end end meth makefile_read if @Target2Section==unit then S={self get_superman($)} in if S\=unit andthen {S has_submakefile({self get_assubdir($)} $)} then Makefile,makefile_from_record({S get_submakefile({self get_assubdir($)} $)}) else F={self get_makefile($)} in if {Path.exists F} then {self trace('reading makefile: '#F)} Makefile,makefile_from_record({Utils.compileFile F false}) {self set_no_makefile(false)} elseif {self get_makefile_given($)} then raise ozmake(makefile:filenotfound(F)) end else {self trace('using empty makefile')} Makefile,makefile_from_record(o) end end end end meth makefile_read_maybe_from_package if @Target2Section==unit then S={self get_superman($)} in if S\=unit andthen {S has_submakefiles({self get_assubdir($)} $)} then Makefile,makefile_from_record({S get_submakefile({self get_assubdir($)} $)}) elseif {Not {self get_makefile_given($)}} andthen {self get_package_given($)} then {self extract_makefile(_)} else {self makefile_read} end end end %% is this target included in src? we need to know this to avoid %% build src targets unless during a fullbuild meth target_is_src(T $) {CondSelect @TargetIsSource {Path.toAtom T} false} end %% return the build rule for target T. first look if the user specified %% one. if not, use a default rule appropriate for the file extension meth get_rule(T $) R={CondSelect @Target2Rule T unit} in if R\=unit then R else {MakeRuleDefault T} end end %% return a list of all dependencies for target T %% 1. if the target is in src and we are not performing a `full' build %% then return nil %% 2. otherwise return the union of the explicitly stated dependencies %% and the implicit one induced by the rule for the target meth get_depends(T $) {self makefile_read} %% note that we assume that T is an atom if Makefile,target_is_src(T $) andthen {Not {self get_fullbuild($)}} then nil else Table = {NewDictionary} for D in {CondSelect @Target2Depends T nil} do Table.D := unit end for D in {self get_autodepend_build(T $)} do Table.D := unit end R = Makefile,get_rule(T $) in if R.tool==unit then skip elseif R.tool==ozg then for D in {self get_depends(R.file $)} do Table.D := unit end else Table.(R.file) := unit end {Dictionary.keys Table} end end %% turn the makefile back into a record for inclusion in a package meth makefile_to_record($ relax:RELAX<=false) {self makefile_read} MAK={NewDictionary} Clean = {self get_clean($)} Veryclean = {self get_veryclean($)} Author = {self get_author($)} Blurb = {self get_blurb($)} InfoText = {self get_info_text($)} InfoHtml = {self get_info_html($)} Requires = {self get_requires($)} Categories= {self get_categories($)} Version = {self get_version($)} Contact = {self get_contact($)} Tar = {self get_tar_targets($)} Provides = {self get_provides_targets($)} Platform = if {self get_binary($)} then {Property.get 'platform.name'} else unit end in MAK.bin := {self get_bin_targets($)} MAK.lib := {self get_lib_targets($)} MAK.doc := {self get_doc_targets($)} MAK.src := if {self get_binary($)} then {self get_needed_locally($)} else {self get_src_targets($)} end if Tar\=nil then MAK.tar := Tar end MAK.depends := {Utils.toRecord @Target2Depends} MAK.rules := {Record.map {Utils.toRecord @Target2Rule} fun {$ R} Tool=R.tool in Tool(R.file R.options) end} if Provides\=unit then MAK.provides := Provides end %% if there are no targets, the uri is unnecessary if {self maybe_get_uri($)}\=unit orelse MAK.bin\=nil orelse MAK.lib\=nil orelse MAK.doc\=nil then MAK.uri := {self get_uri($)} end MAK.mogul := if RELAX then {self get_mogul_relax($)} else {self get_mogul($)} end if Clean \=unit then MAK.clean := Clean end if Veryclean\=unit then MAK.veryclean := Veryclean end if Author \=unit then MAK.author := Author end if Blurb \=unit then MAK.blurb := Blurb end if InfoText \=unit then MAK.info_text := InfoText end if InfoHtml \=unit then MAK.info_html := InfoHtml end if Requires \=unit then MAK.requires := Requires end if Categories\=nil then MAK.categories:= Categories end if Version \=unit then MAK.version := Version end if Contact \=unit then MAK.contact := Contact end if Platform \=unit then MAK.platform := Platform end MAK.released:= {Utils.dateCurrentToAtom} %% grab also all the recursive makefiles MAK.subdirs := {self get_subdirs($)} MAK.submakefiles := {List.toRecord o for D in {self get_subdirs($)} M in {self get_submans($)} collect : Collect do {Collect D#{M makefile_to_record($)}} end} {Dictionary.toRecord makefile MAK} end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Manager.oz0000644000175000017500000000324410023366745022120 0ustar kevingkevingfunctor export 'class' : Manager import Makefile at 'Makefiler.ozf' Executor at 'Executor.ozf' Attribs at 'Attribs.ozf' Builder at 'Builder.ozf' Installer at 'Installer.ozf' DatabaseLib at 'DatabaseLib.ozf' Database at 'Database.ozf' Cleaner at 'Cleaner.ozf' Creator at 'Creator.ozf' Extractor at 'Extractor.ozf' Lister at 'Lister.ozf' Uninstaller at 'Uninstaller.ozf' MakeGUI at 'MakeGUI.ozf' Config at 'Config.ozf' Mogul at 'Mogul.ozf' ExecutorFast at 'ExecutorFast.ozf' Depends at 'Depends.ozf' Requires at 'Requires.ozf' define class Manager from Attribs .'class' Makefile .'class' Executor .'class' Builder .'class' Installer .'class' DatabaseLib.'class' Database .'class' Cleaner .'class' Creator .'class' Extractor .'class' Lister .'class' Uninstaller.'class' MakeGUI .'class' Config .'class' Mogul .'class' ExecutorFast.'class' Depends .'class' Requires .'class' meth init {self exec_init} end meth initAsSubdir(Subdir Superman) {self set_assubdir(Subdir)} {self set_superman(Superman)} Manager,init end meth subdirs_to_managers(L $) {Map L fun {$ D} {New Manager initAsSubdir(D self)} end} end meth recurse(CMD) if {self get_local($)} then skip else for D in {self get_subdirs($)} M in {self get_submans($)} do {self trace('entering '#D)} {self incr} try {M makefile_read} {M CMD} finally {self decr} end {self trace('leaving '#D)} end end end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Message.oz0000644000175000017500000000162407444766057022147 0ustar kevingkevingfunctor prepare fun {Normalize S} case S of nil then nil [] &\r|L then {Normalize L} [] H|L then H|{Normalize L} end end fun {ParseNextHeader S} case S of nil then nil [] &\n|L then [unit#L] else {ParseHeader nil S} end end fun {SplitEOL L S1 S2} {String.token L &\n S1 S2} end fun {SkipSpaces L} case L of nil then nil [] H|T andthen {Char.isSpace H} then {SkipSpaces T} else L end end fun {SkipSpacesEnd L} {Reverse {SkipSpaces {Reverse L}}} end fun {ParseHeader S L} case L of &:|L then S1 S2 in {SplitEOL {SkipSpaces L} S1 S2} ({StringToAtom {Reverse S}}#{SkipSpacesEnd S1}) |{ParseNextHeader S2} [] H|T then {ParseNextHeader H|S T} end end fun {PreParse S} case S of nil then nil [] end fun {ParseFromString S} endmozart-stdlib-20060615/mozart-stdlib/ozmake/Mogul.oz0000644000175000017500000004033110013122063021605 0ustar kevingkevingfunctor export 'class' : Mogul prepare IsPrefix = List.isPrefix VS2S = VirtualString.toString VS2A = VirtualString.toAtom fun {List2VSX Accu X} Accu#X end fun {List2VS L} {FoldL L List2VSX nil} end fun {NewQueue} C=local L in {NewCell L|L} end proc {Put X} L1 L2 in {Exchange C L1|(X|L2) L1|L2} end proc {ToList L} {Exchange C L|nil unit} end in queue(put:Put toList:ToList) end fun {NewUniqQueue} Q={NewQueue} T={NewDictionary} proc {Put K} if {HasFeature T K} then skip else T.K := unit {Q.put K} end end fun {ToList} {Q.toList} end in uniqQueue(put:Put toList:ToList) end import Path at 'Path.ozf' Utils at 'Utils.ozf' define %% here we keep track of the user's MOGUL offerings and %% automate the management of the user's MOGUL section class Mogul attr DB : unit Dashes : unit EntryFiles : unit RootID : unit meth mogul_read() if @DB==unit then F={self get_moguldatabase($)} D={self databaselib_read(F $)} in if D\=unit then DB <- D elseif {self get_moguldatabase_given($)} then raise ozmake(mogul:filenotfound(F)) end else {self trace('no mogul database')} DB <- {NewDictionary} end end end meth mogul_save() if @DB\=unit then {self databaselib_save( {self get_moguldatabase($)} @DB)} end end meth mogul_get_rootid($) if @RootID==unit then RootID <- {self get_mogulrootid($)} if @RootID==unit then %% guess it using the mogul id from the first %% entry in the mogul.db if any {self mogul_read} case {Dictionary.keys @DB} of K|_ then case {Path.toNonBaseURL K}.path of H|_ then RootID <- {Path.toAtom 'mogul:/'#H} {self trace('guessed root MOGUL id: '#@RootID)} else skip end else skip end end end @RootID end meth ToProvides(R Uri Uniq) if {HasFeature R provides} then for E in R.provides do A={VS2A E} in %% this sucks!!! it needs to be resolved %% by the makefile object, not approximated here %% in this fashion. if {Member A {CondSelect R bin nil}} then {Uniq.put A} else {Uniq.put {Path.resolveAtom Uri A}} end end else for E in {CondSelect R bin nil} do {Uniq.put {VS2A E}} end for E in {CondSelect R lib nil} do {Uniq.put {Path.resolveAtom Uri E}} end end for D#M in {Record.toListInd {CondSelect R submakefiles o}} do {self ToProvides(M {Path.resolve Uri D} Uniq)} end end meth ToMogulPackageEntry(R VS) Q={NewQueue} in {Q.put 'type: package\n'} {Q.put 'id: '#R.mogul#'\n'} if {HasFeature R format} then {Q.put 'format: '#R.format#'\n'} end if {HasFeature R version} then {Q.put 'version: '#R.version#'\n'} end if {HasFeature R released} then {Q.put 'released: '#R.released#'\n'} end for A in {CondSelect R author nil} do {Q.put 'author: '#A#'\n'} end if {HasFeature R blurb} then case {String.tokens {VS2S R.blurb} &\n} of nil then skip [] [nil] then skip [] H|T then {Q.put 'blurb: '#H} for X in T do {Q.put '\n '#X} end {Q.put '\n'} end end for C in {CondSelect R categories nil} do {Q.put 'category: '#C#'\n'} end if {CondSelect R tar nil}\=nil then for EXT in R.tar do {Q.put 'url-pkg: '# {Path.resolve {self get_mogulpkgurl($)} {Utils.mogulToFilename R.mogul}#'.'#EXT}#'\n'} end else {Q.put 'url-pkg: '# {Path.resolve {self get_mogulpkgurl($)} {Utils.mogulToPackagename R.mogul}}#'\n'} end case {CondSelect R doc unit} of F|_ then {Q.put 'url-doc: '# {Path.resolve {self get_moguldocurl($)} {Utils.mogulToFilename R.mogul}#'/'#F}#'\n'} else skip end local Uniq={NewUniqQueue} in {self ToProvides(R {CondSelect R uri nil} Uniq)} for T in {Uniq.toList} do {Q.put 'provides: '#T#'\n'} end end for T in {CondSelect R requires nil} do {Q.put 'requires: '#T#'\n'} end if {HasFeature R info_html} then {Q.put 'content-type: text/html\n\n'} {Q.put R.info_html} elseif {HasFeature R info_text} then {Q.put 'content-type: text/plain\n\n'} {Q.put R.info_text} end {List2VS {Q.toList} VS} end meth ToMogulContactEntry(R VS) Q={NewQueue} in {Q.put 'type: contact\n'} {Q.put 'id: '#R.mogul} {Q.put '\nname: '#R.name} if {HasFeature R name_for_index} then {Q.put '\nname-for-index: '#R.name_for_index} end if {HasFeature R email} then {Q.put '\nemail: '#R.email} end if {HasFeature R www} then {Q.put '\nwww: '#R.www} end {List2VS {Q.toList} VS} end meth HasPackageContribs(R $) {CondSelect R lib nil}\=nil orelse {CondSelect R bin nil}\=nil orelse {CondSelect R doc nil}\=nil end meth HasContactContribs(R $) {CondSelect R contact nil}\=nil end meth mogul_put() %% here we update the MOGUL entry for this package {self makefile_read_maybe_from_package} R = {self makefile_to_record($ relax:true)} PkgB = {self HasPackageContribs(R $)} ConB = {self HasContactContribs(R $)} in if PkgB then {self mogul_put_package(R)} end if ConB then for C in R.contact do {self mogul_put_contact(C)} end end if {Not (PkgB orelse ConB)} then {self trace('package contributes no MOGUL entries')} else {self mogul_save} end end meth mogul_sanitize_record(R $) D = {NewDictionary} in case {CondSelect R author nil} of nil then skip [] unit then skip [] L then D.author := L end case {CondSelect R blurb nil} of nil then skip [] unit then skip [] S then D.blurb := S end case {CondSelect R uri unit} of nil then skip [] unit then skip [] S then D.uri := S end D.doc := {CondSelect R doc nil} D.lib := {CondSelect R lib nil} D.bin := {CondSelect R bin nil} case {CondSelect R tar unit} of nil then skip [] unit then skip [] L then D.tar := L end case {CondSelect R info_html nil} of nil then skip [] unit then skip [] S then D.info_html := S end case {CondSelect R info_text nil} of nil then skip [] unit then skip [] S then D.info_text := S end case {CondSelect R released unit} of unit then skip [] S then D.released := S end case {CondSelect R version unit} of unit then skip [] S then D.version := S end case {CondSelect R categories unit} of nil then skip [] unit then skip [] L then D.categories := L end case {CondSelect R requires unit} of nil then skip [] unit then skip [] L then D.requires := L end case {CondSelect R provides unit} of unit then skip [] L then D.provides := L end case {CondSelect R submakefiles unit} of unit then skip [] RR then D.submakefiles := {Record.map RR fun {$ R} {self mogul_sanitize_record(R $)} end} end {Dictionary.toRecord makefile D} end meth mogul_put_package(R) {self mogul_read} {self mogul_validate_id(R.mogul)} P = {Adjoin {self mogul_sanitize_record(R $)} package(type : package mogul : R.mogul format : {self get_format($)} )} in @DB.(R.mogul) := P {self trace('updated entry for '#R.mogul)} {self mogul_trace_package(P)} end meth mogul_put_contact(R) {self mogul_read} {self mogul_validate_id(R.mogul)} D = {NewDictionary} in D.type := contact D.mogul := R.mogul D.name := R.name if {HasFeature R name_for_index} then D.name_for_index := R.name_for_index end if {HasFeature R email} then D.email := R.email end if {HasFeature R www} then D.www := R.www end local C = {Dictionary.toRecord contact D} in @DB.(R.mogul) := C {self trace('updated entry for '#R.mogul)} {self mogul_trace_contact(C)} end end meth mogul_export_package(R) VS = {self ToMogulPackageEntry(R $)} F = {Utils.mogulToFilename R.mogul}#'.mogul' D = {self get_moguldbdir($)} FF = {Path.resolve D F} in {self exec_write_to_file(VS FF)} {self mogul_trace_package(R vs:VS file:F)} end meth mogul_trace_package(P vs:VS0<=unit file:F0<=unit print:PR<=false) VS = if VS0==unit then {self ToMogulPackageEntry(P $)} else VS0 end F = if F0==unit then nil else ' [ '#F0#' ] ' end TR = if PR then print else ptrace end in {self TR({self format_title(F $)})} {self TR(VS)} {self TR({self format_dashes($)})} end meth mogul_export_contact(C) D = {self get_moguldbdir($)} VS = {self ToMogulContactEntry(C $)} F = {Utils.mogulToFilename C.mogul}#'.mogul' FF = {Path.resolve D F} in {self exec_write_to_file(VS FF)} {self mogul_trace_contact(C vs:VS file:F)} end meth mogul_trace_contact(C vs:VS0<=unit file:F0<=unit print:PR<=false) VS = if VS0==unit then {self ToMogulContactEntry(C $)} else VS0 end F = if F0==unit then nil else ' [ '#F0#' ] ' end TR = if PR then print else ptrace end in {self TR({self format_title(F $)})} {self TR(VS)} {self TR({self format_dashes($)})} end meth mogul_validate_id(ID) ROOT = {self mogul_get_rootid($)} in if ROOT\=unit then R = {Path.toNonBaseURL ROOT} P = {Path.toNonBaseURL ID} in if {Not {IsPrefix R.path P.path}} then raise ozmake(mogul:validate(ROOT ID)) end end end end meth ToMogulSectionEntry(ID L VS) Q={NewQueue} in {Q.put 'type: section\n'} {Q.put 'id: '#ID#'\n\n'} for ID2 in L do {Q.put ID2#': '#{Utils.mogulToFilename {Path.resolve ID ID2}}#'.mogul\n'} end {List2VS {Q.toList} VS} end meth mogul_export_section(ID L) %% ID is the mogul id of the section %% and L is the list of relative ids of its contents VS = {self ToMogulSectionEntry(ID L $)} F = {Utils.mogulToFilename ID}#'.mogul' D = {self get_moguldbdir($)} FF = {Path.resolve D F} in {self exec_write_to_file(VS FF)} {self ptrace({self format_title(' [ '#F#' ] ' $)})} {self ptrace(VS)} {self ptrace({self format_dashes($)})} end meth mogul_export {self mogul_read} %% for consistency, first validate all entries {self trace('validating all ids in mogul database')} IDS = {Dictionary.keys @DB} for K in IDS do {self mogul_validate_id(K)} end %% now build the sections. Table={NewDictionary} ROOT={self mogul_get_rootid($)} proc {Enter ID} if ID\=ROOT andthen {Not {Utils.isMogulRootID ID}} then PID = {Path.dirnameAtom ID} KEY = {Path.basenameAtom ID} if {HasFeature @DB PID} then raise oops(PID) end end {Enter PID} L = {CondSelect Table PID nil} in if {Member KEY L} then skip else Table.PID := KEY|L end end end for K in IDS do try {Enter K} catch oops(ID) then raise ozmake(mogul:secclash(K ID)) end end end Entries = {Sort {Dictionary.items @DB} fun {$ E1 E2} E1.mogul < E2.mogul end} in %% export all MOGUL entries %% by type, and sorted - for user convenience when tracing {self trace('exporting MOGUL section entries')} {self incr} for K in {Sort {Dictionary.keys Table} Value.'<'} do {self mogul_export_section(K {Sort Table.K Value.'<'})} end {self decr} {self trace('exporting MOGUL contact entries')} {self incr} for C in Entries do if C.type==contact then {self mogul_export_contact(C)} end end {self decr} {self trace('exporting MOGUL package entries')} {self incr} for P in Entries do if P.type==package then {self mogul_export_package(P)} end end {self decr} end meth mogul(Targets) case {self get_mogul_action($)} of put then {self mogul_put} [] delete then {self mogul_del(Targets)} [] list then {self mogul_list(Targets)} [] 'export' then {self mogul_export} end end meth mogul_validate_action(S $) case for A in [put delete list 'export'] collect:C do if {IsPrefix S {AtomToString A}} then {C A} end end of nil then raise ozmake(mogul:unknownaction(S)) end [] [A] then A [] L then raise ozmake(mogul:ambiguousaction(S L)) end end end meth format_title(T $) N = {self get_linewidth($)} - {VirtualString.length T} N1 = N div 2 N2 = N - N1 in for I in 1..N1 collect:COL do {COL &-} end#T# for I in 1..N2 collect:COL do {COL &-} end end meth format_dashes($) if @Dashes==unit then Dashes <- for I in 1..{self get_linewidth($)} collect:C do {C &-} end end @Dashes end meth mogul_del(Targets) {self mogul_del_targets( if Targets==nil then {self makefile_read_maybe_from_package} [{self get_mogul($)}] else Targets end)} end meth mogul_del_targets(Targets) Save in {self mogul_read} for T in Targets do if {HasFeature @DB T} then {self trace('deleting entry : '#T)} Save=unit {Dictionary.remove @DB T} else {self xtrace('entry not found: '#T)} end end if {IsDet Save} then {self mogul_save} end end meth mogul_list(Targets) {self mogul_read} Keys = if Targets==nil then L={Dictionary.keys @DB} in if L==nil then {self xtrace('your mogul database is empty')} nil else {Sort L Value.'<'} end else {Sort for T in Targets collect:COL do if {HasFeature @DB T} then {COL T} else {self xtrace('entry not found: '#T)} end end Value.'<'} end in for K in Keys do E=@DB.K in case E.type of contact then {self mogul_trace_contact(E print:true)} [] package then {self mogul_trace_package(E print:true)} end end end meth publish %% ozmake --publish %% is essentially equivalent to the following sequence: %% %% 1. ozmake --install --package=PKG --includedocs --excludelibs --excludebins --docdir=DOCDIR/MOG %% where DOCDIR is given by --moguldocdir and MOG is the package's MOGUL id %% %% 2. ozmake --create --package PKG %% where PKG's directory is given by --mogulpkgdir and PKG's %% filename is computed from the package's MOGUL id %% %% 3. ozmake --mogul=put --package PKG %% %% 4. ozmake --mogul=export %% {self set_database_ignore(true)} {self makefile_read} %% install docs if necessary if {self get_doc_targets($)}\=nil then ILIBS = {self get_includelibs($)} IBINS = {self get_includebins($)} IDOCS = {self get_includedocs($)} in {self set_includelibs(false)} {self set_includebins(false)} {self set_includedocs(true)} {self set_docdir({Path.resolve {self get_moguldocdir($)} {Utils.mogulToFilename {self get_mogul($)}}})} {self install(nil)} {self set_includelibs(ILIBS)} {self set_includebins(IBINS)} {self set_includedocs(IDOCS)} end %% create and install package if necessary if {self get_tar_targets($)}\=nil then %% if we count on the tarballs, just check that they exist Tarballs = for EXT in {self get_tar_targets($)} collect:COL do F = {Path.resolve {self get_builddir($)} {Utils.mogulToFilename {self get_mogul($)}}#'.'#EXT} in if {Path.exists F} then {COL F} else raise ozmake(mogul:tarballnotfound(F)) end end end DIR = {self get_mogulpkgdir($)} in %% copy tarballs into mogulpkgdir {self exec_mkdir(DIR)} for F in Tarballs do {self exec_cp(F {Path.resolve DIR {Path.basename F}})} end elseif {self get_bin_targets($)}\=nil orelse {self get_lib_targets($)}\=nil orelse {self get_doc_targets($)}\=nil then DIR = {self get_mogulpkgdir($)} MOG = {self get_mogul($)} VER = {self get_version($)} PKG = {Path.resolve DIR {Utils.mogulToPackagename MOG}} in {self set_package(PKG)} {self create} if VER\=unit then FIL = {Path.resolve DIR {Utils.mogulToFilename MOG}#'-'#VER#'.pkg'} in {self exec_cp(PKG FIL)} end end %% create all mogul entries {self mogul_put} {self mogul_export} end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/MogulLib.oz0000644000175000017500000001435410023726400022250 0ustar kevingkevingfunctor prepare fun {Spaces N} if N>0 then & |{Spaces N-1} else nil end end INDENT = 16 fun {Header Label Value} N = {VirtualString.length Label} in Label#':'#{Spaces INDENT-N-1}#Value#'\n' end fun {MaybeHeader Label Value} if Value==unit then nil else {Header Label Value} end end fun {ExtendedHeader Label Value} {Header Label {ExtendedValue {VirtualString.toString Value}}} end fun {ExtendedValue S} case S of nil then nil [] H|T then if H==&\n then {Append &\n|{Spaces INDENT} {ExtendedValue T}} else H|{ExtendedValue T} end end end fun {MaybeExtendedHeader Label Value} if Value==unit then nil else {ExtendedHeader Label Value} end end ToTuple = List.toTuple fun {ComparePlatforms I1 I2} P1 = if I1==unit then unit else {I1 get(platform $)} end P2 = if I2==unit then unit else {I2 get(platform $)} end in if P1==P2 then '=' elseif P1==source then '<' elseif P2==source then '>' else '?' end end fun {CompareVersions I1 I2} V1 = if I1==unit then unit else {I1 get(version $)} end V2 = if I2==unit then unit else {I2 get(version $)} end in if V1==V2 then '=' elseif V1==unit then '>' elseif V2==unit then '<' elsecase {Utils.versionCompare V1 V2} of eq then '=' [] lt then '<' [] gt then '>' end end fun {CompareDates I1 I2} D1 = if I1==unit then unit else {I1 get(released $)} end D2 = if I2==unit then unit else {I2 get(released $)} end in if D1==D2 then '=' elseif D1==unit then '<' elseif D2==unit then '>' else if {Date.less {Utils.dateParse D1} {Utils.dateParse D2}} then '<' else '>' end end end fun {BetterRepresentative I1 I2} case {ComparePlatforms I1 I2} of '<' then true [] '>' then false elsecase {CompareVersions I1 I2} of '<' then true [] '>' then false elsecase {CompareDates I1 I2} of '>' then true else false end end local fun {Loop L B} case L of nil then B [] H|T then {Loop T if {BetterRepresentative B H} then B else H end T} end end in fun {ChooseBestRepresentative L} {Loop L unit} end end class MogulContact attr id : unit name : unit name_for_index : unit email : unit www : unit meth toVS($) {Header type contact}# {Header id @id}# {Header name @name}# {MaybeHeader 'name-for-index' @name_for_index}# {MaybeHeader email @email}# {MaybeHeader www @www} end meth init(R) id <- R.id name <- R.name name_for_index <- {CondSelect R 'name-for-index' unit} email <- {CondSelect R email unit} www <- {CondSelect R www unit} end end class MogulPackageBase meth get(A $) @A end meth url_pkg_list($) if @tar==nil then [{Path.resolve {@manager get_mogulpkgurl($)} {Utils.mogulToPackagename @id}}] else {Map @tar fun {$ EXT} {Path.resolve {@manager get_mogulpkgurl($)} {Utils.ToFilename @id}#'.'#EXT} end} end end meth url_doc($) if @doc==unit then unit else {Path.resolve {@manager get_moguldocurl($)} {Utils.mogulToFilename @id}#'/'#@doc} end end end class MogulInstance from MogulPackageBase attr manager : unit id : unit format : unit platform : unit version : unit released : unit author : nil blurb : unit tar : nil provides : unit requires : unit info_html : unit info_text : unit meth toLabel($) @id end meth toVS($) {Header type instance}# {Header id @id}# {Header format @format}# {MaybeHeader platform @platform}# {MaybeHeader version @version}# {MaybeHeader released @released}# {ToTuple '#' {Map @author fun {$ A} {Header author A} end}}# {MaybeExtendedHeader blurb @blurb}# {ToTuple '#' {Map {self url_pkg_list($)} fun {$ U} {Header 'url-pkg' U} end}} end end class MogulPackage from MogulPackageBase attr manager : unit id : unit format : unit platform : unit version : unit released : unit author : nil blurb : unit categories : nil tar : nil doc : unit provides : nil requires : nil info_html : unit info_text : unit instances : nil meth toVS($) {Header type package}# {Header id @id}# {MaybeHeader format @format}# {MaybeHeader platform @platform}# {MaybeHeader version @version}# {MaybeHeader released @released}# {ToTuple '#' {Map @author fun {$ A} {Header author A} end}}# {MaybeExtendedHeader blurb @blurb}# {ToTuple '#' {Map @categories fun {$ C} {Header category C} end}}# {ToTuple '#' {Map {self url_pkg_list($)} fun {$ U} {Header 'url-pkg' U} end}}# {MaybeHeader 'url-doc' {self url_doc($)}}# {ToTuple '#' {Map @requires fun {$ R} {Header requires R} end}}# {ToTuple '#' {Map @provides fun {$ P} {Header provides P} end}}# {ToTuple '#' {Map @instances fun {$ I} {Header instance {I toLabel($)}} end}}# if @info_html\=unit then {Header 'content-type' 'text/html'}# '\n'# @info_html else {Header 'content-type' 'text/plain'}# '\n'# @info_text end end meth SetRepresentative(R) %% R is expected to be a member of @instances %% we set the format+platform only when there is only one instance if {Length @instances}<2 then format <- {R get(format $)} platform <- {R get(platform $)} else format <- unit platform <- unit end version <- {R get(version $)} author <- {R get(author $)} blurb <- {R get(blurb $)} categories <- {R get(categories $)} provides <- {R get(provides $)} requires <- {R get(requires $)} info_html <- {R get(info_html $)} info_text <- {R get(info_text $)} end meth ChooseRepresentative($) %% if a representative is not set, we'll pick the most recent %% source version, else the most recent version in any form, %% else the most recent instance representative <- {ChooseBestRepresentative @instance} end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/NOTES0000644000175000017500000000374107721147511021010 0ustar kevingkeving-*-outline-*- we need to distinguish between compile-time and run-time dependencies. We only need to rebuild a target if a compile time dependency changed. However, we need to build all run-time dependencies. * BUILD TARGET (TOOL!=OZL) ** build build-time dependencies (requires) -- this is a recursive process ** build target if outdated with respect to (1) source (2) requires * BUILD TARGET (TOOL==OZL) ** build "source" which is an ozf file build its build-time dependencies -- this is a recursive process ** build the ozf run-time dependencies (imports) -- i.e. the files which will be linked this is also a recursive process ** build target if outdated * BUILD ALL ** build "install" targets ** build all their run-time dependencies (not just ozf) -- this can be a recursive process provided we guard against loops we also need to guard against loops in the build-time dependencies and signal an error when such a loop is found. ====================================================================== get_depends_ozl(T $) get_depends_build(T $) get_depends_install(T $) * get_depends_ozl(T $) T is ozf file to be created by the ozl tool, i.e. from another ozf file. Here we want to gather all recursive ozf run-time dependencies. Then we will want to build them which will take care of the build-time dependencies. Note that if a run-time dependency is an ozl linked ozf file, then we don't want to recursively gather its deps - that's all taken care of by the recursive build. Note also that the build system should be made more robust to signal an error when we recursively attempt to build the same target. * get_depends_build(T $) these are computed from the requires and may well include .so for example. This is not recursive. * get_depends_install(T $) This is computed from the imports for normal ozf files and is recursive. For ozl-linked ozf files, the imports are recursively inspected for .so files, but ozf files are not recorded since they are already linked in. mozart-stdlib-20060615/mozart-stdlib/ozmake/Package.html0000644000175000017500000000371707273236012022416 0ustar kevingkeving Title of Package

Title of Package

Author1 - Author2

provides
x-ozlib://.../Foo.ozf
x-ozlib://.../Bar.ozf
requires
x-ozlib://.../Baz.ozf

Purpose

...

Installation

This package can be installed by following the usual configure, build, install procedure, i.e. by executing a the shell: ./configure make install By default, all files of the package are installed in the user's ~/.oz directory tree. In particular, all modules are installed in the user's private cache.

Example

...


Author1 - Author2
mozart-stdlib-20060615/mozart-stdlib/ozmake/Package.mogul0000644000175000017500000000111007273236012022556 0ustar kevingkevingtype: package id: mogul:/clinton/lewinsky author: mogul:/clinton/bill url-pkg: http://www.whitehouse.gov/~clinton/mogul/pub/pkg/lewinsky-disaster.tgz url-doc: http://www.whitehouse.gov/~clinton/mogul/pub/doc/x-ozuser/clinton/lewinsky/index.html blurb: a module to help you roll your own scandal provides: [xml] x-ozuser://clinton/lewinsky/HeadLine.ozf provides: [io] x-ozuser://clinton/lewinsky/Cigar.ozf requires: x-ozuser://clinton/utils/Excuses.ozf content-type: text/html

This is a wonderful module to help you roll your own scandal, as juicy and messy as you please... mozart-stdlib-20060615/mozart-stdlib/ozmake/Path.oz0000644000175000017500000002065010023672362021435 0ustar kevingkevingfunctor %% This module provides an improved interface to pathnames. export ToURL ToBaseURL ToBase ToNonBaseURL ToNonBase ToNonBaseAtom DropInfoURL DropInfo DropInfoAtom ResolveURL Resolve ResolveAtom IsRelative IsAbsolute ToString ToAtom ExpandURL Expand ExpandInCWDURL ExpandInCWD ExpandInCWDAtom BasenameURL Basename BasenameAtom DirnameURL Dirname DirnameAtom Extension ExtensionAtom DropExtensionURL DropExtension DropExtensionAtom AddExtensionURL AddExtension AddExtensionAtom ReplaceExtensionURL ReplaceExtension ReplaceExtensionAtom MaybeAddPlatform MaybeAddThisPlatform ToCacheURL ToCache Stat SafeStat Dir Ls Exists IsDir IsFile Unresolve UnresolveURL UnresolveAtom IsAncestor MakeDir MakeDirRec Remove RemoveDir RemoveRec CopyFile IsBasename prepare %% Introduce some vars so we don't have to close over %% entire base modules VSToString = VirtualString.toString TakeDropWhile = List.takeDropWhile IsPrefix = List.isPrefix %% paths may contains characters which have special meanings %% for URIs and may be misinterpreted by the general Mozart %% URL module. For this reason, these characters need to be %% protected by encoding, prior to being processed by module %% URL. fun {PROTECT S} case S of nil then nil [] &?|T then &%|&3|&f|{PROTECT T} [] &#|T then &%|&2|&3|{PROTECT T} [] &{|T then &%|&7|&b|{PROTECT T} [] H|T then H|{PROTECT T} end end fun {NotIsDot S} {Not S=="." orelse S==".."} end fun {NotIsPeriod C} C\=&. end NOT_FOUND = notFound(type:unknown size:0) FULL_RAW = o(full:true raw:true) FULL_RAW_CACHE = o(cache:true full:true raw:true) import URL at 'x-oz://system/URL' RESOLVE at 'x-oz://system/Resolve.ozf' OS at 'x-oz://system/OS.ozf' Shell at 'Shell.ozf' Property Windows at 'Windows.ozf' define %% turn the argument into a URL record, if it is not %% already one, protecting special characters fun {ToURL P} if {URL.is P} then P else {URL.make {PROTECT {VSToString P}}} end end fun {ToBaseURL P} {URL.toBase {ToURL P}} end fun {ToBase P} {ToString {ToBaseURL P}} end fun {ToNonBaseURL P} U = {ToURL P} in case {Reverse {CondSelect U path nil}} of [nil] then U [] nil|T then {AdjoinAt U path {Reverse T}} else U end end fun {ToNonBase P} {ToString {ToNonBaseURL P}} end fun {ToNonBaseAtom P} {ToAtom {ToNonBaseURL P}} end fun {ResolveURL Base Rel} {URL.resolve {ToBase Base} {ToURL Rel}} end fun {Resolve Base Rel} {ToString {ResolveURL Base Rel}} end fun {ResolveAtom Base Rel} {StringToAtom {Resolve Base Rel}} end fun {IsRelative P} {URL.isRelative {ToURL P}} end fun {IsAbsolute P} {URL.isAbsolute {ToURL P}} end fun {DropInfoURL U} {AdjoinAt {ToURL U} info unit} end fun {DropInfo U} {ToString {DropInfoURL U}} end fun {DropInfoAtom U} {ToAtom {DropInfoURL U}} end %% On Win95/98 (aka old Windows), we need to use old style %% pathnames with \ instead of /. ToString if Windows.isOldWin then fun {DeS L} case L of nil then nil [] &/|L then &\\|{DeS L} [] H|L then H|{DeS L} end end in fun {!ToString P} U={ToURL P} S={VSToString {URL.toVirtualStringExtended U FULL_RAW}} in if {CondSelect U scheme unit}==unit andthen {CondSelect U authority unit}==unit then {DeS S} else S end end else fun {!ToString P} {VSToString {URL.toVirtualStringExtended {ToURL P} FULL_RAW}} end end fun {ToAtom P} {StringToAtom {ToString P}} end fun {ExpandURL P} {RESOLVE.expand {ToURL P}} end fun {Expand P} {ToString {ExpandURL P}} end fun {ExpandInCWDURL P} {ExpandURL {ResolveURL "./" {ExpandURL P}}} end fun {ExpandInCWD P} {ToString {ExpandInCWDURL P}} end fun {ExpandInCWDAtom P} {ToAtom {ExpandInCWDURL P}} end fun {Basename P} case {Reverse {CondSelect {ToNonBaseURL P} path nil}} of H|_ then H else nil end end fun {BasenameURL P} {ToURL {Basename P}} end fun {BasenameAtom P} {StringToAtom {Basename P}} end fun {DirnameURL P} U = {ToNonBaseURL P} in case {Reverse {CondSelect U path nil}} of _|T then {AdjoinAt U path {Reverse T}} else {ToURL nil} end end fun {Dirname P} {ToString {DirnameURL P}} end fun {DirnameAtom P} {StringToAtom {Dirname P}} end proc {SplitExtension P U E} UU={ToURL P} in case {Reverse {CondSelect UU path nil}} of H|T then Ext Rest in {TakeDropWhile {Reverse H} NotIsPeriod Ext Rest} case Rest of &.|Rest then U={AdjoinAt UU path {Reverse {Reverse Rest}|T}} E={Reverse Ext} else U=UU E=unit end else U=UU E=unit end end fun {Extension P} {SplitExtension P _ $} end fun {ExtensionAtom P} E={Extension P} in if E==unit then unit else {StringToAtom E} end end fun {DropExtensionURL P} {SplitExtension P $ _} end fun {DropExtension P} {ToString {DropExtensionURL P}} end fun {DropExtensionAtom P} {ToAtom {DropExtensionURL P}} end fun {AddExtensionURL P E} U = {ToURL P} in case {Reverse {CondSelect U path nil}} of H|T then {AdjoinAt U path {Reverse {Append H &.|{VSToString E}}|T}} end end fun {AddExtension P E} {ToString {AddExtensionURL P E}} end fun {AddExtensionAtom P E} {StringToAtom {AddExtension P E}} end fun {ReplaceExtensionURL P E} {AddExtensionURL {DropExtensionURL P} E} end fun {ReplaceExtension P E} {ToString {ReplaceExtensionURL P E}} end fun {ReplaceExtensionAtom P E} {StringToAtom {ReplaceExtension P E}} end PLATFORM = {Property.get 'platform.name'} fun {MaybeAddPlatform P} if {ExtensionAtom P}=='so' then {ToString {ToString P}#'-'#PLATFORM} else P end end fun {MaybeAddThisPlatform P PLATFORM} if {ExtensionAtom P}=='so' then {ToString {ToString P}#'-'#PLATFORM} else P end end fun {ToCacheRaw P} {URL.toVirtualStringExtended {ToURL P} FULL_RAW_CACHE} end fun {ToCacheURL P} {ToURL {ToCacheRaw P}} end fun {ToCache P} {ToString {ToCacheRaw P}} end fun {Stat P} {OS.stat {ToString P}} end fun {SafeStat P} try {Stat P} catch _ then NOT_FOUND end end fun {Dir P} {Filter {OS.getDir {ToString P}} NotIsDot} end Ls=Dir fun {Exists P} {SafeStat P}.type\='unknown' end fun {IsDir P} {SafeStat P}.type=='dir' end fun {IsFile P} {SafeStat P}.type=='reg' end fun {Unresolve Base Path} B={Expand {ToBase Base}} P={Expand Path} in if {IsPrefix B P} then {Append B $ P} else P end end fun {UnresolveURL Base Path} {ToURL {Unresolve Base Path}} end fun {UnresolveAtom Base Path} {StringToAtom {Unresolve Base Path}} end fun {IsAncestor Base Path} B={Expand {ToBase Base}} P={Expand Path} in {IsPrefix B P} end %% modifications to the file system proc {MakeDir P} U = {ExpandURL {ToNonBaseURL P}} in case {SafeStat U}.type of 'unknown' then {CreateDir {ToString U}} [] 'dir' then skip else {Exception.raiseError path(mkdir({ToAtom U}))} end end proc {MakeDirRec P} U = {ExpandURL {ToNonBaseURL P}} in case {CondSelect U path nil} of nil then skip [] [nil] then skip else {MakeDirRec {DirnameURL U}} {MakeDir U} end end proc {CreateDir P} {Shell.executeCommand [mkdir {Expand {ToNonBaseURL P}}]} end proc {Remove P} U = {ExpandURL {ToNonBaseURL P}} in if {IsFile U} then {OS.unlink {ToString U}} elseif {IsDir U} then {RemoveDir {ToString U}} else {Exception.raiseError path(remove({ToString U}))} end end proc {RemoveDir P} S = {Expand {ToNonBaseURL P}} in {Shell.executeCommand [rmdir S]} end proc {RemoveRec P} U = {ExpandURL {ToNonBaseURL P}} in if {IsFile U} then {OS.unlink {ToString U}} elseif {IsDir U} then for E in {Dir U} do {RemoveRec {Resolve U E}} end {RemoveDir {ToString U}} else {Exception.raiseError path(remove({ToString U}))} end end proc {CopyFile P1 P2} {Shell.executeCommand [cp {Expand P1} {Expand P2}]} end fun {IsBasename F} U={ToURL F} in {IsRelative U} andthen case {CondSelect U path unit} of [S] then S\=nil else false end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Pickler.oz0000644000175000017500000001266007763740130022142 0ustar kevingkeving%% Denys Duchier, Dec 2001 functor export ToString FromString ToFile FromFile import Open define proc {IntToBytes I B1 B2 B3 B4} Q4 Q3 in %% I is assumed to be non-negative B4 = I mod 256 Q4 = I div 256 B3 = Q4 mod 256 Q3 = Q4 div 256 B2 = Q3 mod 256 B1 = Q3 div 256 end proc {PickleToString V IN OUT} case V of unit then IN=(&u|OUT) [] true then IN=(&t|OUT) [] false then IN=(&f|OUT) [] X#Y then MID in {PickleToString Y IN MID} {PickleToString X MID (&#|OUT)} elseif {IsInt V} then if V < 0 then {PickleToString ~V IN (&N|OUT)} elsecase V %% optimize frequent special cases of 0 then IN=(&0|OUT) [] 1 then IN=(&1|OUT) [] 2 then IN=(&2|OUT) [] 3 then IN=(&3|OUT) [] 4 then IN=(&4|OUT) [] 5 then IN=(&5|OUT) [] 6 then IN=(&6|OUT) [] 7 then IN=(&7|OUT) [] 8 then IN=(&8|OUT) [] 9 then IN=(&9|OUT) else B1 B2 B3 B4 in %% use as few bytes as possible {IntToBytes V B1 B2 B3 B4} if B1==0 then if B2==0 then if B3==0 then IN=(&F|B4|OUT) else IN=(&G|B3|B4|OUT) end else IN=(&H|B2|B3|B4|OUT) end else IN=(&I|B1|B2|B3|B4|OUT) end end elseif {IsAtom V} then {PickleToString {AtomToString V} IN (&A|OUT)} elseif {IsString V} then N={Length V} MID in {PickleToString N IN (&S|MID)} {Append V OUT MID} elseif {IsList V} then N={Length V} MID in {PickleListToString V IN MID} {PickleToString N MID (&L|OUT)} elseif {IsTuple V} then MID in {PickleToString {Record.toList V} IN MID} {PickleToString {Label V} MID (&T|OUT)} elseif {IsRecord V} then MID in {PickleToString {Record.toListInd V} IN MID} {PickleToString {Label V} MID (&R|OUT)} elseif {IsDictionary V} then {PickleToString {Dictionary.entries V} IN (&D|OUT)} elseif {IsByteString V} then N={ByteString.length V} MID in {PickleToString N IN (&B|MID)} {Append {ByteString.toString V} OUT MID} end end proc {PickleListToString L IN OUT} case L of nil then IN=OUT [] H|T then MID in {PickleToString H IN MID} {PickleListToString T MID OUT} end end proc {IntFromBytes I B1 B2 B3 B4} I=(((B1*256 + B2)*256 + B3)*256 + B4) end fun {PickleFromString L Stack} case L of nil then Stack [] &u|L then {PickleFromString L unit |Stack} [] &t|L then {PickleFromString L true |Stack} [] &f|L then {PickleFromString L false|Stack} [] &#|L then case Stack of X|Y|Stack then {PickleFromString L (X#Y)|Stack} end [] &F|B4|L then {PickleFromString L {IntFromBytes $ 0 0 0 B4}|Stack} [] &G|B3|B4|L then {PickleFromString L {IntFromBytes $ 0 0 B3 B4}|Stack} [] &H|B2|B3|B4|L then {PickleFromString L {IntFromBytes $ 0 B2 B3 B4}|Stack} [] &I|B1|B2|B3|B4|L then {PickleFromString L {IntFromBytes $ B1 B2 B3 B4}|Stack} [] &A|L then case Stack of S|Stack then {PickleFromString L {StringToAtom S}|Stack} end [] &S|L then case Stack of N|Stack then L1 L2 in {List.takeDrop L N L1 L2} {PickleFromString L2 L1|Stack} end [] &B|L then case Stack of N|Stack then L1 L2 in {List.takeDrop L N L1 L2} {PickleFromString L2 {ByteString.make L1}|Stack} end [] &L|L then case Stack of N|StackIn then StackOut Lst in {Grab N StackIn StackOut nil Lst} {PickleFromString L Lst|StackOut} end [] &T|L then case Stack of Lab|Args|Stack then {PickleFromString L {List.toTuple Lab Args}|Stack} end [] &R|L then case Stack of Lab|Alist|Stack then {PickleFromString L {List.toRecord Lab Alist}|Stack} end [] &N|L then case Stack of N|Stack then {PickleFromString L (~N)|Stack} end [] &0|L then {PickleFromString L 0|Stack} [] &1|L then {PickleFromString L 1|Stack} [] &2|L then {PickleFromString L 2|Stack} [] &3|L then {PickleFromString L 3|Stack} [] &4|L then {PickleFromString L 4|Stack} [] &5|L then {PickleFromString L 5|Stack} [] &6|L then {PickleFromString L 6|Stack} [] &7|L then {PickleFromString L 7|Stack} [] &8|L then {PickleFromString L 8|Stack} [] &9|L then {PickleFromString L 9|Stack} [] &D|L then case Stack of Alist|Stack then {PickleFromString L {AlistToDictionary Alist}|Stack} end end end proc {Grab N StackIn StackOut Lin Lout} if N==0 then StackIn=StackOut Lin=Lout elsecase StackIn of X|StackIn then {Grab N-1 StackIn StackOut X|Lin Lout} end end proc {AlistToDictionary Alist D} D={NewDictionary} {ForAll Alist proc {$ Key#Val} {Dictionary.put D Key Val} end} end fun {ToString V} {PickleToString V $ nil} end fun {FromString V} case {PickleFromString V nil} of [V] then V end end proc {ToFile V F} O=if {HasFeature Open compressedFile} then {New Open.compressedFile init(name:F flags:[write create truncate 9])} else {New Open.file init(name:F flags:[write create truncate])} end in try {O write(vs:{ToString V})} finally try {O close} catch _ then skip end end end fun {FromFile F} O=if {HasFeature Open compressedFile} then {New Open.compressedFile init(url:F)} else {New Open.file init(url:F)} end S={O read(list:$ size:all)} in {O close} {FromString S} end end mozart-stdlib-20060615/mozart-stdlib/ozmake/README0000644000175000017500000000511707274617757021075 0ustar kevingkeving-*-outline-*- An executable is distinguished by the .exe extension. On all platforms they are installed both with and without the extension. A rule is represented by a record: rule(tool:TOOL file:FILE options:[OPTIONS...]) Options for cc: library(foo) -> -lfoo * MAKEFILE makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( T1 : [ D1 D2 ... ] ... ) rules : o( T1 : TOOL1(S1) T2 : TOOL2(S2) ... ) uri : URI mogul : MOGUL author : [ A1 A2 ... ] released : DATE clean : [ GLOB... ] veryclean: [ GLOB... ] ) The src targets are included in the distribution. In particular, if a bin or lib target occurs in src, it is prebuilt for the distribution and the sources necessary to build it are not included. * PACKAGE DATABASE there should be a single entry for each package. the only way to have multiple versions of the `same' package is to actually make the packages of these versions different, maybe by adding a version number to the mogul id and doing the same for the uri. the database entry should only record the files that have actually been installed. package( mogul : MOGUL uri : URI author : [ A1 A2 ... ] released : DATE installed : DATE blurb : TEXT info_html : TEXT info_text : TEXT files : FILE lost : FILES zombies : FILES ) * INSTALLATION ** is the package already in the database? *** yes **** --grade=none (default) signal an error **** --grade=same release dates must be identical **** --grade=up new package must have more recent release date **** --grade=down new package must have less recent release date **** --grade=any ok *** no just fine ** do package files collide with database files? *** yes **** --replacefiles just fine **** all files are owned by an installed version of the package if --grade=none signal an error (already done earlier) **** else signal an error ** install files keeping track of which ones are overwritting files in the database *** for all other packages move the affected files to their lost list *** if the package is installed take all the non-overwritten files of the previous installation **** if --extendpackage leave them alone, keep them in the new installation **** if --keepzombies move them to the zombie list of the new installation **** else remove them *** update database entry using new installation * RECURSING INTO SUBDIRECTORIES the makefile record may have a subdirs feature which holds a list of subdirectories (bare filenames). create mozart-stdlib-20060615/mozart-stdlib/ozmake/Requires.oz0000644000175000017500000000224610052370666022345 0ustar kevingkevingfunctor import Utils at 'Utils.ozf' Path at 'Path.ozf' Manager at 'Manager.ozf' export 'class' : Requires prepare DictKeys = Dictionary.keys define class Requires meth fork($) Args = {self get_args($)} Man = {New Manager.'class' init} OptList = {self get_optlist($)} in {Man set_optlist(OptList)} for Key#Set#_#OnFork in {self get_optlist($)} do if OnFork andthen {HasFeature Args Key} then {Man Set(Args.Key)} end end Man end meth InstallRequire(MogulID) {self trace('installing missing required package: '#MogulID)} {self incr} try Man = {self fork($)} in {Man set_grade(any)} {Man set_package(MogulID)} {Man install(nil)} finally {self decr} end end meth install_requires() if {self get_dorequires($)} then Reqs = {self get_requires($)} in if Reqs==unit then skip else for R in Reqs do if {Utils.isMogulID R} then Key={Path.toAtom R} in if {self database_get_package(Key $)}==unit then Requires,InstallRequire(Key) end end end end {self recurse(install_requires)} end end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Shell.oz0000644000175000017500000000610407357155011021611 0ustar kevingkeving%%% ================================================================== %%% {Shell.executeCommand CMD} %%% {Shell.executeProgram CMD} %%% CMD is a list whose 1st element is the program to execute, and %%% the remaining elements are the arguments to this program. In %%% order to be run by the shell, CMD must be transformed into a %%% virtual string with all elements appropriately quoted. The %%% quote character is " for Windows and ' otherwise. With %%% executeCommand, the command is explicitly passed to a shell. %%% %%% {Shell.quoteUsing CMD QUOTE} %%% CMD is as above and QUOTE is a virtual string to use as the %%% quoting character. %%% %%% {Shell.toUserVS CMD} %%% calls Shell.quoteUsing with an empty QUOTE. %%% ================================================================== functor export ExecuteProgram ExecuteCommand QuoteUsing ToUserVS import% System Property(get) at 'x-oz://system/Property.ozf' OS(system getEnv) at 'x-oz://system/OS.ozf' Open(pipe) at 'x-oz://system/Open.ozf' Windows at 'Windows.ozf' define %% the arguments on the command given to the shell for %% execution need to be quoted to avoid problems with %% embeded spaces in filenames and special shell %% characters QUOTE = if Windows.isWin then '"' else '\'' end fun {QuoteUsing CMD Quote} %% CMD is a list: we are going to quote each element of %% this list using the Quote string specified and then %% we are going to concatenate all them separated by %% single spaces. {FoldL CMD %% in principle, we should be careful about embedded %% occurrences of characters used for quoting - we %% ignore this issue for the nonce fun {$ VS I} VS#' '#Quote#I#Quote end nil} end %% an advantage of using an arbitrary VS as a Quote, in %% the above is that we can also use an empty VS. This %% turns out to be useful when we want to display commands %% to the user. They are harder to read when properly %% quoted fun {ToUserVS CMD} {QuoteUsing CMD ''} end %% for execution, use the platform specific quote %% On Win95/98 (aka old Windows), we need to invoke %% COMMAND.COM, i.e. the shell specified by environment %% variable COMSPEC. On other systems OS.system already %% does the right thing. ToProgramVS if Windows.isOldWin then fun {!ToProgramVS CMD} 'COMMAND.COM /C'#{QuoteUsing CMD QUOTE} end else fun {!ToProgramVS CMD} {QuoteUsing CMD QUOTE} end end ToCommandVS if Windows.isWin then if Windows.isOldWin then fun {!ToCommandVS CMD} First|Rest = CMD in 'COMMAND.COM /C '#First#{QuoteUsing Rest QUOTE} end else fun {!ToCommandVS CMD} First|Rest = CMD in First#{QuoteUsing Rest QUOTE} end end else !ToCommandVS=ToProgramVS end proc {Execute VS} %{System.showInfo 'EXECUTING: '#VS} if {OS.system VS}\=0 then raise shell(VS) end end end proc {ExecuteProgram CMD} {Execute {ToProgramVS CMD}} end proc {ExecuteCommand CMD} {Execute {ToCommandVS CMD}} end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Uninstaller.oz0000644000175000017500000000421210023156251023027 0ustar kevingkevingfunctor export 'class' : Uninstaller prepare VSToAtom = VirtualString.toAtom fun {UnitToNil X} if X==unit then nil else X end end DictKeys = Dictionary.keys import Utils at 'Utils.ozf' Path at 'Path.ozf' define class Uninstaller meth uninstall MOG = if {self get_package_given($)} then Pkg={self get_package($)} in if {Utils.isMogulID Pkg} then {VSToAtom {self get_package($)}} elsecase {self load_extract_mogulid(Pkg $)} of unit then raise ozmake(uninstall:bizzarepackage(Pkg)) end [] A then A end else {self makefile_read} if {self get_no_makefile($)} then raise ozmake(uninstall:missingpackageormogul) end else {self get_mogul($)} end end {self database_read} PKG = {self database_get_package(MOG $)} in if PKG==unit then raise ozmake(uninstall:packagenotfound(MOG)) end else DFILES = {NewDictionary} for F in {UnitToNil {CondSelect PKG files nil}} do DFILES.F := unit end FILES = {Sort {DictKeys DFILES} Value.'>'} DZOMBIES = {NewDictionary} for F in {UnitToNil {CondSelect PKG zombies nil}} do DZOMBIES.F := unit end ZOMBIES = {Sort {DictKeys DZOMBIES} Value.'>'} in {self trace('uninstalling package '#MOG)} {self incr} try {self trace('removing files')} {self incr} try for F in FILES do {self exec_rm(F)} end finally {self decr} end {self trace('removing zombies')} {self incr} try for F in ZOMBIES do {self exec_rm(F)} end finally {self decr} end {self trace('removing empty directories')} {self incr} try for F in FILES do {self rmEmptyDirs({Path.dirnameURL F})} end for F in ZOMBIES do {self rmEmptyDirs({Path.dirnameURL F})} end finally {self decr} end {self database_remove_package(MOG)} {self database_save} finally {self decr} end end end meth rmEmptyDirs(F) if {Path.isDir F} andthen {Path.ls F}==nil then {self exec_rmdir(F)} {self rmEmptyDirs({Path.dirnameURL F})} end end end end mozart-stdlib-20060615/mozart-stdlib/ozmake/Utils.oz0000644000175000017500000001771107447373275021666 0ustar kevingkevingfunctor export SlurpFile CompileFile Union Diff DateParse DateLess DateToString DateCurrentToString DateCurrentToAtom DateCurrent DateToAtom DateToUserVS IsMogulID IsMogulRootID CleanMogulID NewStack NewStackFromList ListToVS ReadTextDB WriteTextDB HaveGNUC MogulToFilename MogulToPackagename MogulToRelative VersionToInts VersionFromInts IsVersion VersionCompare AuthorOK ToRecord import Open Compiler OS URL Path at 'Path.ozf' prepare MONTH = o('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec') ZERO = "0" fun {DateParse VS} try YEAR MONTH DAY HOUR MIN SEC Year Month Day Hour Min Sec in case {String.tokens {VirtualString.toString VS} &-} of [Y M D H] then YEAR=Y MONTH=M DAY=D case {String.tokens H &:} of [H M S] then HOUR=H MIN=M SEC=S [] [H M] then HOUR=H MIN=M SEC=ZERO end [] [Y M D] then YEAR=Y MONTH=M DAY=D HOUR=MIN=SEC=ZERO end Year = {StringToInt YEAR} Month = {StringToInt MONTH} Day = {StringToInt DAY} Hour = {StringToInt HOUR} Min = {StringToInt MIN} Sec = {StringToInt SEC} %% quick sanity check if Year <0 orelse Month<1 orelse Month>12 orelse Day <1 orelse Day >31 orelse Hour <0 orelse Hour >23 orelse Min <0 orelse Min >59 orelse Sec <0 orelse Sec >59 then raise unit end end date(year : Year mon : Month mDay : Day hour : Hour min : Min sec : Sec) catch _ then unit end end fun {DateLess D1 D2} D1.year < D2.year orelse (D1.year == D2.year andthen (D1.mon < D2.mon orelse (D1.mon == D2.mon andthen (D1.mDay < D2.mDay orelse (D1.mDay == D2.mDay andthen (D1.hour < D2.hour orelse (D1.hour == D2.hour andthen (D1.min < D2.min orelse (D1.min == D2.min andthen (D1.sec < D2.sec)))))))))) end fun {DateToString D} {VirtualString.toString D.year#'-'#D.mon#'-'#D.mDay#'-'#D.hour#':'#D.min#':'#D.sec} end fun {DateToAtom D} {StringToAtom {DateToString D}} end fun {DateToUserVS Date} YY = Date.year MM = {CondSelect MONTH Date.mon '???'} DD = Date.mDay H = Date.hour M = Date.min S = Date.sec T = if S==0 then if M==0 andthen H==0 then nil else ' ('#H#':'#M#')' end else ' ('#H#':'#M#':'#S#')' end in DD#' '#MM#' '#YY#T end CTRL_A = 1 VS2S = VirtualString.toString TOKS = String.tokens fun {VersionToInts S} {Map {TOKS {VS2S S} &.} StringToInt} end local fun {Conc VS I} if VS==nil then I else VS#'.' end end fun {IsPos I} I>=0 end fun {Cmp L1 L2} case L1 of nil then case L2 of nil then eq else lt end [] I1|L1 then case L2 of nil then gt [] I2|L2 then if I1==I2 then {Cmp L1 L2} elseif I1>I2 then gt else lt end end end end in fun {VersionFromInts L} {VS2S {FoldL L Conc nil}} end fun {IsVersion S} try L={VersionToInts S} in L\=nil andthen {All L IsPos} catch _ then false end end fun {VersionCompare S1 S2} {Cmp {VersionToInts S1} {VersionToInts S2}} end end define fun {SlurpFile F} O={New Open.file init(url:{Path.toURL F})} in try {ByteString.make {O read(list:$ size:all)}} finally try {O close} catch _ then skip end end end proc {CompileFile F Debug R} E = {New Compiler.engine init} I = {New Compiler.interface init(E)} in {E enqueue(setSwitch(threadedqueries false))} {E enqueue(setSwitch(expression true))} {E enqueue(setSwitch(feedtoemulator true))} if Debug then {E enqueue(setSwitch(controlflowinfo true))} {E enqueue(setSwitch(staticvarnames true))} end {E enqueue(feedFile(F return(result:R)))} {I sync} if {I hasErrors($)} then L={I getMessages($)} LL={Map L fun {$ M} case M of error(...) then message(M unit) else M end end} VS={I formatMessages(LL $)} in raise ozmake(compiling:F VS) end end end fun {Union L1 L2} D={NewDictionary} in for F in L1 do A={Path.toAtom F} in D.A := true end for F in L2 do A={Path.toAtom F} in D.A := true end {Dictionary.keys D} end fun {Diff L1 L2} for X in L1 collect:Collect do if {Not {Member X L2}} then {Collect X} end end end fun {DateCurrent} D={OS.localTime} Y=D.year+1900 M=D.mon+1 in date( year : Y mon : M mDay : D.mDay hour : D.hour min : D.min sec : D.sec) end fun {DateCurrentToString} R = {DateCurrent} in {VirtualString.toString R.year#'-'#R.mon#'-'#R.mDay#'-'#R.hour#':'#R.min#':'#R.sec} end fun {DateCurrentToAtom} {StringToAtom {DateCurrentToString}} end fun {IsMogulID F} case {CondSelect {URL.make F} scheme unit} of "mogul" then true else false end end fun {IsMogulRootID F} U = {URL.make F} in case {CondSelect U scheme unit}#{CondSelect U path unit} of "mogul"#[_] then true else false end end fun {NewStack} {StackPack {NewCell nil}} end fun {NewStackFromList L} {StackPack {NewCell L}} end fun {StackPack C} proc {Push X} L in {Exchange C L X|L} end fun {Pop} Old New in {Exchange C Old New} case Old of H|T then New=T H else Old=New raise empty end end end fun {IsEmpty} {Access C}==nil end fun {ToList} {Access C} end in stack(push : Push pop : Pop isEmpty : IsEmpty toList : ToList) end fun {ListToVS L} {FoldL L fun {$ VS S} if VS==nil then S elseif S==nil then VS else VS#' '#S end end nil} end class TextFile from Open.file Open.text end fun {ReadTextDB F} O = {New TextFile init(name:F)} in try {ReadNextEntry O} finally try {O close} catch _ then skip end end end fun {ReadNextEntry O} C={O getC($)} in if C==false then nil else {Compiler.virtualStringToValue (C|{ReadEntry O})}|{ReadNextEntry O} end end fun {ReadEntry O} C={O getC($)} in if C==CTRL_A then nil else C|{ReadEntry O} end end proc {WriteTextDB L F} O = {New Open.file init(name:F flags:[write create truncate])} in try for X in L do {O write(vs:{Value.toVirtualString X 1000000 1000000}#[CTRL_A])} end finally try {O close} catch _ then skip end end end local fun {HasYes L} case L of &Y|&E|&S|_ then true [] _|L then {HasYes L} else false end end in fun {HaveGNUC GetTmpnam OZTOOL} F={GetTmpnam}#'.h' in try O={New Open.file init(name:F flags:[write create truncate])} {O write(vs:"#ifdef __GNUC__\nYES\n#endif")} {O close} P={New Open.pipe init(cmd:OZTOOL args:['c++' '-E' F])} L={P read(list:$ size:all)} in {HasYes L} catch _ then false finally try {OS.unlink F} catch _ then skip end end end end local fun {SlashToDash L} case L of &/|L then &-|{SlashToDash L} [] H|L then H|{SlashToDash L} [] nil then nil end end in fun {MogulToFilename MOG} U1={Path.toURL MOG} U2={Adjoin U1 url(scheme:unit device:unit absolute:false)} in {SlashToDash {Path.toCache U2}} end end fun {MogulToPackagename MOG} {Append {MogulToFilename MOG} ".pkg"} end fun {MogulToRelative MOG} {Path.toString {Adjoin {Path.toURL MOG} url(scheme:unit device:unit absolute:false)}} end fun {AuthorOK S} {IsMogulID S} orelse local L={VS2S S} in {Not {Member &: L} orelse {Member &/ L}} end end fun {ToRecord D} if {IsDictionary D} then {Dictionary.toRecord o D} elseif {IsRecord D} then D else raise ozmake(toRecord:D) end end end fun {CleanMogulID MOG} %% normalize MOGUL ID, i.e. no trailing slash {Path.toNonBaseAtom MOG} end endmozart-stdlib-20060615/mozart-stdlib/ozmake/Windows.oz0000644000175000017500000000127107446456270022206 0ustar kevingkevingfunctor export comspec : COMSPEC isWin : IsWin isOldWin : IsOldWin ExecHeader import OS(getEnv) Property(get) Utils at 'Utils.ozf' define IsWin = ({Property.get 'platform.os'}=='win32') COMSPEC IsOldWin if IsWin then COMSPEC={OS.getEnv 'COMSPEC'} case {Reverse {Map {VirtualString.toString COMSPEC} Char.toLower}} of &e|&x|&e|&.|&d|&m|&c|_ then IsOldWin=false else IsOldWin=true end else COMSPEC=unit IsOldWin=false end ExecHeader = if IsWin then {ByNeed fun {$} {Utils.slurpFile {Property.get 'oz.home'}#'/bin/ozwrapper.bin'} end} else '#! /bin/sh\nexec ozengine $0 "$@"\n' end end mozart-stdlib-20060615/mozart-stdlib/ozmake/config.guess0000755000175000017500000012206510012714126022503 0ustar kevingkeving#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/FreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mozart-stdlib-20060615/mozart-stdlib/ozmake/config.sub0000755000175000017500000007314110012714126022146 0ustar kevingkeving#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-07-04' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mozart-stdlib-20060615/mozart-stdlib/ozmake/configure0000755000175000017500000017113310017672202022075 0ustar kevingkeving#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.49e. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Avoid depending upon Character Ranges. ac_cr_az='abcdefghijklmnopqrstuvwxyz' ac_cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ac_cr_09='0123456789' ac_cr_alnum=$ac_cr_az$ac_cr_AZ$ac_cr_09 # Sed expression to map a string onto a valid sh and CPP variable names. ac_tr_sh="sed y%*+%pp%;s%[^_$ac_cr_alnum]%_%g" ac_tr_cpp="sed y%*$ac_cr_az%P$ac_cr_AZ%;s%[^_$ac_cr_alnum]%_%g" ac_unique_file="ozinstall" ac_default_prefix=/usr/local/oz # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$ac_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$ac_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir \ exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; NONE ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^/]\)/*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_status=$?; ac_signal='$ac_signal'; { (exit $ac_status); exit $ac_status; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:780: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:791: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:799: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_suggest_removing_cache=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:815: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_suggest_removing_cache=: ;; ,set) { echo "$as_me:819: WARNING: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: WARNING: \`$ac_var' was not set in the previous run" >&2;} ac_suggest_removing_cache=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:825: WARNING: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: WARNING: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:827: WARNING: former value: $ac_old_val" >&5 echo "$as_me: WARNING: former value: $ac_old_val" >&2;} { echo "$as_me:829: WARNING: current value: $ac_new_val" >&5 echo "$as_me: WARNING: current value: $ac_new_val" >&2;} ac_suggest_removing_cache=: fi;; esac done if $ac_suggest_removing_cache; then { echo "$as_me:836: WARNING: changes in the environment can compromise the build" >&5 echo "$as_me: WARNING: changes in the environment can compromise the build" >&2;} { echo "$as_me:838: WARNING: consider removing $cache_file and starting over" >&5 echo "$as_me: WARNING: consider removing $cache_file and starting over" >&2;} fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:857: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:860: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:886: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:896: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:900: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:909: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:913: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:918: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:925: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:934: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:939: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:946: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:966: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:970: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi srcdir=`cd $srcdir 2> /dev/null && pwd` if test "$prefix" = NONE; then prefix="$ac_default_prefix" fi if expr "$prefix" : "\/" >/dev/null; then : ; else ozcur=`pwd` prefix="$ozcur/$prefix" fi for ac_prog in ozengine ozengine.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:991: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_OZE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_OZE in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_OZE="$VAR_OZE" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_OZE="$ac_dir/$ac_word" echo "$as_me:1008: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1010: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1013: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_OZE=$ac_cv_path_VAR_OZE if test -n "$VAR_OZE"; then echo "$as_me:1025: result: $VAR_OZE" >&5 echo "${ECHO_T}$VAR_OZE" >&6 else echo "$as_me:1028: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_OZE" && break done test -n "$VAR_OZE" || VAR_OZE="UNDEFINED" if test "$VAR_OZE" = "UNDEFINED"; then { { echo "$as_me:1037: error: ozengine not found" >&5 echo "$as_me: error: ozengine not found" >&2;} { (exit 1); exit 1; }; } fi OZHOME=`expr "${VAR_OZE}" : '\(.*\)/[^/]*/[^/]*$' || echo "."` for ac_prog in ozc ozc.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1048: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_OZC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_OZC in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_OZC="$VAR_OZC" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_OZC="$ac_dir/$ac_word" echo "$as_me:1065: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1067: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1070: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_OZC=$ac_cv_path_VAR_OZC if test -n "$VAR_OZC"; then echo "$as_me:1082: result: $VAR_OZC" >&5 echo "${ECHO_T}$VAR_OZC" >&6 else echo "$as_me:1085: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_OZC" && break done test -n "$VAR_OZC" || VAR_OZC="UNDEFINED" if test "$VAR_OZC" = "UNDEFINED"; then { { echo "$as_me:1094: error: ozc not found" >&5 echo "$as_me: error: ozc not found" >&2;} { (exit 1); exit 1; }; } fi for ac_prog in ozl ozl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1103: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_OZL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_OZL in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_OZL="$VAR_OZL" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_OZL="$ac_dir/$ac_word" echo "$as_me:1120: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1122: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1125: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_OZL=$ac_cv_path_VAR_OZL if test -n "$VAR_OZL"; then echo "$as_me:1137: result: $VAR_OZL" >&5 echo "${ECHO_T}$VAR_OZL" >&6 else echo "$as_me:1140: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_OZL" && break done test -n "$VAR_OZL" || VAR_OZL="UNDEFINED" if test "$VAR_OZL" = "UNDEFINED"; then { { echo "$as_me:1149: error: ozl not found" >&5 echo "$as_me: error: ozl not found" >&2;} { (exit 1); exit 1; }; } fi for ac_prog in oztool oztool.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1158: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_OZTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_OZTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_OZTOOL="$VAR_OZTOOL" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_OZTOOL="$ac_dir/$ac_word" echo "$as_me:1175: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1177: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1180: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_OZTOOL=$ac_cv_path_VAR_OZTOOL if test -n "$VAR_OZTOOL"; then echo "$as_me:1192: result: $VAR_OZTOOL" >&5 echo "${ECHO_T}$VAR_OZTOOL" >&6 else echo "$as_me:1195: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_OZTOOL" && break done test -n "$VAR_OZTOOL" || VAR_OZTOOL="UNDEFINED" if test "$VAR_OZTOOL" = "UNDEFINED"; then { { echo "$as_me:1204: error: oztool not found" >&5 echo "$as_me: error: oztool not found" >&2;} { (exit 1); exit 1; }; } fi for ac_prog in xsltproc xsltproc.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1213: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_XSLTPROC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_XSLTPROC="$VAR_XSLTPROC" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_XSLTPROC="$ac_dir/$ac_word" echo "$as_me:1230: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1232: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1235: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_XSLTPROC=$ac_cv_path_VAR_XSLTPROC if test -n "$VAR_XSLTPROC"; then echo "$as_me:1247: result: $VAR_XSLTPROC" >&5 echo "${ECHO_T}$VAR_XSLTPROC" >&6 else echo "$as_me:1250: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_XSLTPROC" && break done test -n "$VAR_XSLTPROC" || VAR_XSLTPROC="UNDEFINED" for ac_prog in lynx lynx.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1262: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_LYNX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_LYNX in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_LYNX="$VAR_LYNX" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_LYNX="$ac_dir/$ac_word" echo "$as_me:1279: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1281: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1284: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_LYNX=$ac_cv_path_VAR_LYNX if test -n "$VAR_LYNX"; then echo "$as_me:1296: result: $VAR_LYNX" >&5 echo "${ECHO_T}$VAR_LYNX" >&6 else echo "$as_me:1299: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_LYNX" && break done test -n "$VAR_LYNX" || VAR_LYNX="UNDEFINED" if test "$VAR_LYNX" = UNDEFINED; then for ac_prog in elinks elinks.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1312: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_VAR_ELINKS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VAR_ELINKS in [\\/]* | ?:[\\/]*) ac_cv_path_VAR_ELINKS="$VAR_ELINKS" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$prefix/bin:$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_VAR_ELINKS="$ac_dir/$ac_word" echo "$as_me:1329: found $ac_dir/$ac_word" >&5 { ac_try='$ac_dir/$ac_word --version &2' { (eval echo "$as_me:1331: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1334: \$? = $ac_status" >&5 (exit $ac_status); }; } break fi done ;; esac fi VAR_ELINKS=$ac_cv_path_VAR_ELINKS if test -n "$VAR_ELINKS"; then echo "$as_me:1346: result: $VAR_ELINKS" >&5 echo "${ECHO_T}$VAR_ELINKS" >&6 else echo "$as_me:1349: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$VAR_ELINKS" && break done test -n "$VAR_ELINKS" || VAR_ELINKS="UNDEFINED" if test "$VAR_ELINKS" = UNDEFINED; then VAR_HTML_TO_TEXT=UNDEFINED else VAR_HTML_TO_TEXT=elinks fi else VAR_HTML_TO_TEXT=lynx fi VAR_OZINSTALL="$srcdir/ozinstall" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\EOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p EOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:1478: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:1645: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # Handling of arguments. 'Makefile' ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; # This is an error. -*) { { echo "$as_me:1667: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) { { echo "$as_me:1672: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.49e, executed with > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <<\EOF # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit $?); exit $?; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@VAR_OZE@,$VAR_OZE,;t t s,@OZHOME@,$OZHOME,;t t s,@VAR_OZC@,$VAR_OZC,;t t s,@VAR_OZL@,$VAR_OZL,;t t s,@VAR_OZTOOL@,$VAR_OZTOOL,;t t s,@VAR_XSLTPROC@,$VAR_XSLTPROC,;t t s,@VAR_LYNX@,$VAR_LYNX,;t t s,@VAR_ELINKS@,$VAR_ELINKS,;t t s,@VAR_HTML_TO_TEXT@,$VAR_HTML_TO_TEXT,;t t s,@VAR_OZINSTALL@,$VAR_OZINSTALL,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac if test x"$ac_file" != x-; then { echo "$as_me:1893: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:1911: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:1924: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test "$no_create" = yes || $SHELL $CONFIG_STATUS || { (exit 1); exit 1; } mozart-stdlib-20060615/mozart-stdlib/ozmake/configure.in0000644000175000017500000000353210017672202022474 0ustar kevingkevingdnl replace install-sh by the name of a real source file AC_INIT(ozinstall) AC_PREFIX_DEFAULT(/usr/local/oz) AC_CANONICAL_HOST AC_PROG_MAKE_SET dnl dnl dnl AC_DEFUN(OZSKEL_MAKE_ABSOLUTE,[ if expr "$[$1]" : "\/" >/dev/null; then : ; else ozcur=`pwd` [$1]="$ozcur/$[$1]" fi ]) dnl dnl dnl srcdir=`cd $srcdir 2> /dev/null && pwd` if test "$prefix" = NONE; then prefix="$ac_default_prefix" fi OZSKEL_MAKE_ABSOLUTE(prefix) dnl dnl dnl AC_PATH_PROGS(VAR_OZE,ozengine ozengine.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZE" = "UNDEFINED"; then AC_MSG_ERROR([ozengine not found]) fi AC_SUBST(VAR_OZE) dnl dnl dnl changequote(<,>) OZHOME=`expr "${VAR_OZE}" : '\(.*\)/[^/]*/[^/]*$' || echo "."` changequote([,]) AC_SUBST(OZHOME) dnl dnl dnl AC_PATH_PROGS(VAR_OZC,ozc ozc.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZC" = "UNDEFINED"; then AC_MSG_ERROR([ozc not found]) fi AC_SUBST(VAR_OZC) dnl dnl dnl AC_PATH_PROGS(VAR_OZL,ozl ozl.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZL" = "UNDEFINED"; then AC_MSG_ERROR([ozl not found]) fi AC_SUBST(VAR_OZL) dnl dnl dnl AC_PATH_PROGS(VAR_OZTOOL,oztool oztool.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_OZTOOL" = "UNDEFINED"; then AC_MSG_ERROR([oztool not found]) fi AC_SUBST(VAR_OZTOOL) dnl dnl dnl AC_PATH_PROGS(VAR_XSLTPROC,xsltproc xsltproc.exe,UNDEFINED,$prefix/bin:$PATH) AC_SUBST(VAR_XSLTPROC) dnl dnl dnl AC_PATH_PROGS(VAR_LYNX,lynx lynx.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_LYNX" = UNDEFINED; then AC_PATH_PROGS(VAR_ELINKS,elinks elinks.exe,UNDEFINED,$prefix/bin:$PATH) if test "$VAR_ELINKS" = UNDEFINED; then VAR_HTML_TO_TEXT=UNDEFINED else VAR_HTML_TO_TEXT=elinks fi else VAR_HTML_TO_TEXT=lynx fi AC_SUBST(VAR_HTML_TO_TEXT) AC_SUBST(VAR_LYNX) AC_SUBST(VAR_ELINKS) dnl dnl dnl VAR_OZINSTALL="$srcdir/ozinstall" AC_SUBST(VAR_OZINSTALL) AC_OUTPUT(Makefile) mozart-stdlib-20060615/mozart-stdlib/ozmake/cygpath.sh0000755000175000017500000000055310032533142022155 0ustar kevingkeving#!/bin/sh case `uname -s` in CYGWIN*) pathname=`cygpath -w "$1" | sed 's|\\\\|/|g'` case "$pathname" in ?:* ) device=`expr substr "$pathname" 1 1 | tr '[:upper:]' '[:lower:]'` pathname=`expr "$pathname" : '.\(:.*\)$'` pathname="$device$pathname" echo "$pathname" ;; *) echo "$pathname" ;; esac ;; *) echo "$1" ;; esac mozart-stdlib-20060615/mozart-stdlib/ozmake/i386-mingw32-oztool0000755000175000017500000000256607273236012023425 0ustar kevingkeving#! /bin/sh plat=i386-mingw32 if test $# -eq 0 then cat < oztool cc -c oztool ld -o oztool platform EOF exit 2 fi cmd=$1 shift case "$cmd" in c++) exec ${plat}-g++ -I${OZHOME}/include "$@" ;; cc) exec ${plat}-gcc -I${OZHOME}/include "$@" ;; platform) echo "win32-i486" exit 0 ;; ld) # Set up variables libname, libdirs, and args from command line while [ $# != 0 ] do case "$1" in -o) shift libname=$1 ;; -s) ;; # just ignore it -lc) ;; # just ignore it -L*) libdirs="$libdirs $1" ;; *) args="$args $1" ;; esac shift done emulator_lib=libemulator.a defname=${libname}.def tail +2 ${OZHOME}/include/emulator.def > emulator0.def # Create the import stub library for emulator.dll ${plat}-dlltool --as ${plat}-as \ --def emulator0.def \ --dllname emulator.dll \ --output-lib ${emulator_lib} || exit 1 # Create the library proper ${plat}-dlltool --as ${plat}-as --output-def $defname \ --dllname $libname $args || exit 1 exec \ ${plat}-dllwrap --driver-name ${plat}-gcc \ --dlltool-name ${plat}-dlltool \ --as ${plat}-as \ -s -o $libname --def $defname \ --dllname $libname $args \ ${emulator_lib} \ $libdirs ;; *) echo "$0: unknown command $cmd" 1>&2 exit 1 ;; esac mozart-stdlib-20060615/mozart-stdlib/ozmake/index.html0000644000175000017500000012420310250330401022146 0ustar kevingkeving ozmake

ozmake

Denys Duchier

provides
ozmake

see CHANGES for a list of changes between successive versions of ozmake.

USAGE

ozmake OPTIONS TARGETS

ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface.

SYNOPSIS

ozmake --help
ozmake [--build] [TARGETS...]
ozmake --install [TARGETS...]
ozmake --install [--package=PKG]
ozmake --uninstall [--package=PKG]
ozmake --clean
ozmake --veryclean
ozmake --create [--package=FILE]
ozmake --publish
ozmake --extract [--package=PKG]
ozmake --list [--package=MOGUL]
ozmake --config=(put|delete|list) ...
ozmake --mogul=(put|delete|list|export) ...

OPTIONS

In the following, we write meta variables between angle brackets, e.g. <PREFIX> or <URI as cache path>

General Options

-v, --verbose
print out more tracing information that the default. By supplying this option twice, you will sometimes get even more information.
-q, --quiet
suppress all tracing and feedback information
-n, --just-print
perform a dry run, i.e. just print what would happen without actually performing the actions
--local
do not recurse into subdirectories
--(no)autodepend
default: true
automatically determine build-time and install-time (run-time) dependencies. Currently, this is only supported for Oz sources by looking at import and require sections.
--(no)requires
default: true
automatically fetch and install other packages that the current one requires. This option is relevant both for building and for installing.

What you should remember here, is that -vn is your friend. Add -vn at the end of any ozmake invocation, and it will tell you in great detail what the command would do, without actually doing it.

Directories and URLs

--prefix=<PREFIX>
default: ~/.oz
root of private installation area
--dir=<DIR>
default: current directory
default directory for other options below
--builddir=<BUILDDIR>
default: <DIR>
directory in which to build
--srcdir=<SRCDIR>
default: <DIR>
directory where source files are located
--bindir=<BINDIR>
default: <PREFIX>/bin
directory where bin targets are placed
--libroot=<LIBROOT>
default: <PREFIX>/cache
root directory of cache into which lib targets are installed
--libdir=<LIBDIR>
default: <LIBROOT>/<URI as cache path>
directory into which lib targets are installed
--docroot=<DOCROOT>
default: <PREFIX>/doc
root directory into which doc targets are installed
--docdir=<DOCDIR>
default: <DOCROOT>/<MOGUL as filename>
directory into which doc targets are installed
--extractdir=<EXTRACTDIR>
default: <DIR>
directory into which to extract a package
--archive=<ARCHIVE>
default: http://www.mozart-oz.org/mogul/pkg
URL of mogul archive from which packages can be downloaded
--moguldir=<MOGULDIR>
directory in which are placed sub-directories for the user's contributions: a directory for packages, one for documentation, one for mogul database entries.
--mogulurl=<MOGULURL>
url corresponding to the <MOGULDIR> directory

Files

-m <FILE>, --makefile=<FILE>
default: <SRCDIR>/makefile.oz
location of makefile
-p <PKG>, --package=<PKG>
file or URL of package. when creating a package, it should be a local filename. when extracting or installing, it can also be a URL or a mogul id; in the latter case, the package is automatically downloaded from the mogul archive
-V <VERSION>, --packageversion=<VERSION>
this option is respected by --extract and --install. When --extract is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given <VERSION> of the package. --install will simply check that the package to be installed really has this <VERSION>.
--database=<DB>
default: <PREFIX>/DATABASE
base path of installed packages database. The database is saved in both pickled and textual format respectively in files <DB>.ozf and <DB>.txt

Help

ozmake --help
-h, --help
print this information message

Build

ozmake [--build]
build all targets
ozmake [--build] FILES...
build these target
-b, --build
this is the default. builds targets of the package
--optlevel=( none | debug | optimize )
default: optimize
select optimization level for compilation
-g, --debug, --optlevel=debug
compile with debugging
-O, --optimize, --optlevel=optimize
compile with full optimization. this is the default
--(no)gnu
is the C++ compiler the GNU compiler. this is determined automatically and allows a greater optimization level, namely passing -O3 rather than just -O to the compiler
--(no)fullbuild
default: false
also build the src targets
--includedir DIR, -I DIR
tell the C++ compiler to additionally search DIR for include files
--(no)sysincludedirs
default: true
tell the C++ compiler to additionally search (or not, if using --nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private ~/.oz area.
--librarydir DIR, -L DIR
tell the C++ linker to additionally search DIR for libraries
--(no)syslibrarydirs
default: true
tell the C++ linker to additionally search (or not, if using --nosyslibrarydirs) the Mozart-specific library directories located in the global installation directory and in the user's private ~/.oz area.

Install

ozmake --install
install using the makefile
ozmake --install FILES...
install these targets using the makefile
ozmake --install --package=PKG
install package PKG
-i, --install
install targets of the package and updates the package database
--grade=( none | same | up | down | any | freshen )
default: none
what to do if this package is already installed? ozmake will compare version and dates, where the version is more significant.
--grade=none
signals an error
--grade=same
requires versions and dates to be the same
--grade=up
requires a package with newer version or same version and newer release date than the one installed
--grade=down
requires a package with older version or same version and older release date than the one installed
--grade=any
no conditions
--grade=freshen
install if the package is newer else do nothing
-U, --upgrade
equivalent to --install --grade=up
--downgrade
equivalent to --install --grade=down
-A, --anygrade
equivalent to --install --grade=any
-F, --freshen
equivalent to --install --grade=freshen
--(no)replacefiles
default: false
allow installation to overwrite files from other packages
-R, --replace
equivalent to --install --grade=any --replacefiles
--(no)extendpackage
default: false
whether to replace or extend the current installation of this package if any
-X, --extend
equivalent to --install --grade=any --extendpackage
--(no)savedb
default: true
save the updated database after installation
--includedocs, --excludedocs
default: --includedocs
whether to install the doc targets
--includelibs, --excludelibs
default: --includelibs
whether to install the lib targets
--includebins, --excludebins
default: --includebins
whether to install the bin targets
--(no)keepzombies
default: false
whether to remove files left over from a previous installation of this package
--exe=( default | yes | no | both | multi )
default: default
the convention on Windows is that executables have a .exe, while on Unix they have no extension. The --exe option allows you to control the conventions used by ozmake when installing executables.
--exe=default
use the platform's convention
--exe=yes
use a .exe extension
--exe=no
use no extension
--exe=both
install all executables with .exe extension and without
--exe=multi
install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension

Uninstall

ozmake --uninstall
uninstall package described by makefile
ozmake --uninstall --package=PKG
uninstall package named by mogul id PKG
-e, --uninstall
uninstall a package

Clean

ozmake --clean
ozmake --veryclean
default glob patterns: *~ *.ozf *.o *.so-* *.exe
remove files as specified by the makefile's clean and veryclean features. --veryclean implies --clean.

Create

ozmake --create [--package=<FILE>]
create a package and save it in <FILE>. the files needed for the package are automatically computed from the makefile. If --package=<FILE> is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile.
--include(bins|libs|docs), --exclude(bins|libs|docs)
control which target types are included in the package

Publish

ozmake --publish
automatically takes care of all the steps necessary for creating/updating a package contributed by the user and making all necessary data available to the MOGUL librarian. See documentation for --mogul below.

Extract

ozmake --extract --package=<PKG>
extract the files from file or URL PKG. if <PKG> is a mogul id, then the package is automatically downloaded from the mogul archive

List

ozmake --list
list info for all packages in the installed package database
ozmake --list --package=<MOGUL>
list info for the installed package identified by mogul id <MOGUL>
--linewidth=N
default: 70
assume a line with of N characters

Config

ozmake --config=put <OPTIONS>
record the given <OPTIONS> in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overridden on the command line. For example: ozmake --config=put --prefix=/usr/local/oz saves /usr/local/oz as the default value for option --prefix
ozmake --config=delete <OPT1> ... <OPTn>
deletes some entries from the configuration database. For example: ozmake --config=delete prefix removes the default for --prefix from the configuration database
ozmake --config=list
lists the contents of ozmake's configuration database

the argument to --config can be abbreviated to any non-ambiguous prefix

Mogul

If you choose to contribute packages to the MOGUL archive, ozmake --mogul=<ACTION> simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simplest way is to use ozmake --publish which will take take care of all details for you.

ozmake --mogul=put
update the user's database of own mogul contributions with the data for this contribution (in local directory)
ozmake --mogul=put --package=<PKG>
same as above, but using the package <PKG> explicitly given
ozmake --mogul=delete <MOG1> ... <MOGn>
remove the entries with mogul ids <MOG1> through <MOGn> from the user's database of own contribution
ozmake --mogul=delete
remove entry for current contribution
ozmake --mogul=list
show the recorded data for all entries in the user's database of own mogul contributions
ozmake --mogul=list <MOG1> ... <MOGn>
show the recorded data for entries <MOG1> through <MOGn> in the user's database of own mogul contributions
ozmake --mogul=export
write all necessary mogul entries for the user's own mogul contributions. These are the entries which will be read by the MOGUL librarian to automatically assemble the full MOGUL database.

The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, these directories must also be available through URLs on the WEB. Here are some options that allow you to control this correspondence, and for which you should set default using ozmake --config=put

--moguldir=<MOGULDIR>
--mogulurl=<MOGULURL>
<MOGULDIR> is a directory which is also available on the WEB through url <MOGULURL>. <MOGULDIR> is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found.

For those who really enjoy pain, ozmake has of course many options to shoot yourself in the foot. In the options below <ID> stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below:

--mogulpkgdir=<MOGULPKGDIR>
default: <MOGULDIR>/pkg/<ID>/
--mogulpkgurl=<MOGULPKGURL>
default: <MOGULURL>/pkg/<ID>/
--moguldocdir=<MOGULDOCDIR>
default: <MOGULDIR>/doc/<ID>/
--moguldocurl=<MOGULDOCURL>
default: <MOGULURL>/doc/<ID>/
--moguldbdir=<MOGULDBDIR>
default: <MOGULDIR>/db/<ID>/
--moguldburl=<MOGULDBURL>
default: <MOGULURL>/db/<ID>/

Your contributions should all have mogul ids which are below the mogul id which you where granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell ozmake about it using:

--mogulrootid=<ROOTID>

and to set it using ozmake --config=put --mogulrootid=<ROOTID>

MAKEFILE

The makefile contains a single Oz record which describes the project and should normally be placed in a file called makefile.oz. A makefile typically looks like this:

        makefile(
          lib : ['Foo.ozf']
          uri : 'x-ozlib://mylib'
          mogul : 'mogul:/denys/lib-foo')

stating explicitly that there is one library target, namely the functor Foo.ozf, and that it should installed at URI:

        x-ozlib://mylib/Foo.ozf

and implicitly that it should be compiled from the Oz source file Foo.oz. When you invoke ozmake --install, the mogul feature serves to uniquely identify this package and the files it contributes in the ozmake database of installed packages.

There are many more features which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as files, should be given as virtual string; atoms are recommended except for features blurb, info_text and info_html, where strings are recommended.

        makefile(
          bin      : [ FILES... ]
          lib      : [ FILES... ]
          doc      : [ FILES... ]
          src      : [ FILES... ]
          depends  :
             o( FILE : [ FILES... ]
                ...
              )
          rules    :
             o( FILE : TOOL(FILE)
                ...
              )
          clean     : [ GLOB... ]
          veryclean : [ GLOB... ]
          uri       : URI
          mogul     : MOGUL
          author    : [ AUTHORS... ]
          released  : DATE
          blurb     : TEXT
          info_text : TEXT
          info_html : TEXT
          subdirs   : [ DIRS... ]
          requires  : [ MOGUL... ]
          categories: [ CATEGORY... ]
          version   : VERSION
          provides  : [ FILES... ]
        )

Features bin, lib and doc list targets to be installed in <BINDIR>, <LIBDIR> and <DOCDIR> respectively. bin targets should be executable functors, i.e. they should end with extension .exe. lib targets are typically compiled functors i.e. ending with extension .ozf, but could also be native functors, i.e. ending with extension .so, or simply data files. doc targets are documentation files.

Extensions

ozmake knows how to build targets by looking at the target's extension:

Foo.exe
is an executable functor and is created from Foo.ozf
Foo.ozf
is a compiled functor and is created from Foo.oz
Foo.o
is a compiled C++ file and is created from Foo.cc
Foo.so
is a native functor and is created from Foo.o
Foo.cc
is a C++ source file
Foo.hh
is a C++ header file

Note that these are abstract targets. In particular, Foo.so really denotes the file Foo.so-<PLATFORM> where <PLATFORM> identifies the architecture and operating system where the package is built; for example: linux-i486. Also, when a bin target Foo.exe is installed, it is installed both as <BINDIR>/Foo.exe and <BINDIR>/Foo so that it can be invoked as Foo on both Windows and Unix platforms.

It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions.

Rules

ozmake has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature rule which contains a record mapping target to rule:

        TARGET_FILE : TOOL(SOURCE_FILE)

the rule may also have a list of options:

        TARGET_FILE : TOOL(SOURCE_FILE OPTIONS)

The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are:

        'Foo.exe' : ozl('Foo.ozf' [executable])
        'Foo.ozf' : ozc('Foo.oz')
        'Foo.o'   : cc('Foo.cc')
        'Foo.so'  : ld('Foo.o')

The tools support the following options:

ozc
executable
make the result executable
'define'(S)
define macro S. Same as -DS on the command line
ozl
executable
make the result executable
cc
include(DIR)
Similar to the usual C++ compiler option -IDIR. DIR is a virtual string
'define'(MAC)
Similar to the usual C++ compiler option -DMAC. MAC is a virtual string
ld
library(DIR)
Similar to the usual C++ linker option -lDIR. DIR is a virtual string

You might want to specify a rule to create a pre-linked library:

        'Utils.ozf' : ozl('Foo.ozf')

or to create a non-prelinked executable:

        'Foo.exe' : ozc('Foo.oz' [executable])

Dependencies

ozmake automatically determines whether targets needed to be rebuilt, e.g. because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient e.g. because you use tool ozl (dependencies on imports), or \insert in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature depends which is a record mapping targets to list of dependencies:

        TARGET : [ FILES... ]

For example:

        'Foo.o' : [ 'Foo.hh' 'Baz.hh' ]

or

        'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ]

Cleaning

During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by ozmake --clean and ozmake --veryclean; the latter also implies the former. Files to be removed are specified by glob patterns where ? matches any 1 character and * matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but you can override them with features clean and veryclean which should be lists of glob patterns. For example the default clean glob patterns are:

        clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ]

Package Related Features

uri

feature uri indicates the URI where to install lib targets. For example:

        uri : 'x-ozlib://mylib/XML'

states that all lib targets (e.g. Foo.ozf) will be installed under this URI so that they can also be imported from it, i.e.:

       import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf'

mogul

feature mogul is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documentation files.

author

feature author is a virtual string or list of virtual string resp. identifying the author or authors of the package. It is recommended to identify authors by their mogul id, however is is also possible to simply give their names. For example, the recommended way is:

        author : 'mogul:/duchier'

but the following is also possible:

        author : 'Denys Duchier'

released

feature released is a virtual string specifying the date and time of release in the following format:

        released : "YYYY-MM-DD-HH:MM:SS"

time is optional. An appropriate release date using the current date and time is automatically inserted when invoking ozmake --create or ozmake --publish.

blurb

feature blurb contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the mogul archive.

info_text

feature info_text contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package.

info_html

feature info_html is similar to info_text but contains HTML rather than plain text.

src

feature src indicates which targets should be considered source, i.e. in particular non-buildable. All targets mentioned in src should be mentioned in bin, lib, or doc too. The point of src is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing pre-built Oz libraries. For example:

        makefile(
          lib : [ 'Foo.ozf' ]
          src : [ 'Foo.ozf' ]
          uri : 'x-ozlib://mylib'
          mogul : 'mogul:/myname/foolib')

is a makefile for a package that distribute the pre-compiled Foo.ozf, but does not also distribute its source Foo.oz. Normally, when you build a package it simply checks that the src files are present but will not attempt to build them. If you have the sources, you can force building the src targets if necessary using --fullbuild.

subdirs

feature subdirs is a list of bare filenames representing subdirectories of the project. By default, when necessary, ozmake will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The mogul id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus sub-makefiles can be simpler since they don't need to be concerned with package-level features.

requires

feature requires is a list of module URIs or package MOGUL ids. These represent the external dependencies of the package. They are not yet used, but eventually ozmake will be able to use them to automate the recursive installation of other packages required by the one you are interested in.

categories

feature categories is a list of MOGUL categories to help categorize this package in the MOGUL archive.

version

feature version is used to provide a version string. This is a string that consist of integers separated by single dots, e.g. "2" or "3.1.7".

provides

feature provides is used to override the default information about what the package provides, normally automatically computed from the bin and lib targets: it should be a list which contains a subset of these targets. The provides feature of a makefile does not override or otherwise affect its sub-makefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add:

        provides : nil
You should use the provides feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package.

CONTACTS

Authors should really be referred to by mogul ids denoting mogul entries that describe them. In order to make this easier, a makefile.oz may also contain a contact feature which is either a record describing a person, or a list of such records.

You should not have a contact feature in every makefile. Rather, the contact feature is usually intended for makefiles that only have a contact feature, i.e. whose only purpose is to create mogul entries for the corresponding persons. Here is an example of such a makefile:

        makefile(
           contact :
              o(
                 mogul : 'mogul:/duchier/denys'
                 name  : 'Denys Duchier'
                 email : 'duchier@ps.uni-sb.de'
                 www   : 'http://www.ps.uni-sb.de/~duchier/'))

You can invoke ozmake --publish on such a makefile to contribute the corresponding mogul database entries


Denys Duchier
mozart-stdlib-20060615/mozart-stdlib/ozmake/install-sh0000755000175000017500000000011607273236013022170 0ustar kevingkeving#! /bin/sh echo "install-sh is obsolete use ozinstall instead" 1>&2 exit 1 mozart-stdlib-20060615/mozart-stdlib/ozmake/makefile.oz0000644000175000017500000000315110053473224022312 0ustar kevingkevingmakefile( uri : 'x-oz://system/tool' % mogul : 'mogul:/duchier/ozmake' mogul : 'mogul:/mozart/ozmake' author: 'mogul:/duchier/denys' lib : ['ozmake.ozf'] bin : ['ozmake.exe'] doc : ['index.html' 'CHANGES'] rules : o( 'ozmake.ozf' : ozl('Main.ozf') 'ozmake.exe' : ozl('ozmake.ozf' [executable])) depends : o( 'ozmake.ozf' : ['Main.ozf' 'Utils.ozf' 'Path.ozf' 'Shell.ozf' 'Executor.ozf' 'Attribs.ozf' 'Builder.ozf' 'Makefiler.ozf' 'Manager.ozf' 'Installer.ozf' 'Database.ozf' 'Cleaner.ozf' 'Creator.ozf' 'Extractor.ozf' 'Lister.ozf' 'Help.ozf' 'Uninstaller.ozf' 'Errors.ozf' 'Windows.ozf' 'MakeGUI.ozf' 'Fixes.ozf' 'DatabaseLib.ozf' 'Config.ozf' 'Mogul.ozf' 'Pickler.ozf' 'ExecutorFast.ozf' 'Depends.ozf' 'Requires.ozf'] 'Help.ozf' : ['Utils.ozf' 'Path.ozf' 'Windows.ozf' 'Shell.ozf' 'HELP.txt']) blurb : "a tool for project building and package management" categories : [tool] version: "0.90" info_html: '

ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler and specialized for Mozart-based software development and deployment. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface. Precompiled versions for both Unix and Windows can be downloaded from the documentation page

') mozart-stdlib-20060615/mozart-stdlib/ozmake/ozinstall0000755000175000017500000001444207273236013022140 0ustar kevingkeving#! /bin/sh # Copyright (c) Feb 2000, by Denys Duchier, Universitaet des Saarlandes # # ozinstall is a shell script to install files and directories. It is # hopefully written in pure sh and thus should be maximally portable. # It assumes the existence of cp, mkdir, chmod, and chgrp, and further # assumes that cp supports the -f flag (force). ozinstall makes it # unnecessary to fight incompatible install programs and covers # concisely all the cases useful for Mozart packages. An `install' # script must in any case be included in any distributed package to # permit installation on machines which do not have an install program. # We might as well always use ozinstall. # # One feature of ozinstall is that it will create the destination # directory structure. This greatly simplifies Makefiles since no # rules are necessary to create installation directories. # # SYNOPSIS # # ozinstall OPTIONS -d DIR # # if directory DIR is not present, it is installed # # ozinstall OPTIONS [-f|-x|-M] SRCFILE DSTFILE # ozinstall OPTIONS [-f|-x|-M] SRCFILE DSTDIR/ # ozinstall OPTIONS [-f|-x|-M] SRCFILE -d DSTDIR # # SRCFILE is installed as DSTFILE. If the directory of # DSTFILE does not exist yet, it is also installed. -f # installs a regular data file, -x installs an executable # file, and -M decides which of -f or -x to use based on # whether the file to install is executable or not. # # OPTIONS # # -g GROUP set group (--group) # -m MODE set mode (--mode) # # ENVIRONMENT VARIABLES # # OZSKEL_MODE_DIR default mode for directories # OZSKEL_MODE_FILE default mode for data files # OZSKEL_MODE_BIN default mode for executable files # OZSKEL_GROUP default group PGM="ozinstall" defaultIFS=' ' IFS="${IFS:-${defaultIFS}}" explode() { tmp=`echo "$1" | sed -e 's@/@%@g' -e 's@^%@/@'` echo "$tmp%O_Z_S_K_E_L" } basename() { tmp=`explode "$1"` last= oIFS="$IFS" IFS='%' for x in $tmp; do if test "$x" = O_Z_S_K_E_L; then break; else last="$x"; fi done IFS="$oIFS" echo "$last" } dirname() { tmp=`explode "$1"` sofar= last= oIFS="$IFS" IFS='%' for x in $tmp; do if test "$x" = O_Z_S_K_E_L; then break; else sofar="$sofar${sofar:+/}$last" last="$x" fi done IFS="$oIFS" echo "$sofar" } isslashed() { tmp=`basename "$1"` test -z "$tmp" } VERBOSE= trace() { test -n "$VERBOSE" && echo "$1" 1>&2 } error() { echo "$PGM: $1" 1>&2 exit 1 } : ${OZSKEL_MODE_DIR:=775} : ${OZSKEL_MODE_FILE:=444} : ${OZSKEL_MODE_BIN:=555} OZSKEL_GROUP= OZSKEL_MODE= USE_MODE= USE_GROUP= installfix() { if test -n "$USE_GROUP"; then trace "chgrp($USE_GROUP,$1)" chgrp "$USE_GROUP" "$1" || error "chgrp($USE_GROUP,$1) failed" fi if test -n "$USE_MODE"; then trace "chmod($USE_MODE,$1)" chmod "$USE_MODE" "$1" || error "chmod($USE_MODE,$1) failed" fi } installdir() { test -n "$1" || error "installdir($1), empty name" if test -r "$1"; then test -d "$1" || error "installdir($1), file exists" else tmp=`explode "$1"` oIFS="$IFS" IFS='%' sofar= for x in $tmp; do if test "$x" = O_Z_S_K_E_L; then break; else sofar="$sofar${sofar:+/}$x" test -d "$sofar" && continue trace "mkdir($sofar)" mkdir "$sofar" || error "mkdir($1) failed" installfix "$sofar" fi done IFS="$oIFS" fi } installfile() { test -d "$2" && error "installfile($1,$2), destination is directory" tmp=`dirname "$2"` test -d "$2" && error "installfile($1,$2), destination's directory non-existent" trace "cp($1,$2)" cp -f "$1" "$2" || error "cp($1,$2) failed" installfix "$2" } USER_MODE= USER_GROUP= USER_SRC= USER_DST= USER_ACTION= USER_DIR= VAR= OPT= VAL= for ARG do # grab argument for preceding option if test -n "$VAR"; then eval "$VAR=\$ARG" VAR= OPT= continue fi case "$ARG" in -*=*) VAL=`echo "$ARG" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) VAL= ;; esac case "$ARG" in -m=*|-mode=*|--mode=*) USER_MODE="$VAL" ;; -m|--mode) OPT="$ARG" VAR=USER_MODE ;; -g=*|-group=*|--group=*) USER_GROUP="$VAL" ;; -g|-group|--group) OPT="$ARG" VAR=USER_GROUP ;; -v|--verbose) VERBOSE=yes ;; -f|-x|-M) test -z "$USER_ACTION" || error "only one of -f,-x,-M is allowed" USER_ACTION="$ARG" ;; -d) test -z "$USER_DIR" || error "-d supplied twice" OPT="$ARG" VAR=USER_DIR ;; -*) error "invalid option $ARG" ;; *) if test -n "$USER_DST"; then error "too may arguments" elif test -n "$USER_SRC"; then USER_DST="$ARG" else USER_SRC="$ARG" fi ;; esac done # check if we were expecting to grab an option's argument test -z "$VAR" || error "missing argument for $OPT" # we cannot allow both `-d DIR' and `DSTFILE' if test -n "$USER_DST" && test -n "$USER_DIR"; then error "it is illegal to supply both -d dir and destination arg" fi # for convenience strip off the slash in `-d DIR/' if test -n "$USER_DIR" && isslashed "$USER_DIR"; then USER_DIR=`dirname "$USER_DIR"` fi # if no action specified: if SRC was supplied, then assume `-f' # else if `-d DIR' was supplied, use `-d', else its an error. if test -z "$USER_ACTION"; then if test -n "$USER_SRC"; then USER_ACTION="-f" elif test -n "$USER_DIR"; then USER_ACTION="-d" else error "too few arguments" fi fi if test -n "$USER_SRC"; then test -r "$USER_SRC" || error "source file non-existent" fi case "$USER_ACTION" in -f|-x|-M) test -n "$USER_SRC" || error "source file argument missing" if test -n "$USER_DIR"; then tmp=`basename "$USER_SRC"` USER_DST="$USER_DIR/$tmp" elif test -n "$USER_DST"; then if isslashed "$USER_DST"; then tmp=`basename "$USER_SRC"` USER_DST="${USER_DST}$tmp" fi else error "no destination specified" fi USE_MODE="${OZSKEL_MODE_DIR}" USE_GROUP="$USER_GROUP" tmp=`dirname "$USER_DST"` test -n "$tmp" && installdir "$tmp" if test -z "$USER_MODE"; then case "$USER_ACTION" in -f) USER_MODE="$OZSKEL_MODE_FILE" ;; -x) USER_MODE="$OZSKEL_MODE_BIN" ;; -M) if test -x "$USER_SRC"; then USER_MODE="$OZSKEL_MODE_BIN" else USER_MODE="$OZSKEL_MODE_FILE" fi ;; esac fi USE_MODE="${USER_MODE}" installfile "$USER_SRC" "$USER_DST" ;; -d) USE_MODE="${USER_MODE:-$OZSKEL_MODE_DIR}" USE_GROUP="$USER_GROUP" installdir "$USER_DIR" ;; esac exit 0 mozart-stdlib-20060615/mozart-stdlib/ozmake/ozmake.10000644000175000017500000007112310250330401021523 0ustar kevingkeving.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH OZMAKE 1 "June 3, 2005" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME Ozmake \- Make for Oz .SH SYNOPSIS \fBozmake --help\fR .br \fBozmake [--build] [TARGETS...]\fR .br \fBozmake --install [TARGETS...]\fR .br \fBozmake --install [--package=PKG]\fR .br \fBozmake --uninstall [--package=PKG]\fR .br \fBozmake --clean\fR .br \fBozmake --veryclean\fR .br \fBozmake --create [--package=FILE]\fR .br \fBozmake --publish\fR .br \fBozmake --extract [--package=PKG]\fR .br \fBozmake --list [--package=MOGUL]\fR .br \fBozmake --config=(put|delete|list) ...\fR .br \fBozmake --mogul=(put|delete|list|export) ...\fR .br .SH DESCRIPTION \fBozmake OPTIONS TARGETS\fR .br .P \fBozmake\fP is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools \fBmake\fP and \fBrpm\fP,but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. \fBozmake\fP must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface. .SH OPTIONS .P In the following, we write meta variables between angle brackets, e.g. \fI\fR or \fI\fR .SS General Options .TP .SM -v --verbose .br print out more tracing information that the default. By supplying this option twice, you will sometimes get even more information. .TP .SM -q --quiet .br suppress all tracing and feedback information .TP .SM -n --just-print .br perform a dry run, i.e. just print what would happen without actually performing the actions .TP .SM --local .br do not recurse into subdirectories .TP .SM --(no)autodepend .br \fBdefault:\fP true .br automatically determine build-time and install-time (run-time) dependencies. Currently, this is only supported for Oz sources by looking at import and require sections. .TP .SM --(no)requires .br \fBdefault:\fP true .br automatically fetch and install other packages that the current one requires. This option is relevant both for building and for installing. .P What you should remember here, is that \fB-vn\fR is your friend. Add \fB-vn\fR at the end of any \fBozmake\fP invocation, and it will tell you in great detail what the command would do, without actually doing it. .SS Directories and URLs .TP .SM --prefix=\fI\fP .br \fBdefault:\fP ~/.oz .br root of private installation area .TP .SM --dir=\fI\fP .br \fBdefault:\fP current directory .br default directory for other options below .TP .SM --builddir=\fI\fP .br \fBdefault:\fP \fI\fP .br directory in which to build .TP .SM --srcdir=\fI\fP .br \fBdefault:\fP \fI\fP .br directory where source files are located .TP .SM --bindir=\fI\fP .br \fBdefault:\fP \fI\fP/bin .br directory where bin targets are placed .TP .SM --libroot=\fI\fP .br \fBdefault:\fP \fI\fP/cache .br root directory of cache into which lib targets are installed .TP .SM --libdir=\fI\fP .br \fBdefault:\fP \fI\fP/\fI\fP .br directory into which lib targets are installed .TP .SM --docroot=\fI\fP .br \fBdefault:\fP \fI\fP/doc .br root directory into which doc targets are installed .TP .SM --docdir=\fI\fP .br \fBdefault:\fP \fI\fP/\fI\fP .br directory into which doc targets are installed .TP .SM --extractdir=\fI\fP .br \fBdefault:\fP \fI\fP .br directory into which to extract a package .TP .SM --archive=\fI\fP .br \fBdefault:\fP http://www.mozart-oz.org/mogul/pkg .br URL of mogul archive from which packages can be downloaded .TP .SM --moguldir=\fI\fP .br directory in which are placed sub-directories for the user's contributions: a directory for packages, one for documentation, one for mogul database entries. .TP .SM --mogulurl=\fI\fP .br url corresponding to the MOGULDIR directory .SS Files .TP .SM -m \fI\fP --makefile=\fI\fP .br \fBdefault:\fP \fI\fP/makefile.oz .br location of makefile .TP .SM -p \fI\fP --package=\fI\fP .br file or URL of package. when creating a package, it should be a local filename. when extracting or installing, it can also be a URL or a mogul id; in the latter case, the package is automatically downloaded from the mogul archive .TP .SM -V \fI\fP --packageversion=\fI\fP .br this option is respected by \fB--extract\fR and \fB--install\fR .When \fB--extract\fR is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given VERSION of the package. \fB--install\fR will simply check that the package to be installed really has this VERSION. .TP .SM --database=\fI\fP .br \fBdefault:\fP \fI\fP/DATABASE .br base path of installed packages database. The database is saved in both pickled and textual format respectively in files DB.ozf and DB.txt .SS Help \fBozmake --help\fR .br .TP .SM -h --help .br print this information message .SS Build \fBozmake [--build]\fR .br .RS build all targets .RE \fBozmake [--build] FILES...\fR .br .RS build these target .RE .TP .SM -b --build .br this is the default. builds targets of the package .TP .SM --optlevel=( none | debug | optimize ) .br \fBdefault:\fP optimize .br select optimization level for compilation .TP .SM -g --debug --optlevel=debug .br compile with debugging .TP .SM -O --optimize --optlevel=optimize .br compile with full optimization. this is the default .TP .SM --(no)gnu .br is the C++ compiler the GNU compiler. this is determined automatically and allows a greater optimization level, namely passing \fB-O3\fR rather than just \fB-O\fR to the compiler .TP .SM --(no)fullbuild .br \fBdefault:\fP false .br also build the src targets .TP .SM --includedir DIR -I DIR .br tell the C++ compiler to additionally search DIR for include files .TP .SM --(no)sysincludedirs .br \fBdefault:\fP true .br tell the C++ compiler to additionally search (or not, if using \fB--nosysincludedirs\fR )the Mozart-specific include directories located in the global installation directory and in the user's private ~/.oz area. .TP .SM --librarydir DIR -L DIR .br tell the C++ linker to additionally search DIR for libraries .TP .SM --(no)syslibrarydirs .br \fBdefault:\fP true .br tell the C++ linker to additionally search (or not, if using \fB--nosyslibrarydirs\fR )the Mozart-specific library directories located in the global installation directory and in the user's private ~/.oz area. .SS Install \fBozmake --install\fR .br .RS install using the makefile .RE \fBozmake --install FILES...\fR .br .RS install these targets using the makefile .RE \fBozmake --install --package=PKG\fR .br .RS install package \fBPKG\fR .RE .TP .SM -i --install .br install targets of the package and updates the package database .TP .SM --grade=( none | same | up | down | any | freshen ) .br \fBdefault:\fP none .br what to do if this package is already installed? ozmake will compare version and dates, where the version is more significant. \fB--grade=none\fR signals an error \fB--grade=same\fR requires versions and dates to be the same \fB--grade=up\fR requires a package with newer version or same version and newer release date than the one installed \fB--grade=down\fR requires a package with older version or same version and older release date than the one installed \fB--grade=any\fR no conditions \fB--grade=freshen\fR install if the package is newer else do nothing .TP .SM -U --upgrade .br equivalent to \fB--install --grade=up\fR .TP .SM --downgrade .br equivalent to \fB--install --grade=down\fR .TP .SM -A --anygrade .br equivalent to \fB--install --grade=any\fR .TP .SM -F --freshen .br equivalent to \fB--install --grade=freshen\fR .TP .SM --(no)replacefiles .br \fBdefault:\fP false .br allow installation to overwrite files from other packages .TP .SM -R --replace .br equivalent to \fB--install --grade=any --replacefiles\fR .TP .SM --(no)extendpackage .br \fBdefault:\fP false .br whether to replace or extend the current installation of this package if any .TP .SM -X --extend .br equivalent to \fB--install --grade=any --extendpackage\fR .TP .SM --(no)savedb .br \fBdefault:\fP true .br save the updated database after installation .TP .SM --includedocs --excludedocs .br \fBdefault:\fP --includedocs .br whether to install the doc targets .TP .SM --includelibs --excludelibs .br \fBdefault:\fP --includelibs .br whether to install the lib targets .TP .SM --includebins --excludebins .br \fBdefault:\fP --includebins .br whether to install the bin targets .TP .SM --(no)keepzombies .br \fBdefault:\fP false .br whether to remove files left over from a previous installation of this package .TP .SM --exe=( default | yes | no | both | multi ) .br \fBdefault:\fP default .br the convention on Windows is that executables have a .exe,while on Unix they have no extension. The \fB--exe\fR option allows you to control the conventions used by ozmake when installing executables. \fB--exe=default\fR use the platform's convention \fB--exe=yes\fR use a .exe extension \fB--exe=no\fR use no extension \fB--exe=both\fR install all executables with .exe extension and without \fB--exe=multi\fR install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension .SS Uninstall \fBozmake --uninstall\fR .br .RS uninstall package described by makefile .RE \fBozmake --uninstall --package=PKG\fR .br .RS uninstall package named by mogul id \fBPKG\fR .RE .TP .SM -e --uninstall .br uninstall a package .SS Clean \fBozmake --clean\fR .br \fBozmake --veryclean\fR .br *~ *.ozf *.o *.so-* *.exe .RS remove files as specified by the makefile's clean and veryclean features. \fB--veryclean\fR implies \fB--clean\fR . .RE .SS Create \fBozmake --create [--package=\fI\fR]\fR .br .RS create a package and save it in FILE.the files needed for the package are automatically computed from the makefile. If \fB--package=\fI\fR\fR is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile. .RE .TP .SM --include(bins|libs|docs) --exclude(bins|libs|docs) .br control which target types are included in the package .SS Publish \fBozmake --publish\fR .br .RS automatically takes care of all the steps necessary for creating/updating a package contributed by the user and making all necessary data available to the MOGUL librarian. See documentation for \fB--mogul\fR below. .RE .SS Extract \fBozmake --extract --package=\fI\fR\fR .br .RS extract the files from file or URL PKG.if PKG is a mogul id, then the package is automatically downloaded from the mogul archive .RE .SS List \fBozmake --list\fR .br .RS list info for all packages in the installed package database .RE \fBozmake --list --package=\fI\fR\fR .br .RS list info for the installed package identified by mogul id MOGUL .RE .TP .SM --linewidth=N .br \fBdefault:\fP 70 .br assume a line with of \fBN\fR characters .SS Config \fBozmake --config=put \fI\fR\fR .br .RS record the given OPTIONS in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overridden on the command line. For example: \fBozmake --config=put --prefix=/usr/local/oz\fR saves /usr/local/oz as the default value for option \fB--prefix\fR .RE \fBozmake --config=delete \fI\fR ... \fI\fR\fR .br .RS deletes some entries from the configuration database. For example: \fBozmake --config=delete prefix\fR removes the default for \fB--prefix\fR from the configuration database .RE \fBozmake --config=list\fR .br .RS lists the contents of ozmake's configuration database .RE .P the argument to \fB--config\fR can be abbreviated to any non-ambiguous prefix .SS Mogul .P If you choose to contribute packages to the MOGUL archive, \fBozmake --mogul=\fI\fR\fR simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simplest way is to use \fBozmake --publish\fR which will take take care of all details for you. \fBozmake --mogul=put\fR .br .RS update the user's database of own mogul contributions with the data for this contribution (in local directory) .RE \fBozmake --mogul=put --package=\fI\fR\fR .br .RS same as above, but using the package PKG explicitly given .RE \fBozmake --mogul=delete \fI\fR ... \fI\fR\fR .br .RS remove the entries with mogul ids MOG1 through MOGn from the user's database of own contribution .RE \fBozmake --mogul=delete\fR .br .RS remove entry for current contribution .RE \fBozmake --mogul=list\fR .br .RS show the recorded data for all entries in the user's database of own mogul contributions .RE \fBozmake --mogul=list \fI\fR ... \fI\fR\fR .br .RS show the recorded data for entries MOG1 through MOGn in the user's database of own mogul contributions .RE \fBozmake --mogul=export\fR .br .RS write all necessary mogul entries for the user's own mogul contributions. These are the entries which will be read by the MOGUL librarian to automatically assemble the full MOGUL database. .RE .P The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, these directories must also be available through URLs on the WEB. Here are some options that allow you to control this correspondence, and for which you should set default using \fBozmake --config=put\fR .TP .SM --moguldir=\fI\fP .br .TP .SM --mogulurl=\fI\fP .br MOGULDIR is a directory which is also available on the WEB through url MOGULURL. MOGULDIR is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found. .P For those who really enjoy pain, \fBozmake\fP has of course many options to shoot yourself in the foot. In the options below \fI\fR stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below: .TP .SM --mogulpkgdir=\fI\fP .br \fBdefault:\fP \fI\fP/pkg/\fI\fP/ .br .TP .SM --mogulpkgurl=\fI\fP .br \fBdefault:\fP \fI\fP/pkg/\fI\fP/ .br .TP .SM --moguldocdir=\fI\fP .br \fBdefault:\fP \fI\fP/doc/\fI\fP/ .br .TP .SM --moguldocurl=\fI\fP .br \fBdefault:\fP \fI\fP/doc/\fI\fP/ .br .TP .SM --moguldbdir=\fI\fP .br \fBdefault:\fP \fI\fP/db/\fI\fP/ .br .TP .SM --moguldburl=\fI\fP .br \fBdefault:\fP \fI\fP/db/\fI\fP/ .br .P Your contributions should all have mogul ids which are \fIbelow\fP the mogul id which you where granted for your section of the mogul database. For convenience, \fBozmake\fP will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell \fBozmake\fP about it using: .TP .SM --mogulrootid=\fI\fP .br .P and to set it using \fBozmake --config=put --mogulrootid=\fI\fR\fR .SH MAKEFILE .P The makefile contains a single Oz record which describes the project and should normally be placed in a file called \fImakefile.oz\fR.A makefile typically looks like this: makefile( lib : ['Foo.ozf'] uri : 'x-ozlib://mylib' mogul : 'mogul:/denys/lib-foo') .P stating explicitly that there is one library target, namely the functor \fIFoo.ozf\fR,and that it should installed at URI: x-ozlib://mylib/Foo.ozf .P and implicitly that it should be compiled from the Oz source file \fIFoo.oz\fR.When you invoke \fBozmake --install\fR,the \fBmogul\fP feature serves to uniquely identify this package and the files it contributes in the \fBozmake\fP database of installed packages. .P There are many more features which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as \fBfiles\fP,should be given as virtual string; atoms are recommended except for features \fBblurb\fP, \fBinfo_text\fP and \fBinfo_html\fP,where strings are recommended. makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( FILE : [ FILES... ] ... ) rules : o( FILE : TOOL(FILE) ... ) clean : [ GLOB... ] veryclean : [ GLOB... ] uri : URI mogul : MOGUL author : [ AUTHORS... ] released : DATE blurb : TEXT info_text : TEXT info_html : TEXT subdirs : [ DIRS... ] requires : [ MOGUL... ] categories: [ CATEGORY... ] version : VERSION provides : [ FILES... ] ) .P Features bin, lib and doc list targets to be installed in \fI\fR, \fI\fR and \fI\fR respectively. \fBbin\fP targets should be executable functors, i.e. they should end with extension \fI.exe\fR. \fBlib\fP targets are typically compiled functors i.e. ending with extension \fI.ozf\fR,but could also be native functors, i.e. ending with extension \fI.so\fR,or simply data files. \fBdoc\fP targets are documentation files. .SS Extensions .P \fBozmake\fP knows how to build targets by looking at the target's extension: .P \fIFoo.exe\fR .IP is an executable functor and is created from \fIFoo.ozf\fR .P \fIFoo.ozf\fR .IP is a compiled functor and is created from \fIFoo.oz\fR .P \fIFoo.o\fR .IP is a compiled C++ file and is created from \fIFoo.cc\fR .P \fIFoo.so\fR .IP is a native functor and is created from \fIFoo.o\fR .P \fIFoo.cc\fR .IP is a C++ source file .P \fIFoo.hh\fR .IP is a C++ header file .P Note that these are \fIabstract\fP targets. In particular, \fIFoo.so\fR really denotes the file \fIFoo.so-\fI\fR\fR where \fI\fR identifies the architecture and operating system where the package is built; for example: \fIlinux-i486\fR.Also, when a bin target \fIFoo.exe\fR is installed, it is installed both as \fI\fI\fR/Foo.exe\fR and \fI\fI\fR/Foo\fR so that it can be invoked as \fIFoo\fR on both Windows and Unix platforms. .P It is imperative that you respect the conventional use of extensions described here: \fBozmake\fP permits no variation and supports no other extensions. .SS Rules .P \fBozmake\fP has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature \fBrule\fP which contains a record mapping target to rule: TARGET_FILE : TOOL(SOURCE_FILE) .P the rule may also have a list of options: TARGET_FILE : TOOL(SOURCE_FILE OPTIONS) .P The tools supported by \fBozmake\fP are \fBozc\fP (Oz compiler), \fBozl\fP (Oz linker), \fBcc\fP (C++ compiler), \fBld\fP (C++ linker). The default rules are: 'Foo.exe' : ozl('Foo.ozf' [executable]) 'Foo.ozf' : ozc('Foo.oz') 'Foo.o' : cc('Foo.cc') 'Foo.so' : ld('Foo.o') .P The tools support the following options: .P \fBozc\fP .IP .P \fBexecutable\fP .IP make the result executable .P \fB'define'(S)\fP .IP define macro \fBS\fP.Same as -D\fBS\fP on the command line .P \fBozl\fP .IP .P \fBexecutable\fP .IP make the result executable .P \fBcc\fP .IP .P \fBinclude(DIR)\fP .IP Similar to the usual C++ compiler option \fB-IDIR\fP. \fBDIR\fP is a virtual string .P \fB'define'(MAC)\fP .IP Similar to the usual C++ compiler option \fB-DMAC\fP. \fBMAC\fP is a virtual string .P \fBld\fP .IP .P \fBlibrary(DIR)\fP .IP Similar to the usual C++ linker option \fB-lDIR\fP. \fBDIR\fP is a virtual string .P You might want to specify a rule to create a pre-linked library: 'Utils.ozf' : ozl('Foo.ozf') .P or to create a non-prelinked executable: 'Foo.exe' : ozc('Foo.oz' [executable]) .SS Dependencies .P \fBozmake\fP automatically determines whether targets needed to be rebuilt, e.g. because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient e.g. because you use tool \fBozl\fP (dependencies on imports), or \fB\insert\fP in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature \fBdepends\fP which is a record mapping targets to list of dependencies: TARGET : [ FILES... ] .P For example: 'Foo.o' : [ 'Foo.hh' 'Baz.hh' ] .P or 'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ] .SS Cleaning .P During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by \fBozmake --clean\fR and \fBozmake --veryclean\fR;the latter also implies the former. Files to be removed are specified by \fIglob\fP patterns where \fB?\fR matches any 1 character and \fB*\fR matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but you can override them with features \fBclean\fP and \fBveryclean\fP which should be lists of glob patterns. For example the default clean glob patterns are: clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ] .SS Package Related Features .B uri .P feature \fBuri\fP indicates the URI where to install lib targets. For example: uri : 'x-ozlib://mylib/XML' .P states that all \fBlib\fP targets (e.g. \fIFoo.ozf\fR)will be installed under this URI so that they can also be imported from it, i.e.: import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf' .B mogul .P feature \fBmogul\fP is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documentation files. .B author .P feature \fBauthor\fP is a virtual string or list of virtual string resp. identifying the author or authors of the package. It is recommended to identify authors by their mogul id, however is is also possible to simply give their names. For example, the recommended way is: author : 'mogul:/duchier' .P but the following is also possible: author : 'Denys Duchier' .B released .P feature \fBreleased\fP is a virtual string specifying the date and time of release in the following format: released : "YYYY-MM-DD-HH:MM:SS" .P time is optional. An appropriate release date using the current date and time is automatically inserted when invoking \fBozmake --create\fR or \fBozmake --publish\fR.. .B blurb .P feature \fBblurb\fP contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the mogul archive. .B info_text .P feature \fBinfo_text\fP contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package. .B info_html .P feature \fBinfo_html\fP is similar to \fBinfo_text\fP but contains HTML rather than plain text. .B src .P feature \fBsrc\fP indicates which targets should be considered source, i.e. in particular non-buildable. All targets mentioned in \fBsrc\fP should be mentioned in \fBbin\fP, \fBlib\fP,or \fBdoc\fP too. The point of \fBsrc\fP is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing pre-built Oz libraries. For example: makefile( lib : [ 'Foo.ozf' ] src : [ 'Foo.ozf' ] uri : 'x-ozlib://mylib' mogul : 'mogul:/myname/foolib') .P is a makefile for a package that distribute the pre-compiled \fIFoo.ozf\fR,but does not also distribute its source \fIFoo.oz\fR.Normally, when you build a package it simply checks that the \fBsrc\fP files are present but will not attempt to build them. If you have the sources, you can force building the \fBsrc\fP targets if necessary using \fB--fullbuild\fR.. .B subdirs .P feature \fBsubdirs\fP is a list of bare filenames representing subdirectories of the project. By default, when necessary, \fBozmake\fP will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The mogul id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus sub-makefiles can be simpler since they don't need to be concerned with package-level features. .B requires .P feature \fBrequires\fP is a list of module URIs or package MOGUL ids. These represent the \fIexternal\fP dependencies of the package. They are not yet used, but eventually \fBozmake\fP will be able to use them to automate the recursive installation of other packages required by the one you are interested in. .B categories .P feature \fBcategories\fP is a list of MOGUL categories to help categorize this package in the MOGUL archive. .B version .P feature \fBversion\fP is used to provide a version string. This is a string that consist of integers separated by single dots, e.g. \fB"2"\fP or \fB"3.1.7"\fP.. .B provides .P feature \fBprovides\fP is used to override the default information about what the package provides, normally automatically computed from the \fBbin\fP and \fBlib\fP targets: it should be a list which contains a subset of these targets. The \fBprovides\fP feature of a makefile does not override or otherwise affect its sub-makefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add: provides : nil You should use the \fBprovides\fP feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as \fIprovided\fP by the package. .SH CONTACTS .P Authors should really be referred to by mogul ids denoting mogul entries that describe them. In order to make this easier, a \fImakefile.oz\fR may also contain a \fBcontact\fP feature which is either a record describing a person, or a list of such records. .P You should not have a \fBcontact\fP feature in every makefile. Rather, the \fBcontact\fP feature is usually intended for makefiles that only have a \fBcontact\fP feature, i.e. whose only purpose is to create mogul entries for the corresponding persons. Here is an example of such a makefile: makefile( contact : o( mogul : 'mogul:/duchier/denys' name : 'Denys Duchier' email : 'duchier@ps.uni-sb.de' www : 'http://www.ps.uni-sb.de/~duchier/')) .P You can invoke \fBozmake --publish\fR on such a makefile to contribute the corresponding mogul database entries .SH AUTHOR This man page has been automatically generated from the \fBozmake\fR help file. The \fBozmake\fR help file is maintained by Denys Duchier. .SH SEE ALSO Full documentation of the Mozart system and the Oz programming language is available through the the \fImozart-doc\fP package, or from the mozart web page \fIwww.mozart-oz.org\fP. See in particular the document \fIThe Oz Programming Interface\fP. .P .BR ozc (1), .BR ozd (1), .BR ozengine (1), .BR ozl (1), .BR oztool (1), .BR convertTextPickle (1). mozart-stdlib-20060615/mozart-stdlib/ozmake/ozmake.xml0000644000175000017500000012510707450346301022203 0ustar kevingkeving ozmake mogul:/duchier/ozmake 0.78 Denys Duchier duchier@ps.uni-sb.de http://www.ps.uni-sb.de/~duchier/ a tool for Mozart project building and package management ozmake ozmake for Unix | ozmake for Windows | ozmake for either

See CHANGES for a list of changes between successive versions.

USAGE

ozmake is a tool for building Mozart-based projects and for creating, installing, managing, and publishing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler and specialized for Mozart-based software development and deployment. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface.

SYNOPSIS
OPTIONS

In the following, we write meta-variables between angle brackets, e.g. PREFIX or URI as cache path

General Options

print out more information than the default. By supplying this option twice, you will in some cases get even more information

suppress all tracing and feedback information

perform a dry run, just print what would happen without actually performing the actions

do not recurse into subdirectories

What you should remember here is that -vn is your friend. Add -vn at the end of any ozmake invocation and it will tell you in great detail what the command would do, without actually doing it.

Directories and URLs

root of private installation area

default directory for other options below

directory in which to build

directory where source files are located

directory where bin targets are placed

root directory of cache into which lib targets are installed

directory into which lib targets are installed: URI = x-ozlib://foo/bar/baz URI as cache path = x-ozlib/foo/bar/baz LIBDIR = LIBROOT/x-ozlib/foo/bar/baz

root directory into which doc targets are installed

MOGUL = mogul:/aaa/bbb/ccc MOGUL as filename = aaa-bbb-ccc DOCDIR = DOCROOT/aaa-bbb-ccc

directory into which to extract a package

URL of mogul archive from which packages can be downloaded. For example: MOGUL = mogul:/aaa/bbb/ccc is downloaded from ARCHIVE/aaa/bbb/ccc/aaa-bbb-ccc.pkg

directory in which are placed sub-directories for the user's contributions: pkg for packages, doc for documentation, db for mogul database entries.

url corresponding to the MOGULDIR directory

Files

location of makefile

PKG should be either a pathname or URL, or a MOGUL id. When creating a package, it must be a local pathname. When extracting or installing, it can also be a URL or a MOGUL id. In the latter case, the package is automatically downloaded from the MOGUL archive.

this option is respected by --extract and --install. When --extract is given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given VERSION of the package. --install will simply check that the package to be installed really has this VERSION.

database of installed packages

Help

print this information message

Build

build all targets

build these targets

this is the default ozmake action. Builds targets of the package

select optimization level for compilation

compile with debugging

compile with full optimization. This is the default

is the C++ compiler the GNU compiler. This is determined automatically and allows a greater optimization level, namely passing -O3 rather than just -O to the compiler.

also build the src targets

tell the C++ compiler to additionally search DIR for include files

tell the C++ compiler to additionally search (or not, is using --nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private installation area under PREFIX/include.

tell the C++ linker to additionally search DIR for libraries

tell the C++ linker to additionally search (or not, if using --nonsyslibrarydirs) the Mozart-specific library directories located in the global installation directory and the user's private installation are under PREFIX/platform/PLATFORM/lib

Install

install using the makefile

install these targets using the makefile

install package PKG. PKG can be a package file or a MOGUL id. In the latter case, the package is automatically downloaded from the MOGUL archive

install targets of the package and update the database of installed packages

what to do if this package is already installed? ozmake will compare versions and dates, where version is more significant:

signals an error

requires versions and dates to be the same

requires a package with newer version, or same version and newer release date, than the one installed

requires a package with older version, or same version and older release date than the one installed

no conditions

install if the package is newer, else do nothing

equivalent to --install --grade=up

equivalent to --install --grade=down

equivalent to --install --grade=any

equivalent to --install --grade=freshen

allow installation to overwrite files from other packages

equivalent to --install --grade=any --replacefiles

whether to replace or extend the current installation of this package, if any

equivalent to --install --grade=any --extendpackage

whether to save the updated database of installed packages after installation

whether to install the doc targets

whether to install the lib targets

whether to install the bin targets

whether to keep (rather than remove) files left over from a previous installation of this package

the convention on Windows is that executables have a .exe extension, while on Unix they have no extension. While ozmake always builds exe targets for the current platform and places them in files with an .exe extension, the --exe option allows you to control the conventions used by ozmake when installing these executables:

use the platform's convention

use a .exe extension

use no extension

install all executables with and without the .exe extension

install executable functors for both Unix and Windows. The Unix versions are installed without extension, and the Windows versions are installed with .exe extension

Uninstall

uninstall the package described by the makefile

PKG can be either a package file or a MOGUL id. uninstall the corresponding package

uninstall a package

Clean

remove files as specified by the makefile's clean or veryclean features. --veryclean implies --clean

Create

create a package and save it in FILE. The files needed for the package are automatically computed from the makefile. If --package=FILE is not supplied, a default is computed using the MOGUL id (and possibly version number) found in the makefile

control which target types are included in the package

Publish

automatically takes care of all the steps necessary for create/updating a package contributed by the user and make all necessary data available to the MOGUL librarian. See documentation for --mogul below

Extract

extract the files from the package file or URL PKG. If PKG is a MOGUL is, then the package is automtically downloaded from the MOGUL archive

List

list info for all packages in the database of installed packages

list info for the installed package identified by MOGULID

assume a line width of N characters

Config

record the given OPTIONS in ozmake's configuration database, and use them as defaults in subsequent invocations of ozmake unless explicitly overriden on the command line. For example: ozmake --config=put --prefix=/usr/local/oz saves /usr/local/oz as the default value for option --prefix

deletes some entries from the configuration database. For example: ozmake --config=delete prefix removes the default for --prefix from the configuration database

lists the contents of ozmake's configuration database

the argument to --config can be abbreviated to any non-ambiguous prefix

Mogul

If you choose to contribute packages to the MOGUL archive, ozmake --mogul=ACTION simplifies your task. It makes it easy for you to maintain a database of your contributions and to export them so that the MOGUL librarian may automatically find them. In fact, the simples way is to use ozmake --publish which will take care of all details for you.

update the user's database of own mogul contributions with the data for this contribution (in local directory)

same as above, but using the package PKG explicitly given

remove the entries with MOGUL ids MOG1 through MOGn from the user's database of own contributions

remove entry for current contribution

show the recorded data for all entries in the user's database of own MOGUL contributions

show the recorded data for entries MOG1 through MOGn in the user's database of own MOGUL contributions

write all necessary MOGUL entries for the user's own MOGUL contributions. These are the entries that will be read by the MOGUL librarian to automtaically assemble the full MOGUL database

The data for your contributions need to be made available to the MOGUL librarian on the WEB. You want to just update a local directory with your contributions, but, in order for the MOGUL librarian to find them, this directory must also be available through a URL on the WEB. Here are some options that allow you to control this correspondance, and for which you should set defaults using ozmake --config=put

MOGULDIR is a directory which is also available on the WEB through URL MOGULURL. MOGULDIR is intended as a root directory in which sub-directories for packages, documentation, and mogul entries will be found

For those who really enjoy pain, ozmake has of course many options to shoot yourself in a wide selection of body parts. In the options below ID stands for the file name version of the package's MOGUL id (basically remove the mogul:/ prefix and replace slashes by dashes). You can exert pointless but fine control where packages, their documentation and mogul database entries are stored and made available on the WEB:

Your contributions should all have MOGUL ids which are below the MOGUL id which you were granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root MOGUL id of your section as soon as there are entries in your database of own contributions. However, it is much preferable to tell ozmake about it using:

and to set it using ozmake --config=put --mogulrootid=ROOTID

MAKEFILE

The makefile contains a single Oz record which describes the project and should normally be placed in a file called makefile.oz. A makefile typically looks like this:

makefile( lib : ['Foo.ozf'] uri : 'x-ozlib://mylib' mogul : 'mogul:/denys/lib-foo')

stating explicitly that there is one library target, namely the functor Foo.ozf, that it should be installed at URI x-ozlib://mylib/Foo.ozf, and implicitly that it should be compiled from the Oz source file Foo.oz. When you invoke ozmake --install, the mogul feature serves to uniquely identify this package and the files it contributes in ozmake's database of installed packages.

There are many more feature which can occur in the makefile and they are all optional. If you omit all the features, you only get the defaults and you don't even need a makefile. All values, such as files should be given as virtual strings (atoms are recommended).

makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( FILE : [ FILES... ] ... ) rules : o( FILE : TOOL(FILE) ... ) clean : [ GLOB... ] veryclean : [ GLOB... ] uri : URI mogul : MOGUL author : [ AUTHORS... ] released : DATE blurb : TEXT info_text : TEXT info_html : TEXT subdirs : [ DIRS... ] requires : [ MOGUL... ] categories: [ CATEGORY... ] version : VERSION provides : [ FILES... ] )

Features bin, lib and doc list targets to be installed in BINDIR, LIBDIR and DOCDIR respectively. bin targets should be executable functors, i.e. they should end with extension .exe. lib targets are typically compiled functors i.e. ending with extension .ozf, but could also be native functors, i.e. ending with extension .so, or simply data files. doc targets are documentation files.

Extensions

ozmake knows how to build targets by looking at the target's extension:

is an executable functor and is created from Foo.ozf

is a compiled functor and is created from Foo.oz

is an Oz source file

is a native functor and is created from Foo.o

is a compiled C++ file and is created from Foo.cc

is a C++ source file

is a C++ header file

Note that these are abstract targets. In particular, Foo.so really denotes the file Foo.so-PLATFORM where PLATFORM identifies the architecture and operating system where the package is built; for example: linux-i486. Also, when a bin target Foo.exe is installed, it may be installed with and/or without the .exe extension according to whether Windows or Unix conventions are followed (see option --exe).

It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions.

Rules

ozmake has built-in rules for building files. Occasionally, you may want to override the default rule for one or more targets. This is done with feature rules which contains a record mapping target to rule:

TARGET_FILE : TOOL(SOURCE_FILE)

the rule may also have a list of options:

TARGET_FILE : TOOL(SOURCE_FILE OPTIONS)

The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are:

'Foo.exe' : ozl('Foo.ozf' [executable]) 'Foo.ozf' : ozc('Foo.oz') 'Foo.o' : cc('Foo.cc') 'Foo.so' : ld('Foo.o')

The tools support the following options:

make the result executable

make the result executable

similar to the usual C++ compiler options -IDIR. DIR is a virtual string

similar to the usual C++ compiler option -DMAC. MAC is a virtual string

similar to the usual C++ linker option -lLIB. LIB is a virtual string

You might want to specify a rule to create a pre-linked library:

'Utils.ozf' : ozl('Foo.ozf')

or to create a non-prelinked executable:

'Foo.exe' : ozc('Foo.oz' [executable])
Dependencies

ozmake automatically determines whether targets needed to be rebuilt, because they are missing or if some source file needed to create them has been modified. The rules are used to determine dependencies between files. Sometimes this is insufficient because you use tool ozl (dependencies on imports), or \insert in an Oz file, or #include in a C++ file. In this case you can specify additional dependencies using feature depends which is a record mapping targets to list of dependencies:

TARGET : [ FILES ]

For example:

'Foo.o' : [ 'Foo.hh' 'Baz.hh' ]

or

'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ]
Cleaning

During development, it is often convenient to be able to easily remove all junk and compiled files to obtain again a clean project directory. This is supported by ozmake --clean and ozmake --veryclean; the latter also implies the former. Files to be removed are specified by glob patterns where ? matches any 1 character and * matches a sequence of 0 or more characters. All files in BUILDDIR matching one such pattern is removed. There are built-in patterns, but ou can override them with features clean and veryclean which should be lists of glob patterns. For example the default clean glob patterns are:

clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ]
Package Related Features
uri

feature uri indicates the URI where to install lib targets. For example:

uri : 'x-ozlib://mylib/XML'

states that all lib targets (e.g. Foo.ozf) will be installed under this URI so that they can also be imported from it, i.e.:

import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf'
mogul

feature mogul is the mogul id uniquely identifying this package. It is used to identify the package in the database of installed packages, to create/publish the package, and to install its documention files.

author

feature author is a virtual string or list of virtual string identifying the author or authors of the package. It is recommended to identify authors by their MOGUL id (the MOGUL id of their contact entry), however is is also possible to simply give their names. For example, the recommended way is:

author : 'mogul:/duchier/denys'

but the following is also possible:

author : 'Denys Duchier'
released

feature released is a virtual string specifying the date and time of release in the following format:

released : "YYYY-MM-DD-HH:MM:SS"

time is optional. An appropriate release date using the current date and time is automatically inserted when invoking ozmake --create or ozmake --publish

blurb

feature blurb contains a very short piece of text describing the package. This text should be just one line and is intended to be used as a title when the package is published in the MOGUL archive.

info_text

feature info_text contains a plain text description of the package. This is intended to be used as an abstract on the presentation page for the package in the mogul archive. It should be brief and informative, but should not attempt to document the package.

info_html

feature info_html is similar to info_text but contains HTML rather than plain text.

src

feature src indicates which targets should be considered source, in particular non-buildable. All targets mentioned in src should be mentioned in bin, lib, or doc too. The point of src is to support distributing packages with pre-built targets and without giving out the corresponding sources. You should not do this with native functors since they are platform dependent and not portable, but it can be a convenient means of distributing prebuilt Oz libraries. For example:

makefile( lib : [ 'Foo.ozf' ] src : [ 'Foo.ozf' ] uri : 'x-ozlib://mylib' mogul : 'mogul:/myname/foolib')

is a makefile for a package that distribute the precompiled Foo.ozf, but does not also distribute its source Foo.oz. Normally, when you build a package it simply checks that the src files are present but will not attempt to build them. If you have the sources, you can force building the src targets if necessary using --fullbuild

subdirs

feature subdirs is a list of bare filenames representing subdirectories of the project. By default, when necessary, ozmake will recurse into these subdirectories. It is expected that each subdirectory should provide its own makefile. The MOGUL id is automatically inherited to subdirectories and the uri is automatically extended by appending the name of the subdirectory: thus submakefiles can be simpler since they don't need to be concerned with package-level features.

requires

feature requires is a list of module URIs or package MOGUL ids. These represent the external dependencies of the package. They are not yet used, but eventually ozmake will be able to use them to automate the recursive installation of other packages required by the one you are interested in.

categories

feature categories is a list of MOGUL categories to help categorize this package in the MOGUL archive.

version

feature version is used to provide a version string. This is a string that consist of integers separated by single dots, "2" or "3.1.7"

provides

feature provides is used to override the default information about what the package provides, normally automatically computed from the bin and lib targets: it should be a list which contains a subset of these targets. The provides feature of a makefile does not override or otherwise affect its submakefiles: each makefile should separately override if it so desires. To state that a makefile does not officially provide any functors or executable application, you would add:

provides : nil

You should use the provides feature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package

CONTACTS

Authors should really be referred to by MOGUL ids denoting MOGUL entries that describe them. In order to make this easier, a makefile.oz may also contain a contact feature which is either a record describing a person, or a list of such records.

You should not have a contact feature in every makefile. Rather, the contact feature is usually intended for makefiles that only have a contact feature, whose only purpose is to create MOGUL entries for the corresponding persons. Here is an example of such a makefile:

makefile( contact : o( mogul : 'mogul:/duchier/denys' name : 'Denys Duchier' email : 'duchier@ps.uni-sb.de' www : 'http://www.ps.uni-sb.de/~duchier/'))

You can invoke ozmake --publish on such a makefile to contribute the corresponding mogul database entries

mozart-stdlib-20060615/mozart-stdlib/ozmake/ozmake.xsl0000644000175000017500000002232007576222101022202 0ustar kevingkeving <xsl:call-template name="title"/>

,



,
version
provides
mailto:


default:
,
default :

< > ... i.e. e.g. resp.
    
  
    
  

**** OOPS abstract: **** **** OOPS: ****
mozart-stdlib-20060615/mozart-stdlib/wp/0000755000175000017500000000000010444200427017320 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/wp/qhtml/0000755000175000017500000000000010444200427020445 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/wp/qhtml/html/0000755000175000017500000000000010444200427021411 5ustar kevingkevingmozart-stdlib-20060615/mozart-stdlib/wp/qhtml/html/GJoz.class0000644000175000017500000000264107365262712023331 0ustar kevingkevingÊþº¾-`Code SourceFile ConstantValue ExceptionsGJozjava/applet/AppletLOzLink;myLink  ()V disconnect  OzLink   ()Ljava/net/URL;getDocumentBase  ()Ljava/lang/String;getHost  java/net/URL port &(Ljava/lang/String;)Ljava/lang/String; getParameter #" $Lnetscape/javascript/JSObject;w '& (E(Ljava/lang/String;Ljava/lang/String;Lnetscape/javascript/JSObject;)V * +start - java/lang/Thread/ 0.java/lang/Exception2Connection Lost43(Lnetscape/javascript/JSObject;Ljava/lang/String;)VmyAlert 76 8toString :java/lang/Throwable< =;Could not connect to Server?4(Ljava/applet/Applet;)Lnetscape/javascript/JSObject; getWindow BAnetscape/javascript/JSObjectD ECnetscape/javascript/JSExceptionGLjava/io/PrintStream;out JIjava/lang/SystemL MK(Ljava/lang/String;)Vprintln POjava/io/PrintStreamR SQConnect U VsendToOz XO Yjava/lang/NullPointerException[ GJoz.javainitstop!'& _ *´ ¶± *·±U eI*¶¶L*!¶%M*»Y+,*´)·,µ *´ ¶1±W*´)5¸9±N*´)-¶>¸9*´)@¸9± '(3233^ /**¸Fµ)§L²N+¶>¶T*·W± HXO *´ +¶Z±W± \]mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/html/OzLink.class0000644000175000017500000000420207365262712023661 0ustar kevingkevingÊþº¾-Code SourceFile ConstantValue ExceptionsOzLinkjava/lang/Thread()V  Lnetscape/javascript/JSObject;w  Ljava/lang/String;host  (Ljava/lang/String;)IparseInt java/lang/Integer Iport  java/net/Socket(Ljava/lang/String;I)V ! "Ljava/net/Socket;m_Socket %$ &java/io/BufferedReader(java/io/InputStreamReader*()Ljava/io/InputStream;getInputStream -, .(Ljava/io/InputStream;)V 0 +1(Ljava/io/Reader;)V 3 )4Ljava/io/BufferedReader;m_is 76 8java/io/BufferedWriter:java/io/OutputStreamWriter<()Ljava/io/OutputStream;getOutputStream ?> @(Ljava/io/OutputStream;)V B =C(Ljava/io/Writer;)V E ;FLjava/io/BufferedWriter;m_os IH Jclose L Mjava/lang/ExceptionOjava/lang/StringBufferQ R  recvFromOz('T,(Ljava/lang/String;)Ljava/lang/StringBuffer;append WV RX')Z()Ljava/lang/String;toString ]\ R^&(Ljava/lang/String;)Ljava/lang/Object;eval a`netscape/javascript/JSObjectc dbLjava/io/PrintStream;out gfjava/lang/Systemi jhjava/lang/Throwablel m^(Ljava/lang/String;)Vprintln pojava/io/PrintStreamr sqalert('ureadLine w\ )x recvFromOz zo {Connection Lost}3(Lnetscape/javascript/JSObject;Ljava/lang/String;)VmyAlert € write ƒojava/io/Writer… †„flush ˆ ;‰ OzLink.javaE(Ljava/lang/String;Ljava/lang/String;Lnetscape/javascript/JSObject;)VrunsendToOz disconnect!%$76IH  ŒPoc*· *-µ*+µ*,¸µ*» Y*´*´·#µ'*´'Æ5*»)Y»+Y*´'¶/·2·5µ9*»;Y»=Y*´'¶A·D·GµK±  *´'¶N±W±PzoK/*´»RY·SU¶Y+¶Y[¶Y¶_¶eW±M²k,¶n¶t±W± !P",-P €H,*»RY·Sv¶Y+¶Y[¶Y¶_¶eW±M²k,¶n¶t±W±P)*P /*´9¶yL*+¶|§ÿóW*´~¸‚±PŽo/*´K+¶‡*´K¶Š±W*´~¸‚±P‹mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/html/default.htm0000644000175000017500000001625407365262712023574 0ustar kevingkeving QHTML application mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/CSS2.html0000644000175000017500000025264407365262625022102 0ustar kevingkeving Property index

Appendix F. Property index

Name Values Initial value Applies to
(Default: all)
Inherited? Percentages
(Default: N/A)
Media groups
'azimuth' <angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inherit center   yes   aural
'background' ['background-color' || 'background-image' || 'background-repeat' || 'background-attachment' || 'background-position'] | inherit XX   no allowed on 'background-position' visual
'background-attachment' scroll | fixed | inherit scroll   no   visual
'background-color' <color> | transparent | inherit transparent   no   visual
'background-image' <uri> | none | inherit none   no   visual
'background-position' [ [<percentage> | <length> ]{1,2} | [ [top | center | bottom] || [left | center | right] ] ] | inherit 0% 0% block-level and replaced elements no refer to the size of the box itself visual
'background-repeat' repeat | repeat-x | repeat-y | no-repeat | inherit repeat   no   visual
'border' [ 'border-width' || 'border-style' || <color> ] | inherit see individual properties   no   visual
'border-collapse' collapse | separate | inherit collapse 'table' and 'inline-table' elements yes   visual
'border-color' <color>{1,4} | transparent | inherit see individual properties   no   visual
'border-spacing' <length> <length>? | inherit 0 'table' and 'inline-table' elements yes   visual
'border-style' <border-style>{1,4} | inherit see individual properties   no   visual
'border-top' 'border-right' 'border-bottom' 'border-left' [ 'border-top-width' || 'border-style' || <color> ] | inherit see individual properties   no   visual
'border-top-color' 'border-right-color' 'border-bottom-color' 'border-left-color' <color> | inherit the value of the 'color' property   no   visual
'border-top-style' 'border-right-style' 'border-bottom-style' 'border-left-style' <border-style> | inherit none   no   visual
'border-top-width' 'border-right-width' 'border-bottom-width' 'border-left-width' <border-width> | inherit medium   no   visual
'border-width' <border-width>{1,4} | inherit see individual properties   no   visual
'bottom' <length> | <percentage> | auto | inherit auto positioned elements no refer to height of containing block visual
'caption-side' top | bottom | left | right | inherit top 'table-caption' elements yes   visual
'clear' none | left | right | both | inherit none block-level elements no   visual
'clip' <shape> | auto | inherit auto block-level and replaced elements no   visual
'color' <color> | inherit depends on user agent   yes   visual
'content' [ <string> | <uri> | <counter> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit empty string :before and :after pseudo-elements no   all
'counter-increment' [ <identifier> <integer>? ]+ | none | inherit none   no   all
'counter-reset' [ <identifier> <integer>? ]+ | none | inherit none   no   all
'cue' [ 'cue-before' || 'cue-after' ] | inherit XX   no   aural
'cue-after' <uri> | none | inherit none   no   aural
'cue-before' <uri> | none | inherit none   no   aural
'cursor' [ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | inherit auto   yes   visual, interactive
'direction' ltr | rtl | inherit ltr all elements, but see prose yes   visual
'display' inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit inline   no   all
'elevation' <angle> | below | level | above | higher | lower | inherit level   yes   aural
'empty-cells' show | hide | inherit show 'table-cell' elements yes   visual
'float' left | right | none | inherit none all but positioned elements and generated content no   visual
'font' [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit see individual properties   yes allowed on 'font-size' and 'line-height' visual
'font-family' [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] | inherit depends on user agent   yes   visual
'font-size' <absolute-size> | <relative-size> | <length> | <percentage> | inherit medium   yes, the computed value is inherited refer to parent element's font size visual
'font-size-adjust' <number> | none | inherit none   yes   visual
'font-stretch' normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit normal   yes   visual
'font-style' normal | italic | oblique | inherit normal   yes   visual
'font-variant' normal | small-caps | inherit normal   yes   visual
'font-weight' normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit normal   yes   visual
'height' <length> | <percentage> | auto | inherit auto all elements but non-replaced inline elements, table columns, and column groups no see prose visual
'left' <length> | <percentage> | auto | inherit auto positioned elements no refer to width of containing block visual
'letter-spacing' normal | <length> | inherit normal   yes   visual
'line-height' normal | <number> | <length> | <percentage> | inherit normal   yes refer to the font size of the element itself visual
'list-style' [ 'list-style-type' || 'list-style-position' || 'list-style-image' ] | inherit XX elements with 'display: list-item' yes   visual
'list-style-image' <uri> | none | inherit none elements with 'display: list-item' yes   visual
'list-style-position' inside | outside | inherit outside elements with 'display: list-item' yes   visual
'list-style-type' disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-alpha | lower-latin | upper-alpha | upper-latin | hebrew | armenian | georgian | cjk-ideographic | hiragana | katakana | hiragana-iroha | katakana-iroha | none | inherit disc elements with 'display: list-item' yes   visual
'margin' <margin-width>{1,4} | inherit XX   no refer to width of containing block visual
'margin-top' 'margin-right' 'margin-bottom' 'margin-left' <margin-width> | inherit 0   no refer to width of containing block visual
'marker-offset' <length> | auto | inherit auto elements with 'display: marker' no   visual
'marks' [ crop || cross ] | none | inherit none page context N/A   visual, paged
'max-height' <length> | <percentage> | none | inherit none all elements except non-replaced inline elements and table elements no refer to height of containing block visual
'max-width' <length> | <percentage> | none | inherit none all elements except non-replaced inline elements and table elements no refer to width of containing block visual
'min-height' <length> | <percentage> | inherit 0 all elements except non-replaced inline elements and table elements no refer to height of containing block visual
'min-width' <length> | <percentage> | inherit UA dependent all elements except non-replaced inline elements and table elements no refer to width of containing block visual
'orphans' <integer> | inherit 2 block-level elements yes   visual, paged
'outline' [ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit see individual properties   no   visual, interactive
'outline-color' <color> | invert | inherit invert   no   visual, interactive
'outline-style' <border-style> | inherit none   no   visual, interactive
'outline-width' <border-width> | inherit medium   no   visual, interactive
'overflow' visible | hidden | scroll | auto | inherit visible block-level and replaced elements no   visual
'padding' <padding-width>{1,4} | inherit XX   no refer to width of containing block visual
'padding-top' 'padding-right' 'padding-bottom' 'padding-left' <padding-width> | inherit 0   no refer to width of containing block visual
'page' <identifier> | auto auto block-level elements yes   visual, paged
'page-break-after' auto | always | avoid | left | right | inherit auto block-level elements no   visual, paged
'page-break-before' auto | always | avoid | left | right | inherit auto block-level elements no   visual, paged
'page-break-inside' avoid | auto | inherit auto block-level elements yes   visual, paged
'pause' [ [<time> | <percentage>]{1,2} ] | inherit depends on user agent   no see descriptions of 'pause-before' and 'pause-after' aural
'pause-after' <time> | <percentage> | inherit depends on user agent   no see prose aural
'pause-before' <time> | <percentage> | inherit depends on user agent   no see prose aural
'pitch' <frequency> | x-low | low | medium | high | x-high | inherit medium   yes   aural
'pitch-range' <number> | inherit 50   yes   aural
'play-during' <uri> mix? repeat? | auto | none | inherit auto   no   aural
'position' static | relative | absolute | fixed | inherit static all elements, but not to generated content no   visual
'quotes' [<string> <string>]+ | none | inherit depends on user agent   yes   visual
'richness' <number> | inherit 50   yes   aural
'right' <length> | <percentage> | auto | inherit auto positioned elements no refer to width of containing block visual
'size' <length>{1,2} | auto | portrait | landscape | inherit auto the page context N/A   visual, paged
'speak' normal | none | spell-out | inherit normal   yes   aural
'speak-header' once | always | inherit once elements that have table header information yes   aural
'speak-numeral' digits | continuous | inherit continuous   yes   aural
'speak-punctuation' code | none | inherit none   yes   aural
'speech-rate' <number> | x-slow | slow | medium | fast | x-fast | faster | slower | inherit medium   yes   aural
'stress' <number> | inherit 50   yes   aural
'table-layout' auto | fixed | inherit auto 'table' and 'inline-table' elements no   visual
'text-align' left | right | center | justify | <string> | inherit depends on user agent and writing direction block-level elements yes   visual
'text-decoration' none | [ underline || overline || line-through || blink ] | inherit none   no (see prose)   visual
'text-indent' <length> | <percentage> | inherit 0 block-level elements yes refer to width of containing block visual
'text-shadow' none | [<color> || <length> <length> <length>? ,]* [<color> || <length> <length> <length>?] | inherit none   no (see prose)   visual
'text-transform' capitalize | uppercase | lowercase | none | inherit none   yes   visual
'top' <length> | <percentage> | auto | inherit auto positioned elements no refer to height of containing block visual
'unicode-bidi' normal | embed | bidi-override | inherit normal all elements, but see prose no   visual
'vertical-align' baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit baseline inline-level and 'table-cell' elements no refer to the 'line-height' of the element itself visual
'visibility' visible | hidden | collapse | inherit inherit   no   visual
'voice-family' [[<specific-voice> | <generic-voice> ],]* [<specific-voice> | <generic-voice> ] | inherit depends on user agent   yes   aural
'volume' <number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud | inherit medium   yes refer to inherited value aural
'white-space' normal | pre | nowrap | inherit normal block-level elements yes   visual
'widows' <integer> | inherit 2 block-level elements yes   visual, paged
'width' <length> | <percentage> | auto | inherit auto all elements but non-replaced inline elements, table rows, and row groups no refer to width of containing block visual
'word-spacing' normal | <length> | inherit normal   yes   visual
'z-index' auto | <integer> | inherit auto positioned elements no   visual
mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/ConnectionServer.oz0000644000175000017500000000613507365262625024332 0ustar kevingkeving functor import Open export Server StartServer StartServerOnPort StopServer define TextSocket=class $ from Open.socket Open.text end class Client from TextSocket feat RThId WThId In Quit meth getIOStreams(Input Output) thread self.RThId={Thread.this} self.In={NewPort Input} proc{ReadLoop Remain} if {IsFree self.Quit} then M={List.append Remain {self receive($)}} fun{Apply M} L R {List.takeDropWhile M fun{$ C} C\=&, end L R} in if L==M then M % , not yet received enough else N={String.toInt L} in if {Length R}=|Xs then Xs [] _|Xs then {SkipClosure Xs} else nil end end Len={Length Str} fun{Loop Data} case Data of &<|Xs then if {List.take Xs Len}==Str then {SkipClosure Xs} else {Loop Xs} end [] _|Xs then {Loop Xs} else nil end end in {Loop Data} end fun{GetUntil Data Str} Len={Length Str} fun{Loop Data} if {List.take Data Len}==Str then nil elsecase Data of X|Xs then X|{Loop Xs} else nil end end in {Loop Data} end fun{GetNoTagUntil Data Str} Len={Length Str} fun{Skip Data} case Data of &>|Xs then {Loop Xs} [] _|Xs then {Skip Xs} else nil end end fun{Loop Data} if {List.take Data Len}==Str then nil elsecase Data of &<|Xs then {Skip Xs} [] X|Xs then X|{Loop Xs} else nil end end in {Loop Data} end fun{GetSpecTagUntil Data Str} Len={Length Str} fun{Skip Data} case Data of &>|Xs then {Loop Xs} [] _|Xs then {Skip Xs} else nil end end fun{Loop Data} if {List.take Data Len}==Str then nil elsecase Data of &<|&A|Xs then 'A'|{Skip Xs} [] &<|&a|Xs then 'A'|{Skip Xs} [] &<|Xs then {Skip Xs} [] X|Xs then X|{Loop Xs} else nil end end in {Loop Data} end fun{ParseValue Str} fun{MakeList Str} case Str of 'A'|&&|&l|&t|&;|Xs then fun{Loop Str R} case Str of &&|&g|&t|&;|Xs then R=Xs nil [] X|Xs then X|{Loop Xs R} else R=nil nil end end R V={String.toAtom {Loop Xs R}} in type(V)|{MakeList R} [] &&|&n|&b|&s|&p|&;|Xs then {MakeList Xs} [] &||&||Xs then '||'|{MakeList Xs} [] &||Xs then '|'|{MakeList Xs} [] &{|Xs then From R1 {List.takeDropWhile Xs fun{$ C} C\=&, end From R1} To R2 {List.takeDropWhile {List.drop R1 1} fun{$ C} C\=&} end To R2} in repeat({String.toInt From} {String.toInt To})|{MakeList {List.drop R2 1}} [] &[|Xs then '['|{MakeList Xs} [] &]|Xs then ']'|{MakeList Xs} [] &\r|Xs then {MakeList Xs} [] &\n|Xs then {MakeList Xs} [] & |Xs then {MakeList Xs} [] &?|Xs then '?'|{MakeList Xs} [] 'A'|Xs then T R in {List.takeDropWhile Xs fun{$ C} {Not {List.member C [& &] &|]}} end T R} if T=="inherit" then inherit else ref({String.toAtom case T of &'|_ then {List.drop {List.take T {Length T}-1} 1} else T end}) end|{MakeList R} [] _|_ then T R in {List.takeDropWhile Str fun{$ C} {Not {List.member C [& &] &|]}} end T R} {StringToAtom T}|{MakeList R} else nil end end % fun{BuildStruct L Mode R} % fun{Next This Remain} % case Remain % of repeat(F T)|Xs then % repeat(This F T)|{BuildStruct Xs Mode R} % [] '*'|Xs then % repeat(This 0 inf)|{BuildStruct Xs Mode R} % else % This|{BuildStruct Remain Mode R} % end % end % in % % {Show {List.take L 1}#Mode} % case L % of '|'|Xs then % Mode=switch % {BuildStruct Xs Mode R} % [] '||'|Xs then % Mode=aggregate % {BuildStruct Xs Mode R} % [] '['|Xs then % T % Remain % TL={BuildStruct Xs T Remain} % if {IsFree T} then T=abs end % This={List.toTuple T TL} % in % {Next This Remain} % [] ']'|Xs then % R=Xs nil % [] X|'?'|Xs then % repeat(X 0 1)|{BuildStruct Xs Mode R} % [] X|Xs then % {Next X Xs} % else % R=nil nil % end % end % T TL % TL={BuildStruct {MakeList Str} T _} % in % if {IsFree T} then T=abs end % {List.toTuple T TL} fun{BuildStruct L R} fun{Next L R} case L of This|repeat(F T)|Xs then R=Xs repeat(This F T) [] This|'*'|Xs then R=Xs repeat(This 0 inf) [] This|'+'|Xs then R=Xs repeat(This 1 inf) [] This|'?'|Xs then R=Xs repeat(This 0 1) [] This|Xs then R=Xs This end end fun{GetElems L R} case L of '['|Xs then R1 R2 in {Next {BuildStruct Xs R1}|R1 R2}|{GetElems R2 R} [] ']'|Xs then R=Xs nil [] _|_ then R1 in {Next L R1}|{GetElems R1 R} else R=nil nil end end Li={GetElems L R} fun{GetAbs L R} case L of '|'|_ then R=L nil [] '||'|_ then R=L nil [] X|Xs then X|{GetAbs Xs R} else R=nil nil end end Mode fun{Loop L} if L\=nil then R1 B={GetAbs L R1} if {IsFree Mode} then case R1 of '|'|_ then Mode=switch [] '||'|_ then Mode=aggregate else Mode=succ end end in if {Length B}==1 then {List.last B} else {List.toTuple succ B} end|{Loop if R1==nil then nil else {List.drop R1 1} end} else nil end end T={Loop Li} Result=if {Length T}==1 then {List.last T} else {List.toTuple Mode T} end in Result end in {BuildStruct {MakeList Str} _} end fun{Str2distance V} L R in {List.takeDropWhile {Reverse V} fun{$ C} C<&0 orelse C>&9 end R L} if R==nil then X in try X={String.toFloat V} catch _ then skip end try X={String.toInt V} catch _ then skip end try X=V catch _ then skip end X elseif L==nil then {String.toAtom V} elseif R=="%" then {String.toInt {Reverse L}}#'%' else X LL={Reverse L} in try X={String.toFloat LL} catch _ then skip end try X={Int.toFloat {String.toInt LL}} catch _ then skip end try X=V catch _ then skip end X#{String.toAtom {Reverse R}} end end fun{Purge Str} fun{Loop Str} case Str of &&|&n|&b|&s|&p|&;|Xs then {Loop Xs} [] &\r|Xs then {Loop Xs} [] &\n|Xs then {Loop Xs} [] X|Xs then X|{Loop Xs} else nil end end in {Reverse {List.dropWhile {Reverse {List.dropWhile {Loop Str} fun{$ C} C==& end}} fun{$ C} C==& end}} end fun{ParseInit V3} P={Purge V3} A={String.toAtom P} in if {Dictionary.member InitDb A} then InitDb.A else {Str2distance P} end end fun{ParseApply V4} {Dictionary.condGet ApplyDb {String.toAtom {Purge V4}} nil} end Quit CSS={NewDictionary} proc{Loop Data} % row Row={SkipTag Data "TR"} in if Row\=nil then % first cell C1={SkipTag Row "TD"} % content of span in cell V1={GetNoTagUntil C1 ""} % second cell C2={SkipTag C1 "TD"} % content of cell V2={GetSpecTagUntil C2 ""} % possible values % third cell C3={SkipTag C2 "TD"} % content of cell V3={GetUntil C3 ""} % default value % fourth cell C4={SkipTag C3 "TD"} V4={GetUntil C4 ""} % applies to... in % process all informations local fun{GetName Str R} L1={List.dropWhile Str fun{$ C} C\=&' end} in if L1==nil then R=nil nil else L2={List.drop L1 1} L3 L4 {List.takeDropWhile L2 fun{$ C} C\=&' end L3 L4} in R={List.drop L4 1} {String.toAtom L3} end end Init Apply Values proc{Loop Str} R Name={GetName Str R} in if Name\=nil then if {Not {List.member Name Ignore}} then % process this Name if {IsFree Values} then Values={ParseValue V2} Init={ParseInit V3} Apply={ParseApply V4} % {Show Name#Apply} end % store data CSS.Name:=r(values:Values init:Init apply:Apply) end {Loop R} end end in {Loop V1} end if {IsFree Quit} then {Loop C4} end end end TBody={SkipTag Data "TBODY"} {Loop TBody} %% references must still be changed by their actual value local fun{RemoveRef T} {Record.map T fun{$ E} case E of ref(X) then {Dictionary.get CSS X}.values else if {Record.is E} then {RemoveRef E} else E end end end} end in {ForAll {Dictionary.keys CSS} proc{$ K} CSS.K:={RemoveRef CSS.K} end} end %% at this point, the CSS dictionary contain all CSS parameter informations, index by parameter name %% now we must build a list index by widgets fun{Capitalize S} case S of &-|X|Xs then if (X>=&a) andthen (X=<&z) then X+&A-&a|{Capitalize Xs} else X|{Capitalize Xs} end [] X|Xs then X|{Capitalize Xs} else nil end end DB={NewDictionary} {ForAll {Dictionary.entries CSS} proc{$ N#D} Data1=r(attribute:N get:internal(true) init:style(true) set:style(true) type:css(D.values) ) Data=Data1 % if D.init\=NoInit then {Record.adjoinAt Data1 default D.init} else Data1 end Name={String.toAtom {Capitalize {Atom.toString N}}} in {ForAll D.apply proc{$ W} {Dictionary.put DB W Name#Data|{Dictionary.condGet DB W nil}} end} end} % events definition is build by hand for now... info comes from html40\index\attributes.html % list of possible events : onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onreset onselect onunload DEVENTS=[anchor#[onblur onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] button#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] checkbox#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] file#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect] frame#nil frameset#[onload onunload] hr#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] html#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] hyperlink#[onblur onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] img#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] label#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] listbox#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] lr#[onchange onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] lrframe#[onload onunload] menubutton#nil menucheck#nil menuhr#nil menuitem#nil menuradio#nil password#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect] placeholder#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] radio#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] submenu#nil table#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] tc#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] td#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup] tdframe#[onload onunload] text#[onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect] textarea#[onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect] toplevel#[onclick ondblclick onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onunload] tr#[onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup]] DBL={Dictionary.entries DB} export data : DBL events : DEVENTS end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTML.oz0000644000175000017500000000530507365262625021727 0ustar kevingkevingfunctor import QHTMLDevel ConnectionServer QHTMLWebServer QUI QHTMLToplevel QHTMLTdLr QHTMLButton QHTMLText QHTMLCheckbox QHTMLFile QHTMLPassword QHTMLRadio QHTMLLabel QHTMLHtml QHTMLHr QHTMLListbox QHTMLPlaceholder QHTMLTextarea QHTMLImg QHTMLA QHTMLFrame QHTMLMenu HTMLmarshaller export Build NewLook Server StartServer StartServerOnPort StopServer StartWebServer StartWebServerOnPort StopWebServer StartAll StartAllHTMLEntryFilename SetAlias UnSetAlias Vs2Html Html2Vs Undefined define Undefined=QHTMLDevel.undefined {Wait QHTMLToplevel} % complete {Wait QHTMLTdLr} % td&lr complete, pure table support missing thead tfoot & tbody {Wait QHTMLButton} % complete {Wait QHTMLText} % missing text range support {Wait QHTMLCheckbox} % missing a label support {Wait QHTMLFile} % missing upload functionality {Wait QHTMLPassword} % missing text range support {Wait QHTMLRadio} % missing a label support {Wait QHTMLLabel} % complete {Wait QHTMLHtml} % complete {Wait QHTMLHr} % complete {Wait QHTMLListbox} % complete {Wait QHTMLPlaceholder} % complete {Wait QHTMLTextarea} % missing text range support {Wait QHTMLImg} % may find a better way to add map support {Wait QHTMLA} % complete with nice anchor support {Wait QHTMLFrame} % tdframe & lrframe complete. frameset needs support for adding/removing frames dynamically. frame needs support for dynamic changes (ref problem in html ???) also support for iframe missing {Wait QHTMLMenu} % complete with support for colors (only at toplevel declaration), item menus, radio menus, check menus and submenus. An optimization will be to not redraw all menus from the root. Missing popupmenu support. % vml % ? javaapplet & activex Vs2Html=HTMLmarshaller.vS2HTML Html2Vs=HTMLmarshaller.hTML2VS SetAlias=QUI.setAlias UnSetAlias=QUI.unSetAlias fun{Build Desc} {QUI.build Desc unit} end NewLook=QUI.newLook Server=ConnectionServer.server StartServer=ConnectionServer.startServer StartServerOnPort=ConnectionServer.startServerOnPort StopServer=ConnectionServer.stopServer StartWebServer=QHTMLWebServer.startServer StartWebServerOnPort=QHTMLWebServer.startServerOnPort StopWebServer=QHTMLWebServer.stopServer proc{StartAll ConnectProc SPort WPort} SPort={StartServer ConnectProc} WPort={StartWebServer SPort} end proc{StartAllHTMLEntryFilename ConnectProc FileName} WPort in {StartAll ConnectProc _ WPort} {QHTMLWebServer.writeRedirector WPort FileName} end end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLA.oz0000644000175000017500000000547307365262625022036 0ustar kevingkevingfunctor import QUI QHTMLDevel(defineWidget:DefineWidget onConnect:OnConnect setTooltips:SetTooltips baseClass:BaseClass set:Set get:Get dataInfo:DataInfo configure:Configure quoteDouble:QuoteDouble send:Send qInit:QInit buildInnerHTML:BuildInnerHTML) QHTMLType(marshall:Marshall) HTMLmarshaller(vS2HTML:Vs2html) define {DefineWidget r(desc:hyperlink(tooltips(proc{$ O V} {O SetTooltips(V)} end)) tag:a params:[value#r(type:html default:"" init:custom(true) set:custom(true) get:internal(true)) accessKey#r(type:vs init:outer(true) set:outer(true) get:internal(true)) charset#r(type:html init:outer(true) set:outer(true) get:internal(true)) href#r(type:fun{$ T} {IsFree T} orelse (({Object.is T} andthen (T.widgetId==anchor)) orelse {VirtualString.is T}) end marshall:fun{$ V} if {IsFree V} then "" elseif {Object.is V} then '"#'#{V Get(name $)}#'"' else '"'#{Vs2html V}#'"' end end init:outer(true) set:outer(true) get:internal(true)) hreflang#r(type:html init:outer(true) set:outer(true) get:internal(true)) methods#r(type:html init:outer(true) set:outer(true) get:internal(true)) tabIndex#r(type:int init:outer(true) set:outer(true) get:internal(true)) target#r(type:['_blank' '_parent' '_self' '_top'] init:outer(true) set:outer(true) get:internal(true)) type#r(type:html init:outer(true) set:outer(true) get:internal(true)) urn#r(type:html init:outer(true) set:outer(true) get:internal(true)) ] events:nil ) class $ from BaseClass meth !QInit(...)=M {self {Record.adjoin M set}} end meth set(...)=M {Record.forAllInd M proc{$ I V} case I of value then {self Configure(innerHTML {QuoteDouble '"'#{self BuildInnerHTML($)}#'"'} )} end end} end meth !BuildInnerHTML($) {Vs2html {self Get(value $)}} end meth !OnConnect {self Configure(href {Marshall self {Dictionary.get self.DataInfo href} {self Get(href $)}})} end meth blur {self Send({self get(refId:$)}#".blur()")} end meth focus {self Send({self get(refId:$)}#".focus()")} end end} {DefineWidget r(desc:anchor tag:a params:[name#r(type:html init:outer(false) set:outer(false) get:internal(false))] events:nil ) class $ from BaseClass meth !QInit(...)=M {self Set(name {self Get(id $)})} end end} {QUI.setAlias a hyperlink} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLButton.oz0000644000175000017500000000202607365262625023120 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget setTooltips:SetTooltips baseClass:BaseClass send:Send) define {DefineWidget r(desc:button(action(proc{$ O A} {O bind(event:onclick action:A)} end) tooltips(proc{$ O V} {O SetTooltips(V)} end)) tag:input params:[type#r(default:button init:outer(false) set:outer(false) get:outer(false)) value#r(type:html init:outer(true) set:outer(true) get:internal(true)) accessKey#r(type:vs init:outer(true) set:outer(true) get:outer(true)) disabled#r(type:bool default:false init:html(true) set:html(true) get:internal(true)) tabIndex#r(type:int init:outer(true) set:outer(true) get:outer(true)) ] events:nil ) class $ from BaseClass meth blur {self Send({self get(refId:$)}#".blur()")} end meth focus {self Send({self get(refId:$)}#".focus()")} end end} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLCheckbox.oz0000644000175000017500000000237307365262625023400 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget setTooltips:SetTooltips baseClass:BaseClass send:Send) define {DefineWidget r(desc:checkbox(action(proc{$ O A} {O bind(event:onclick action:A)} end) tooltips(proc{$ O V} {O SetTooltips(V)} end)) tag:input params:[type#r(default:checkbox init:outer(false) set:outer(false) get:outer(false)) % status#r(type:bool % init:html(true) % set:html(true) % get:html(true)) accessKey#r(type:vs init:outer(true) set:outer(true) get:outer(true)) disabled#r(type:bool default:false init:html(true) set:html(true) get:internal(true)) tabIndex#r(type:int init:outer(true) set:outer(true) get:outer(true)) checked#r(type:bool default:false init:html(true) set:html(true) get:html(true)) indeterminate#r(type:bool default:false init:html(true) set:html(true) get:internal(true)) ] events:nil ) class $ from BaseClass meth blur {self Send({self get(refId:$)}#".blur()")} end meth focus {self Send({self get(refId:$)}#".focus()")} end end} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLDevel.oz0000644000175000017500000004117607365262625022715 0ustar kevingkevingfunctor import QUI QHTMLType(marshall:Marshall unmarshall:Unmarshall % existType:ExistType % existTrans:ExistTrans existEvent:ExistEvent event2OZ:Event2OZ checkType:CheckType) Params % System(show:Show) export Quote QuoteSingle QuoteDouble RemoveQuote DefineWidget BaseClass DataVal DataInfo GetId InitDataInfo Events BuildInnerHTML BuildHTML Undefined OnConnect OnDisconnect Set Get Send Return Configure Cget Sync ProcessEvent ExecEvent ReSetCustom SetTooltips Join CheckType QInit GetWidDef define {Wait CheckType} GetParam GetEvent local ParamsD={NewDictionary} EventsD={NewDictionary} in {ForAll Params.data proc{$ K#V} ParamsD.K:=V end} {ForAll Params.events proc{$ K#V} EventsD.K:=V end} fun{GetParam N} {Dictionary.condGet ParamsD N nil} end fun{GetEvent N} {Dictionary.condGet EventsD N nil} end end %% global names SharedName [DataVal DataInfo GetId Events InitDataInfo BuildInnerHTML BuildHTML Undefined OnConnect OnDisconnect Set Get Send Return Configure Cget Sync ProcessEvent ExecEvent ReSetCustom SetTooltips]=SharedName {ForAll SharedName proc{$ V} V={NewName} end} QInit=QUI.qInit Bad={NewName} PSend=Port.send %% misc procedures fun{Join L Sep} Len={Length L} in {VirtualString.toString {List.foldLInd L fun{$ I Old E} Old#E#if I\=Len then Sep else "" end end ""}} end %% base class for html widgets to inherit from class BaseClass prop locking meth !QInit(...) skip end meth set(...) skip end meth get(...) skip end meth bind(...) skip end meth !BuildInnerHTML($) "" end meth !OnConnect skip end meth !OnDisconnect skip end meth !Sync skip end meth close skip end end fun{RemoveQuote Str1} Str={VirtualString.toString Str1} in case Str of &"|_ andthen {List.last Str}==&" then {List.drop {List.take Str {Length Str}-1} 1} else Str end end %% define widget procedure, mixing classes and registering to QUI WidDef={NewDictionary} fun{GetWidDef T} WidDef.T end proc{DefineWidget Info MixClass} IsContainer={Record.some Info.desc fun{$ P} P==container end} % fun{GetDataVal Obj K} % Obj.DataVal.K % end in {Dictionary.put WidDef {Label Info.desc} Info.desc} {QUI.buildWidget Info.desc fun{$ Name QUIMixClass} class C from MixClass QUIMixClass feat widgetId:{Label Info.desc} !DataVal !DataInfo:{NewDictionary} !Events meth !QInit(...)=M Remain Contained Init Top=if M.parent==unit then self else {M.parent get(toplevel:$)} end in self.DataVal={NewDictionary} self.Events={NewDictionary} % self.DataInfo={NewDictionary} % {self InitDataInfo} % init QUI object Init=if IsContainer then {QUI.partitionContained M Contained $} else Contained=QInit M end % init default parameters {ForAll {Dictionary.entries self.DataInfo} proc{$ K#V} if {HasFeature V default} then {Dictionary.put self.DataVal K V.default} end end} % define tagName {self Set(tagname Info.tag)} % define HTML id local ID={Top GetId(self $)} CPI=if M.parent==unit then "" else {M.parent get(childPrefixId:$)} end in {self Set(id ID)} {self Set(childPrefixId CPI)} {self Set(refId if CPI=="" then ID else CPI#"."#ID end)} end % widget is not yet displayed {self Set(isdisplayed false)} % QUI constructor QUIMixClass,{Record.adjoinAt Init QUI.remainingParameters Remain} % check parameters {self Check(Remain)} % store user defined parameters {self Store(Init)} % give hand for other parameters local Custom={Record.filterInd Remain fun{$ K _} {CondSelect {Dictionary.get self.DataInfo K} init outer}==custom(true) end} in MixClass,{Record.adjoin Custom Contained} end end meth set(...)=M Remain in QUIMixClass,{Record.adjoinAt M QUI.remainingParameters Remain} {self Check(Remain)} {self Store(M)} local Top={self get(toplevel:$)} Con={self get(isdisplayed:$)} Custom={Record.filterInd Remain fun{$ K V} I={Dictionary.get self.DataInfo K} T={CondSelect I set outer} in if T==custom(true) then true else if Con then {Top configure(self if T==style(true) then "style."#K else K end {Marshall self I V})} end false end end} in MixClass,Custom end end meth get(...)=M Remain in QUIMixClass,{Record.adjoinAt M QUI.remainingParameters Remain} {self Check(Remain)} if Remain\=get then Top={self get(toplevel:$)} Con Custom={Record.filterInd Remain fun{$ K V} I={Dictionary.get self.DataInfo K} T={CondSelect I get internal(true)} in case T of internal(true) then V={self Get(K $)} false [] custom(true) then true else if {IsFree Con} then Con={self get(isdisplayed:$)} end if Con then V={Unmarshall self I {Top cget(self if T==style(true) then "style."#K else K end $)}} {self Set(K V)} else V={self Get(K $)} end false end end} in MixClass,Custom end end meth bind(event:E action:A args:P<=nil)=M %% events are a bit tricky because of their parameters %% qhtml's user can bind events over and over with different parameters %% and due to lag, the notofications from the page can be with different parameters %% than those requested %% solution used here : %% when a notification is received from the web page, along with paramaters specification %% if the notification is complete enough according to the event info on the Oz side %% then the event is raised, otherwise it is dropped. {CheckType E atom M} I={Dictionary.condGet self.DataInfo E r} in if {Not {HasFeature I bind}} orelse {Not {CondSelect I.bind 1 true}} then {QUI.raiseError self.widgetId "Invalid event : "#E M} else {CheckType A event M} {CheckType P list M} Port#Msg={{self get(actionManager:$)} getAction(A $)} self.Events.E:=Port#Msg#P in if {Label I.bind}==custom then %% custom events MixClass,bind(event:E action:Port#Msg args:P) else %% standard events {ForAll P proc{$ E} if {Not {Atom.is E}} orelse {Not {ExistEvent E}} then {QUI.raiseError self.widgetId "Invalid argument for event : "#E M} end end} Id={self get(id:$)} HTMLAct="top.catchevent(event,'"#Id#"','"#E#"','"#{Join P ","}#"')" Rec={Record.adjoinAt bind E HTMLAct} {self Store(Rec)} % self.Events.E:=Port#Msg#P Top={self get(toplevel:$)} in if {self Get(isdisplayed $)} then %% this method was supposed to work but didn't :( % {Top configure(self % E % HTMLAct)} %% using another method instead {self Sync} % synchronize state {self OnDisconnect} % simulate disconnection {Top configure(self outerHTML '"'#{QuoteDouble {self BuildOuterHTML($)}}#'"' )} {self OnConnect} % simulate connection end end end end meth !ProcessEvent(Str) L R {List.takeDropWhile Str fun{$ C} C\=&, end L R} Port#Msg#P={Dictionary.condGet self.Events {String.toAtom L} unit#unit#Bad} in if P\=Bad then fun{Loop Str1} Str=case Str1 of &,|Xs then Xs else Str1 end in if Str==nil then nil else L R V Remain {List.takeDropWhile Str fun{$ C} C\=&: end L R} {List.takeDropWhile {List.drop R 1} fun{$ C} C\=&, end V Remain} Code={String.toAtom L} in Code#{Event2OZ V Code}|{Loop Remain} end end Received={List.toRecord r {Loop R}} Result={List.map P fun{$ R} {CondSelect Received R Bad} end} in if {List.some Result fun{$ V} V==Bad end} then skip %% event is dropped, bad parameters received else {PSend Port {Record.adjoin {List.toTuple r Result} Msg}} end end end meth !ExecEvent(E Params<=r) if {Dictionary.member self.Events E} then Port#Msg#_=self.Events.E in {PSend Port {Record.adjoin Params Msg}} else skip end end meth Store(M) {Record.forAllInd M proc{$ P V} {self Set(P V)} end} end meth !InitDataInfo % {ForAll [tagname#r(type:atom % init:custom(false) % set:custom(false) % get:internal(true)) % id#r(type:atom % init:outer(false) % set:outer(false) % get:internal(true)) % childPrefixId#r(type:atom % init:custom(false) % set:custom(false) % get:internal(true)) % refId#r(type:atom % init:custom(false) % set:custom(false) % get:internal(true)) % isdisplayed#r(type:bool % init:custom(false) % set:custom(false) % get:internal(true)) % width#r(type:widthlength % default:glue % init:style(true) % set:style(true) % get:internal(true)) % height#r(type:heightlength % default:glue % init:style(true) % set:style(true) % get:internal(true)) % title#r(type:html % init:outer(false) % set:outer(false) % get:internal(false)) % ] % proc{$ K#V} % self.DataInfo.K := V % end} % {ForAll Info.params % proc{$ K#V} % self.DataInfo.K := V % end} % {ForAll Info.events % proc{$ K#V} % self.DataInfo.K := {Record.adjoinAt V type event} % end} % {ForAll {Dictionary.entries self.DataInfo} % proc{$ K#V} % T={CondSelect V type no} % in % if {Not {List.is T}} andthen {Not {ExistType T}} then % raise typeDoesNotExist(self.widgetId K V) end % end % end} {ForAll {GetParam {Label Info.desc}} proc{$ K#V} self.DataInfo.K:=V end} {ForAll {GetEvent {Label Info.desc}} proc{$ K} self.DataInfo.K:=r(bind:outer(true) type:event) end} {ForAll [tagname#r(type:atom init:custom(false) set:custom(false) get:internal(true)) id#r(type:atom init:outer(false) set:outer(false) get:internal(true)) childPrefixId#r(type:atom init:custom(false) set:custom(false) get:internal(true)) refId#r(type:atom init:custom(false) set:custom(false) get:internal(true)) isdisplayed#r(type:bool init:custom(false) set:custom(false) get:internal(true)) width#r(type:widthlength default:glue init:style(true) set:style(true) get:internal(true)) height#r(type:heightlength default:glue init:style(true) set:style(true) get:internal(true)) title#r(type:html init:outer(false) set:outer(false) get:internal(false)) ] proc{$ K#V} self.DataInfo.K := V end} %%%%%%%%%%%%%%%%%%%%%%%%% {ForAll Info.params proc{$ K#V} self.DataInfo.K := V end} {ForAll Info.events proc{$ K#V} self.DataInfo.K := {Record.adjoinAt V type event} end} end meth Check(M) L={Label M} in {Record.forAllInd M proc{$ I V} if {Dictionary.member self.DataInfo I} then F=self.DataInfo.I A={CondSelect F L outer(true)} in case L of get then if F.type==event orelse {Not A.1} then {QUI.raiseError self.widgetId "Invalid operation for parameter : "#I M} end % [] bind then % {CheckType V event M} else if A.1 andthen F.type\=event then {CheckType V F.type M} else {QUI.raiseError self.widgetId "Invalid operation for parameter : "#I M} end end else {QUI.raiseError self.widgetId "Invalid parameter name : "#I M} end end} end meth !OnConnect Top={self get(toplevel:$)} in {self Set(isdisplayed true)} {ForAll {Dictionary.entries self.DataVal} proc{$ K#V} I={Dictionary.condGet self.DataInfo K r(set:outer)} T={Label {CondSelect I set outer}} in if T==html then {Top configure(self if T==style(true) then "style."#K else K end {Marshall self I V})} end end} MixClass,OnConnect end meth !OnDisconnect {self Set(isdisplayed false)} MixClass,OnDisconnect end meth !Set(P V) if {IsDet V} andthen (V==Undefined) then {Dictionary.remove self.DataVal P} else self.DataVal.P:=V end end meth !Get(P V) V={Dictionary.condGet self.DataVal P Undefined} end meth !ReSetCustom %% this methods sets back all parameters that are custom AND not undefined. Usefull in OnConnect for all custom widgets %% that are defined inside the set method only {ForAll {Dictionary.entries self.DataVal} proc{$ K#V} I={Dictionary.condGet self.DataInfo K r(set:outer)} T={CondSelect I set outer} in if T==custom(true) then MixClass,set(K:V) end end} end meth BuildOuterHTML($) "<"#{self get(tagname:$)}#" "#{self BuildStyle($)}#" "# {Join {List.map {List.filter {List.map {Dictionary.entries self.DataVal} fun{$ K#V} Info={Dictionary.condGet self.DataInfo K r(set:custom)} in K#V#Info end} fun{$ _#_#I} if {HasFeature I bind} then {Label I.bind}\=custom else {Label {CondSelect I set outer}}==outer end end} fun{$ K#V#M} K#'='#{Marshall self M V} end} " "}# ">" end meth BuildStyle($) R='style="'#{Join {List.map {List.filter {List.map {Dictionary.entries self.DataVal} fun{$ K#V} Info={Dictionary.condGet self.DataInfo K r(set:custom)} in K#V#{Label {CondSelect Info set outer}}#Info end} fun{$ _#_#I#_} I==style end} fun{$ K#V#_#M} {CondSelect M attribute K}#":"#{RemoveQuote {Marshall self M V}} % case K % of width then if V==glue then % if self.DataVal.glue.exph then "100%" else "auto" end % else {Show M#V} {Marshall self M V} end % [] height then if V==glue then % if self.DataVal.glue.expv then "100%" else "auto" end % else {Marshall self M V} end % else {Marshall self M V} end end} "; "}#'"' in R end meth BuildClosureHTML($) "" end meth !BuildHTML($) {self BuildOuterHTML($)}# '\n'# {self BuildInnerHTML($)}# '\n'# {self BuildClosureHTML($)} end meth !SetTooltips(V) {self Set(title V)} if {self Get(isdisplayed $)} then {{self get(toplevel:$)} configure(self title {Marshall self title V})} end end meth !Send(V) if {self Get(isdisplayed $)} then {{self get(toplevel:$)} send(V)} end end meth !Return(V R) if {self Get(isdisplayed $)} then {{self get(toplevel:$)} return(V R)} end end meth !Configure(Id V) if {self Get(isdisplayed $)} then {{self get(toplevel:$)} configure(self Id V)} end end meth !Cget(Id V) if {self Get(isdisplayed $)} then {{self get(toplevel:$)} cget(self Id V)} end end meth !Sync if {self Get(isdisplayed $)} then % Top={self get(toplevel:$)} % in {ForAll {Dictionary.entries self.DataVal} proc{$ K#_} I={Dictionary.condGet self.DataInfo K r(set:outer)} T={CondSelect I get outer(true)} in if ({Label T}\=internal) andthen T.1 andthen {Not {HasFeature I bind}} then {self get(K:_)} end end} end MixClass,Sync end end in {New C InitDataInfo _} C end} end %% widgets definition fun{QuoteDouble Str} fun{Loop Str} case Str of &\n|Cs then {Loop Cs} [] &"|Cs then &\\|&\\|&"|{Loop Cs} [] &'|Cs then &\\|&'|{Loop Cs} [] C|Cs then C|{Loop Cs} else nil end end in {Loop {VirtualString.toString Str}} end fun{QuoteSingle Str} fun{Loop Str} case Str of &\n|Cs then {Loop Cs} [] &"|Cs then &\\|&"|{Loop Cs} [] &'|Cs then &\\|&\\|&'|{Loop Cs} [] C|Cs then C|{Loop Cs} else nil end end in {Loop {VirtualString.toString Str}} end fun{Quote Str} fun{Loop Str} case Str of &\n|Cs then {Loop Cs} [] &"|Cs then &\\|&"|{Loop Cs} [] &'|Cs then &\\|&'|{Loop Cs} [] C|Cs then C|{Loop Cs} else nil end end in {Loop {VirtualString.toString Str}} end end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLFile.oz0000644000175000017500000000227207365262625022527 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget setTooltips:SetTooltips send:Send baseClass:BaseClass) define {DefineWidget r(desc:file(action(proc{$ O A} {O bind(event:onchange action:A)} end) tooltips(proc{$ O V} {O SetTooltips(V)} end)) tag:input params:[type#r(default:file init:outer(false) set:outer(false) get:outer(false)) value#r(type:html init:outer(true) set:outer(true) get:html(true)) accessKey#r(type:vs init:outer(true) set:outer(true) get:outer(true)) disabled#r(type:bool default:false init:html(true) set:html(true) get:internal(true)) tabIndex#r(type:int init:outer(true) set:outer(true) get:outer(true)) size#r(type:int init:html(true) set:html(true) get:internal(true)) ] events:nil ) class $ from BaseClass meth select {self Send({self get(refId:$)}#".select()")} end meth blur {self Send({self get(refId:$)}#".blur()")} end meth focus {self Send({self get(refId:$)}#".focus()")} end end} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLFrame.oz0000644000175000017500000001717207365262626022710 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget baseClass:BaseClass quoteDouble:QuoteDouble set:Set get:Get send:Send undefined:Undefined sync:Sync onConnect:OnConnect onDisconnect:OnDisconnect join:Join qInit:QInit buildHTML:BuildHTML buildInnerHTML:BuildInnerHTML) QUI define MBuildChild=QUI.mBuildChild MGetChildren=QUI.mGetChildren {DefineWidget r(desc:frameset(container) tag:frameset params:[border#r(type:int init:outer(true) set:outer(true) get:internal(true)) borderColor#r(type:color init:outer(true) set:outer(true) get:internal(true)) cols#r(type:framewidth init:outer(true) set:outer(true) get:internal(true)) frameBorder#r(type:bool init:html(true) set:html(true) get:internal(true)) % frameSpacing#r(type:int % init:outer(true) % set:outer(true) % get:internal(true)) rows#r(type:framewidth init:outer(true) set:outer(true) get:internal(true)) ] events:nil ) class $ from BaseClass meth !QInit(...)=M case {self get(parent:$)}.widgetId of toplevel then skip [] frame then skip [] tdframe then skip [] lrframe then skip else {QUI.raiseError self.widgetId "Error : frameset can be placed inside toplevel, frame, tdframe or lrframe widgets only" M} end {self {Record.adjoin {Record.filterInd M fun{$ I V} if {Int.is I} then {self Add(V)} false else true end end} set}} end meth Add(C)=M if {Label C}\=frame then {QUI.raiseError self.widgetId "Error : a frameset can contain only frame widgets" C} end {self MBuildChild(C _)} end meth Remove(C)=M skip end meth !BuildInnerHTML($) {Join {List.map {Reverse {self MGetChildren($)}} fun{$ C} {C BuildHTML($)} end} ""} end meth Broadcast(M) {ForAll {self MGetChildren($)} proc{$ C} {C M} end} end meth close=M {self Broadcast(M)} end meth !Sync=M {self Broadcast(M)} end meth !OnConnect=M {self Broadcast(M)} end meth !OnDisconnect=M {self Broadcast(M)} end end } {DefineWidget r(desc:frame(container) tag:frame params:[borderColor#r(type:color init:outer(true) set:outer(false) get:internal(true)) frameBorder#r(type:bool init:outer(true) set:outer(false) get:internal(true)) height#r(type:int init:outer(true) set:outer(false) get:outer(true)) marginHeight#r(type:int init:outer(true) set:outer(false) get:outer(true)) marginWidth#r(type:int init:outer(true) set:outer(false) get:outer(true)) name#r(type:atom init:outer(false) set:outer(false) get:outer(false)) noResize#r(type:bool init:outer(true) set:outer(false) get:internal(true)) scrolling#r(type:[auto no yes] init:outer(true) set:outer(false) get:internal(true)) src#r(type:html init:outer(true) set:outer(false) get:outer(true)) ] events:nil ) class $ from BaseClass meth !QInit(...)=M Parent={self get(parent:$)} {self Set(name "f"#{self Get(id $)})} Ref={Parent Get(childPrefixId $)}#"."#{self Get(name $)} in if Parent.widgetId\=frameset then {QUI.raiseError self.widgetId "Error : frame can be placed inside frameset widgets only" M} end {self Set(childPrefixId Ref)} % {self Set(refId Ref#"."#{self Get(id $)})} if {HasFeature M 1} then {self MBuildChild(M.1 _)} end end meth !OnConnect CL={self MGetChildren($)} in if CL==nil then skip else Child={List.last CL} in {self Send({self Get(childPrefixId $)}#'.document.write("'# if {List.member Child.widgetId [frameset tdframe lrframe]} then {QuoteDouble {Child BuildHTML($)}} else {QuoteDouble ""#{Child BuildHTML($)}#""} end#'")')} {self Send({self Get(childPrefixId $)}#'.document.close()')} {Child OnConnect} end end end} proc{Build Dir} {DefineWidget r(desc:{Record.adjoin frameset(container) {VirtualString.toAtom Dir#"frame"}} tag:frameset params:{List.append [border#r(type:int init:outer(true) set:outer(true) get:internal(true)) borderColor#r(type:color init:outer(true) set:outer(true) get:internal(true)) frameBorder#r(type:bool init:html(true) set:html(true) get:internal(true)) % frameSpacing#r(type:int % init:outer(true) % set:outer(true) % get:internal(true)) ] if Dir==td then [rows#r(type:framewidth init:outer(true) set:outer(true) get:internal(true)) cols#r(type:framewidth default:[100#'%'] init:outer(false) set:outer(false) get:internal(false)) ] else [rows#r(type:framewidth default:[100#'%'] init:outer(false) set:outer(false) get:internal(false)) cols#r(type:framewidth init:outer(true) set:outer(true) get:internal(true))] end} events:nil ) class $ from BaseClass meth !QInit(...)=M case {self get(parent:$)}.widgetId of toplevel then skip [] frame then skip [] tdframe then skip [] lrframe then skip else {QUI.raiseError self.widgetId "Error : tdframe or lrframe can be placed inside toplevel, frame, tdframe or lrframe widgets only" M} end {self {Record.adjoin {Record.filterInd M fun{$ I V} if {Int.is I} then {self Add(V)} false else true end end} set}} local T={Length {self MGetChildren($)}} proc{SetD D} if {self Get(D $)}==Undefined then I=100 div T in {self Set(D {List.mapInd {List.make T} fun{$ J C} C=if J==T then '*' else I#'%' end end})} end end in {SetD if Dir==td then rows else cols end} end end meth Add(C)=M Ref={self Get(childPrefixId $)}#".f"#({Length {self MGetChildren($)}}+1) CP={self Get(childPrefixId $)} {self Set(childPrefixId Ref)} {self MBuildChild(C _)} in {self Set(childPrefixId CP)} end meth Remove(C)=M skip end meth !BuildInnerHTML($) {Join {List.mapInd {Reverse {self MGetChildren($)}} fun{$ I _} "" end} ""} end meth Broadcast(M) {ForAll {self MGetChildren($)} proc{$ C} {C M} end} end meth close=M {self Broadcast(M)} end meth !Sync=M {self Broadcast(M)} end meth !OnConnect=M {ForAll {Reverse {self MGetChildren($)}} proc{$ C} Ref={C Get(childPrefixId $)} in {self Send(Ref#'.document.write("'# if {List.member C.widgetId [frameset tdframe lrframe]} then {QuoteDouble {C BuildHTML($)}} else {QuoteDouble ""#{C BuildHTML($)}#""} end#'")')} {self Send(Ref#'.document.close()')} end} {self Broadcast(M)} end meth !OnDisconnect=M {self Broadcast(M)} end end } end {Build td} {Build lr} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLHr.oz0000644000175000017500000000062107365262626022216 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget baseClass:BaseClass) define {DefineWidget r(desc:hr tag:hr params:[color#r(type:color init:outer(true) set:outer(true) get:internal(true)) noShade#r(type:bool init:html(true) set:html(true) get:internal(true))] events:nil ) BaseClass} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLHtml.oz0000644000175000017500000000346607365262626022563 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget baseClass:BaseClass sync:Sync onConnect:OnConnect onDisconnect:OnDisconnect qInit:QInit buildHTML:BuildHTML buildInnerHTML:BuildInnerHTML) QUI define MBuildChild=QUI.mBuildChild MGetChildren=QUI.mGetChildren fun{Purge Str} case Str of &\n|Cs then &&|&#|&1|&3|&;|{Purge Cs} [] &\r|Cs then &&|&#|&1|&0|&;|{Purge Cs} [] C|Cs then C|{Purge Cs} else nil end end SimpleHtml={NewName} {DefineWidget r(desc:SimpleHtml tag:span params:[1#r(type:no init:custom(true) set:custom(false) get:custom(false))] events:nil) class $ from BaseClass feat text meth !QInit(...)=M self.text={Purge M.1} end meth !BuildInnerHTML($) self.text end end} {DefineWidget r(desc:html(container) tag:span params:nil events:nil) class $ from BaseClass meth !QInit(...)=M {Record.forAll M proc{$ V} if {VirtualString.is V} then {self MBuildChild(SimpleHtml(V) _)} elseif {Record.is V} then {self MBuildChild(V _)} else {QUI.raiseError self.widgetd "Invalid html declaration :"#V M} end end} end meth !BuildInnerHTML($) {List.foldL {Reverse {self MGetChildren($)}} fun{$ O N} O#if {VirtualString.is N} then N else {N BuildHTML($)} end end ""} end meth Broadcast(M) {ForAll {self MGetChildren($)} proc{$ C} if {Object.is C} then {C M} end end} end meth !Sync {self Broadcast(Sync)} end meth !OnConnect {self Broadcast(OnConnect)} end meth !OnDisconnect {self Broadcast(OnDisconnect)} end end } end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLImg.oz0000644000175000017500000000632007365262626022363 0ustar kevingkevingfunctor import QUI QHTMLDevel(defineWidget:DefineWidget baseClass:BaseClass configure:Configure set:Set get:Get join:Join quoteDouble:QuoteDouble undefined:Undefined checkType:CheckType qInit:QInit buildInnerHTML:BuildInnerHTML) QHTMLType(translate2HTML:Translate2HTML) define {DefineWidget r(desc:img tag:img params:[alt#r(type:html init:outer(true) set:outer(true) get:internal(true)) border#r(type:int init:outer(true) set:outer(true) get:internal(true)) dynsrc#r(type:html init:outer(true) set:outer(true) get:internal(true)) map#r(type:no init:custom(true) set:custom(true) get:internal(true)) usemap#r(type:vs init:outer(false) set:outer(false) get:internal(false)) longdesc#r(type:html init:outer(true) set:outer(true) get:internal(true)) loop#r(type:int init:outer(true) set:outer(true) get:internal(true)) lowsrc#r(type:html init:outer(true) set:outer(true) get:internal(true)) src#r(type:html init:outer(true) set:outer(true) get:internal(true)) start#r(type:[fileopen mouseover] unmarshall:String.toAtom init:outer(true) set:outer(true) get:internal(true))] events:nil ) class $ from BaseClass meth !QInit(...)=M {self {Record.adjoin M set}} end meth set(...)=M {Record.forAllInd M proc{$ I V} case I of map then if V==nil then {self Set(usemap Undefined)} else {self Set(usemap "#m"#{self Get(id $)})} end {CheckType V list M} {ForAll V proc{$ R} proc{Test S C H T} proc{Check I} {CheckType C lint M} if (I==inf andthen {Length C}>2) orelse (I=={Length C}) then skip else {QUI.raiseError V "Invalid number of coords for shape : "#S M} end end in case S of circle then {Check 3} [] polygon then {Check inf} [] rectangle then {Check 4} else {QUI.raiseError V "Invalid shape type, expecting circle,polygon or rectangle : "#S M} end {CheckType H vs M} {CheckType T ['_parent' '_self' '_top' '_blank'] M} end in case R of area(shape:S coords:C href:H) then {Test S C H '_blank'} [] area(shape:S coords:C href:H target:T) then {Test S C H T} else {QUI.raiseError V "Invalid type, expecting a list of records area(shape:Atom coords:ListOfIntegers href:VS)" M} end end} {self Configure(innerHTML {QuoteDouble '"'#{self BuildInnerHTML($)}#'"'} )} end end} end meth !BuildInnerHTML($) if {self Get(map $)}\=Undefined then ""# {Join {List.map {self Get(map $)} fun{$ R} "" end} ""} else "" end end end} end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLLabel.oz0000644000175000017500000000230507365262626022665 0ustar kevingkevingfunctor import QHTMLDevel(defineWidget:DefineWidget baseClass:BaseClass quote:Quote get:Get configure:Configure qInit:QInit buildInnerHTML:BuildInnerHTML) HTMLmarshaller(vS2HTML:Vs2html) define fun{ToHTML O} fun{Loop S} case S of &\\|Xs then &\\|&\\|{Loop Xs} [] &&|&#|&0|&1|&3|Xs then &<|&B|&R|&>|{Loop Xs} [] &&|&#|&0|&1|&0|Xs then {Loop Xs} % [] &\n|Xs then &<|&B|&R|&>|{Loop Xs} [] & |Xs then &&|&n|&b|&s|&p|&;|{Loop Xs} [] X|Xs then X|{Loop Xs} else nil end end V={O Get(value $)} in {Loop if {VirtualString.is V} then {Vs2html V} else "" end} end {DefineWidget r(desc:label tag:span params:[value#r(type:vs init:custom(true) set:custom(true) get:internal(true))] events:nil ) class $ from BaseClass meth !QInit(...)=M {self {Record.adjoin M set}} end meth set(...)=M {Record.forAllInd M proc{$ I V} case I of value then {self Configure(innerHTML {Quote '"'#{ToHTML self}#'"'})} end end} end meth !BuildInnerHTML($) {ToHTML self} end end } end mozart-stdlib-20060615/mozart-stdlib/wp/qhtml/QHTMLListbox.oz0000644000175000017500000001253407365262626023277 0ustar kevingkevingfunctor import QUI QHTMLDevel(defineWidget:DefineWidget onConnect:OnConnect set:Set get:Get send:Send return:Return undefined:Undefined quoteDouble:QuoteDouble baseClass:BaseClass qInit:QInit buildInnerHTML:BuildInnerHTML) HTMLmarshaller(vS2HTML:Vs2html) define NoArgs={NewName} % fun{ToHTML V} % fun{Loop S} % case S % of &\\|&\\|Xs then &\\|&\\|&\\|&\\|{Loop Xs} % [] X|Xs then X|{Loop Xs} % else nil end % end % in % {Loop if {VirtualString.is V} then {Vs2html V} else "" end} % end {DefineWidget r(desc:listbox(action(proc{$ O A} {O bind(event:onclick action:A)} end)) tag:select params:[accessKey#r(type:vs init:outer(true) set:outer(true) get:outer(true)) align#r(type:[absbottom absmiddle baseline bottom left middle right texttop top] unmarshall:String.toAtom init:outer(true) set:outer(true) get:outer(true)) disabled#r(type:bool default:false init:html(true) set:html(true) get:internal(true)) multiple#r(type:bool default:true init:html(true) set:html(true) get:internal(true)) size#r(type:int default:5 init:outer(true) set:outer(false) get:internal(true)) tabIndex#r(type:int init:outer(true) set:outer(true) get:outer(true)) selection#r(type:lbool init:custom(true) set:custom(true) get:custom(true)) list#r(type:lvs default:nil init:custom(true) set:custom(true) get:internal(true)) selectedIndex#r(type:int init:custom(true) set:custom(true) get:custom(true)) ] events:nil ) class $ from BaseClass attr list meth !QInit(...)=M list<-nil {self {Record.adjoin M set}} end meth set(...)=M {Record.forAllInd M proc{$ I V} case I of list then if {self get(isdisplayed:$)} then %% make a diff with @list and Add or Remove as necessary proc{Loop1 I N O} case N of NX|NXs then fun{Search I L Ls} case L of X|Xs then if X==NX then Ls=Xs I else {Search I+1 Xs Ls} end else false end end Os J={Search 0 O Os} in if J==false then %% new option in the list : adds it {self Add(NX I)} {Loop1 I+1 NXs O} else %% delete option until found position proc{Loop K} if K>0 then {self Remove(I)} {Loop K-1} end end in {Loop J} {Loop1 I+1 NXs Os} end else % remove remaining options {ForAll O proc{$ _} {self Remove(I)} end} end end in {Loop1 0 V @list} end list<-V [] selection then if {self get(isdisplayed:$)} then {self Send('top.setSelection('#{self get(refId:$)}#',"'# {List.map V fun{$ C} if C then &1 else &0 end end} #'")')} end {self Set(selection V)} local First in {List.takeWhileInd V fun{$ I B} if B then First=I false else true end end _} if {IsFree First} then First=0 end {self Set(selectedIndex First)} end [] selectedIndex then {self set(selection:{List.mapInd {List.make V} fun{$ I X} I==V end})} end end} end meth get(...)=M {Record.forAllInd M proc{$ I V} case I of selection then if {self get(isdisplayed:$)} then Ret={self Return('ozreturn=getSelection('#{self get(refId:$)}#')' $)} in V=if Ret==Undefined then Undefined else {List.map Ret fun{$ C} C==&1 end} end else V={self Get(selection $)} end [] selectedIndex then if {self get(isdisplayed:$)} then Ret={self Return('ozreturn=getSelectedIndex('#{self get(refId:$)}#')' $)} in V=if Ret==Undefined then Undefined else {String.toInt Ret}+1 end else V={self Get(selectedIndex $)} end end end} end meth blur {self Send({self get(refId:$)}#".blur()")} end meth focus {self Send({self get(refId:$)}#".focus()")} end meth !BuildInnerHTML($) {List.foldL {self Get(list $)} fun{$ Old New} Old#"